mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
5d796b587f
|
|
@ -49,6 +49,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
return content
|
return content
|
||||||
|
|
||||||
video_site = 'https://www.youtube.com'
|
video_site = 'https://www.youtube.com'
|
||||||
|
if 'https://m.youtube.com' in content:
|
||||||
|
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:
|
if '"' in url:
|
||||||
|
|
@ -170,7 +172,12 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
url = content.split(site_str)[1]
|
url = content.split(site_str)[1]
|
||||||
if '"' not in url:
|
if '"' not in url:
|
||||||
continue
|
continue
|
||||||
url = url.split('"')[0].replace('/watch/', '/embed/')
|
url = url.split('"')[0]
|
||||||
|
if '/c/' in url:
|
||||||
|
# don't try to embed peertube channel page
|
||||||
|
continue
|
||||||
|
url = url.replace('/w/', '/embed/')
|
||||||
|
url = url.replace('/watch/', '/embed/')
|
||||||
content += \
|
content += \
|
||||||
"<center>\n<iframe loading=\"lazy\" " + \
|
"<center>\n<iframe loading=\"lazy\" " + \
|
||||||
"sandbox=\"allow-same-origin " + \
|
"sandbox=\"allow-same-origin " + \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue