Merge branch 'main' of gitlab.com:bashrc2/epicyon

merge-requests/30/head
Bob Mottram 2022-02-22 10:19:15 +00:00
commit 5d796b587f
1 changed files with 8 additions and 1 deletions

View File

@ -49,6 +49,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
return content
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:
url = content.split('"' + video_site)[1]
if '"' in url:
@ -170,7 +172,12 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url = content.split(site_str)[1]
if '"' not in url:
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 += \
"<center>\n<iframe loading=\"lazy\" " + \
"sandbox=\"allow-same-origin " + \