Don't try to preview youtube channels

merge-requests/30/head
Bob Mottram 2022-02-24 17:31:12 +00:00
parent f54591b2c9
commit f9d621f940
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ 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:
if '"' in url and '/channel/' not in url:
url = url.split('"')[0].replace('/watch?v=', '/embed/')
if '&' in url:
url = url.split('&')[0]
@ -70,7 +70,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
video_site = 'https://youtu.be/'
if '"' + video_site in content:
url = content.split('"' + video_site)[1]
if '"' in url:
if '"' in url and '/channel/' not in url:
url = 'embed/' + url.split('"')[0]
if '&' in url:
url = url.split('&')[0]