Remove trailing youtube params

main2
Bob Mottram 2019-10-22 09:44:33 +01:00
parent 02ea84eadc
commit baaf4c9e27
1 changed files with 4 additions and 0 deletions

View File

@ -1564,6 +1564,8 @@ def addEmbeddedVideoFromSites(translate: {},content: str,width=400,height=300) -
url=content.split('"'+videoSite)[1] url=content.split('"'+videoSite)[1]
if '"' in url: if '"' in url:
url=url.split('"')[0].replace('/watch?v=','/embed/') url=url.split('"')[0].replace('/watch?v=','/embed/')
if '&' in url:
url=url.split('&')[0]
content=content+"<center><iframe loading=\"lazy\" src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>" content=content+"<center><iframe loading=\"lazy\" src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>"
return content return content
@ -1573,6 +1575,8 @@ def addEmbeddedVideoFromSites(translate: {},content: str,width=400,height=300) -
url=content.split('"'+videoSite)[1] url=content.split('"'+videoSite)[1]
if '"' in url: if '"' in url:
url=url.split('"')[0].replace('/watch?v=','/embed/') url=url.split('"')[0].replace('/watch?v=','/embed/')
if '&' in url:
url=url.split('&')[0]
content=content+"<center><iframe loading=\"lazy\" src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>" content=content+"<center><iframe loading=\"lazy\" src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>"
return content return content