mirror of https://gitlab.com/bashrc2/epicyon
Shortened youtube url
parent
916a1baf3a
commit
220e04283a
|
@ -65,6 +65,23 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
"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:
|
||||
url = 'embed/' + url.split('"')[0]
|
||||
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
|
||||
|
||||
invidious_sites = (
|
||||
'https://invidious.snopyta.org',
|
||||
'https://yewtu.be',
|
||||
|
|
Loading…
Reference in New Issue