mirror of https://gitlab.com/bashrc2/epicyon
Don't allow autoplay of embedded video, and explicitly turn autoplay off on invideous sites
parent
47edfad98d
commit
0ec0e0460b
|
@ -44,7 +44,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
"src=\"https://player.vimeo.com/video/" + \
|
"src=\"https://player.vimeo.com/video/" + \
|
||||||
url + "\" width=\"" + str(width) + \
|
url + "\" width=\"" + str(width) + \
|
||||||
"\" height=\"" + str(height) + \
|
"\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; " + \
|
"\" frameborder=\"0\" allow=\"" + \
|
||||||
"fullscreen\" allowfullscreen></iframe>\n</center>\n"
|
"fullscreen\" allowfullscreen></iframe>\n</center>\n"
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
"decoding=\"async\" src=\"" + \
|
"decoding=\"async\" src=\"" + \
|
||||||
video_site + url + "\" width=\"" + str(width) + \
|
video_site + url + "\" width=\"" + str(width) + \
|
||||||
"\" height=\"" + str(height) + \
|
"\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||||
"allowfullscreen></iframe>\n</center>\n"
|
"allowfullscreen></iframe>\n</center>\n"
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
"decoding=\"async\" src=\"" + \
|
"decoding=\"async\" src=\"" + \
|
||||||
video_site + url + "\" width=\"" + str(width) + \
|
video_site + url + "\" width=\"" + str(width) + \
|
||||||
"\" height=\"" + str(height) + \
|
"\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||||
"allowfullscreen></iframe>\n</center>\n"
|
"allowfullscreen></iframe>\n</center>\n"
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
@ -114,12 +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 '&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=\"" + \
|
||||||
video_site + url + "\" width=\"" + \
|
video_site + url + "\" width=\"" + \
|
||||||
str(width) + "\" height=\"" + str(height) + \
|
str(width) + "\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||||
"allowfullscreen></iframe>\n</center>\n"
|
"allowfullscreen></iframe>\n</center>\n"
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
@ -204,7 +209,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
"allow-scripts\" src=\"https://" + \
|
"allow-scripts\" src=\"https://" + \
|
||||||
site + url + "\" width=\"" + str(width) + \
|
site + url + "\" width=\"" + str(width) + \
|
||||||
"\" height=\"" + str(height) + \
|
"\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; " + \
|
"\" frameborder=\"0\" allow=\"" + \
|
||||||
"fullscreen\" allowfullscreen></iframe>\n</center>\n"
|
"fullscreen\" allowfullscreen></iframe>\n</center>\n"
|
||||||
return content
|
return content
|
||||||
return content
|
return content
|
||||||
|
|
Loading…
Reference in New Issue