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)
|
||||
if '"' + video_site in content:
|
||||
url = content.split('"' + video_site)[1]
|
||||
if '"' in url and '/channel/' not in url:
|
||||
url = url.split('"')[0].replace('/watch?v=', '/embed/')
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
if '?utm_' in url:
|
||||
url = url.split('?utm_')[0]
|
||||
content += \
|
||||
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||
video_site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n</center>\n"
|
||||
return content
|
||||
if '"' in url:
|
||||
url = url.split('"')[0]
|
||||
if '/channel/' not in url:
|
||||
url = url.replace('/watch?v=', '/embed/')
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
if '?utm_' in url:
|
||||
url = url.split('?utm_')[0]
|
||||
content += \
|
||||
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||
video_site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n</center>\n"
|
||||
return content
|
||||
|
||||
video_site = 'https://youtu.be/'
|
||||
if '"' + video_site in content:
|
||||
url = content.split('"' + video_site)[1]
|
||||
if '"' in url and '/channel/' not in url:
|
||||
url = 'embed/' + url.split('"')[0]
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
if '?utm_' in url:
|
||||
url = url.split('?utm_')[0]
|
||||
video_site = 'https://www.youtube.com/'
|
||||
content += \
|
||||
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||
video_site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n</center>\n"
|
||||
return content
|
||||
if '"' in url:
|
||||
url = url.split('"')[0]
|
||||
if '/channel/' not in url:
|
||||
url = 'embed/' + url
|
||||
if '&' in url:
|
||||
url = url.split('&')[0]
|
||||
if '?utm_' in url:
|
||||
url = url.split('?utm_')[0]
|
||||
video_site = 'https://www.youtube.com/'
|
||||
content += \
|
||||
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||
video_site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n</center>\n"
|
||||
return content
|
||||
|
||||
invidious_sites = (
|
||||
'https://invidious.snopyta.org',
|
||||
|
|
Loading…
Reference in New Issue