Remove tracking extensions from youtube urls

merge-requests/8/head
Bob Mottram 2021-01-14 09:38:51 +00:00
parent 6b1991d472
commit 30918e6b1d
1 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,8 @@ def _addEmbeddedVideoFromSites(translate: {}, content: str,
url = url.split('"')[0].replace('/watch?v=', '/embed/')
if '&' in url:
url = url.split('&')[0]
if '?utm_' in url:
url = url.split('?utm_')[0]
content = \
content + "<center>\n<iframe loading=\"lazy\" src=\"" + \
videoSite + url + "\" width=\"" + str(width) + \
@ -80,6 +82,8 @@ def _addEmbeddedVideoFromSites(translate: {}, content: str,
url = url.split('"')[0].replace('/watch?v=', '/embed/')
if '&' in url:
url = url.split('&')[0]
if '?utm_' in url:
url = url.split('?utm_')[0]
content = \
content + "<center>\n<iframe loading=\"lazy\" src=\"" + \
videoSite + url + "\" width=\"" + \