Support ccc videos

master
Bob Mottram 2019-08-21 12:34:02 +01:00
parent 75bd6dc877
commit cfc2664298
1 changed files with 13 additions and 4 deletions

View File

@ -1019,11 +1019,20 @@ def addEmbeddedVideo(content: str,width=400,height=300) -> str:
content=content+"<center><iframe src=\"https://player.vimeo.com/video/"+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>" content=content+"<center><iframe src=\"https://player.vimeo.com/video/"+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>"
return content return content
if '"https://www.youtube.com' in content: videoSite='https://www.youtube.com'
url=content.split('"https://www.youtube.com')[1] if '"'+videoSite in content:
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/')
content=content+"<center><iframe src=\"https://www.youtube.com"+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>" content=content+"<center><iframe src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>"
return content
videoSite='https://media.ccc.de'
if '"'+videoSite in content:
url=content.split('"'+videoSite)[1]
if '"' in url:
url=url.split('"')[0]
content=content+"<center><iframe src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>"
return content return content
# A selection of the current larger peertube sites, mostly French and German language # A selection of the current larger peertube sites, mostly French and German language