mirror of https://gitlab.com/bashrc2/epicyon
Check that video site has a path
parent
cd442d1415
commit
903bedbf01
|
@ -63,6 +63,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
url = content.split('>vimeo.com/')[1]
|
||||
if '<' in url:
|
||||
url = url.split('<')[0]
|
||||
if url:
|
||||
content += \
|
||||
"<center>\n<span itemprop=\"video\">\n" + \
|
||||
"<iframe loading=\"lazy\" decoding=\"async\" " + \
|
||||
|
@ -82,7 +83,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
url = content.split('"' + video_site)[1]
|
||||
if '"' in url:
|
||||
url = url.split('"')[0]
|
||||
if '/channel/' not in url and '/playlist' not in url:
|
||||
if url and '/channel/' not in url and '/playlist' not in url:
|
||||
url = url.replace('/watch?v=', '/embed/')
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
|
@ -104,7 +105,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
url = content.split('"' + video_site)[1]
|
||||
if '"' in url:
|
||||
url = url.split('"')[0]
|
||||
if '/channel/' not in url and '/playlist' not in url:
|
||||
if url and '/channel/' not in url and '/playlist' not in url:
|
||||
url = 'embed/' + url
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
|
@ -140,7 +141,10 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
if '"' + video_site in content:
|
||||
url = content.split('"' + video_site)[1]
|
||||
if '"' in url:
|
||||
url = url.split('"')[0].replace('/watch?v=', '/embed/')
|
||||
url = url.split('"')[0]
|
||||
if not url:
|
||||
continue
|
||||
url = url.replace('/watch?v=', '/embed/')
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
if '?utm_' in url:
|
||||
|
@ -174,6 +178,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
url = content.split('"' + video_site)[1]
|
||||
if '"' in url:
|
||||
url = url.split('"')[0]
|
||||
if url:
|
||||
video_site_settings = ''
|
||||
if '#' in url:
|
||||
video_site_settings = '#' + url.split('#', 1)[1]
|
||||
|
|
Loading…
Reference in New Issue