forked from indymedia/epicyon
Avoid duplicates
parent
ad54923b1a
commit
ccaefc46e9
|
@ -1183,6 +1183,9 @@ def addEmbeddedAudio(content: str) -> str:
|
||||||
if not ('.mp3' in content or '.ogg' in content):
|
if not ('.mp3' in content or '.ogg' in content):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
if '<audio ' in content:
|
||||||
|
return content
|
||||||
|
|
||||||
extension='.mp3'
|
extension='.mp3'
|
||||||
if '.ogg' in content:
|
if '.ogg' in content:
|
||||||
extension='.ogg'
|
extension='.ogg'
|
||||||
|
@ -1206,7 +1209,7 @@ def addEmbeddedAudio(content: str) -> str:
|
||||||
if not (w.startswith('http') or w.startswith('dat:') or '/' in w):
|
if not (w.startswith('http') or w.startswith('dat:') or '/' in w):
|
||||||
continue
|
continue
|
||||||
url=w
|
url=w
|
||||||
content+='<center><audio width="400" height="50" controls>'
|
content+='<center><audio controls>'
|
||||||
content+='<source src="'+url+'" type="audio/'+extension.replace('.','')+'">'
|
content+='<source src="'+url+'" type="audio/'+extension.replace('.','')+'">'
|
||||||
content+='Your browser does not support the audio element.'
|
content+='Your browser does not support the audio element.'
|
||||||
content+='</audio></center>'
|
content+='</audio></center>'
|
||||||
|
@ -1218,6 +1221,9 @@ def addEmbeddedVideo(content: str,width=400,height=300) -> str:
|
||||||
if not ('.mp4' in content or '.webm' in content or '.ogv' in content):
|
if not ('.mp4' in content or '.webm' in content or '.ogv' in content):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
if '<video ' in content:
|
||||||
|
return content
|
||||||
|
|
||||||
extension='.mp4'
|
extension='.mp4'
|
||||||
if '.webm' in content:
|
if '.webm' in content:
|
||||||
extension='.webm'
|
extension='.webm'
|
||||||
|
|
Loading…
Reference in New Issue