fix 500 error

master
Aevann 2024-04-06 09:53:38 +02:00
parent 10e5e0c841
commit dc9be397aa
1 changed files with 4 additions and 3 deletions

View File

@ -107,9 +107,10 @@ video_sub_regex = re.compile(f'(?<!")(https:\/\/({hosts})\/[\w:~,()\-.#&\/=?@%;+
def video_sub_regex_matcher(match):
url = match.group(1)
posterurl = g.posterurls.get(url)
if posterurl:
return f'<p class="resizable"><video poster="{posterurl}" controls preload="none" src="{url}"></video></p>'
if hasattr(g, 'posterurls'):
posterurl = g.posterurls.get(url)
if posterurl:
return f'<p class="resizable"><video poster="{posterurl}" controls preload="none" src="{url}"></video></p>'
return f'<p class="resizable"><video controls preload="none" src="{url}"></video></p>'
audio_regex_extensions = '|'.join(AUDIO_FORMATS)