Invidious does need autoplay to be explicitly turned off

merge-requests/30/head
Bob Mottram 2022-04-06 11:44:48 +01:00
parent 9f976a002d
commit 9438e27cdf
1 changed files with 11 additions and 0 deletions

View File

@ -114,6 +114,17 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url = url.split('&')[0] url = url.split('&')[0]
if '?utm_' in url: if '?utm_' in url:
url = url.split('?utm_')[0] url = url.split('?utm_')[0]
# explicitly turn off autoplay
if '?' in url:
if '&autoplay=' not in url:
url += '&autoplay=0'
else:
url = url.replace('&autoplay=1', '&autoplay=0')
else:
if '?autoplay=' not in url:
url += '?autoplay=0'
else:
url = url.replace('?autoplay=1', '?autoplay=0')
content += \ content += \
"<center>\n<iframe loading=\"lazy\" " + \ "<center>\n<iframe loading=\"lazy\" " + \
"decoding=\"async\" src=\"" + \ "decoding=\"async\" src=\"" + \