mirror of https://gitlab.com/bashrc2/epicyon
Check for channel after url is extracted
parent
266a74e85a
commit
c28e6b5f0f
|
|
@ -53,37 +53,41 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
content = content.replace('https://m.youtube.com', video_site)
|
content = content.replace('https://m.youtube.com', video_site)
|
||||||
if '"' + video_site in content:
|
if '"' + video_site in content:
|
||||||
url = content.split('"' + video_site)[1]
|
url = content.split('"' + video_site)[1]
|
||||||
if '"' in url and '/channel/' not in url:
|
if '"' in url:
|
||||||
url = url.split('"')[0].replace('/watch?v=', '/embed/')
|
url = url.split('"')[0]
|
||||||
if '&' in url:
|
if '/channel/' not in url:
|
||||||
url = url.split('&')[0]
|
url = url.replace('/watch?v=', '/embed/')
|
||||||
if '?utm_' in url:
|
if '&' in url:
|
||||||
url = url.split('?utm_')[0]
|
url = url.split('&')[0]
|
||||||
content += \
|
if '?utm_' in url:
|
||||||
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
url = url.split('?utm_')[0]
|
||||||
video_site + url + "\" width=\"" + str(width) + \
|
content += \
|
||||||
"\" height=\"" + str(height) + \
|
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
video_site + url + "\" width=\"" + str(width) + \
|
||||||
"allowfullscreen></iframe>\n</center>\n"
|
"\" height=\"" + str(height) + \
|
||||||
return content
|
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||||
|
"allowfullscreen></iframe>\n</center>\n"
|
||||||
|
return content
|
||||||
|
|
||||||
video_site = 'https://youtu.be/'
|
video_site = 'https://youtu.be/'
|
||||||
if '"' + video_site in content:
|
if '"' + video_site in content:
|
||||||
url = content.split('"' + video_site)[1]
|
url = content.split('"' + video_site)[1]
|
||||||
if '"' in url and '/channel/' not in url:
|
if '"' in url:
|
||||||
url = 'embed/' + url.split('"')[0]
|
url = url.split('"')[0]
|
||||||
if '&' in url:
|
if '/channel/' not in url:
|
||||||
url = url.split('&')[0]
|
url = 'embed/' + url
|
||||||
if '?utm_' in url:
|
if '&' in url:
|
||||||
url = url.split('?utm_')[0]
|
url = url.split('&')[0]
|
||||||
video_site = 'https://www.youtube.com/'
|
if '?utm_' in url:
|
||||||
content += \
|
url = url.split('?utm_')[0]
|
||||||
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
video_site = 'https://www.youtube.com/'
|
||||||
video_site + url + "\" width=\"" + str(width) + \
|
content += \
|
||||||
"\" height=\"" + str(height) + \
|
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
video_site + url + "\" width=\"" + str(width) + \
|
||||||
"allowfullscreen></iframe>\n</center>\n"
|
"\" height=\"" + str(height) + \
|
||||||
return content
|
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||||
|
"allowfullscreen></iframe>\n</center>\n"
|
||||||
|
return content
|
||||||
|
|
||||||
invidious_sites = (
|
invidious_sites = (
|
||||||
'https://invidious.snopyta.org',
|
'https://invidious.snopyta.org',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue