From 0ed4f43f01f29ff08625ebfb69cf599ceb174c45 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 8 Oct 2022 15:09:21 +0100 Subject: [PATCH] Enable twitch channel embed --- webapp_media.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webapp_media.py b/webapp_media.py index 9d4d3e5db..73e74fbad 100644 --- a/webapp_media.py +++ b/webapp_media.py @@ -36,6 +36,20 @@ def _add_embedded_video_from_sites(translate: {}, content: str, width: int, height: int) -> str: """Adds embedded videos """ + if 'www.twitch.tv/' in content: + url = content.split('www.twitch.tv/')[1] + if '<' in url: + channel = url.split('<')[0] + if channel and '/' not in channel and ' ' not in channel: + content += \ + '
\n\n' + \ + '' + \ + '\n
\n' + return content + if '>vimeo.com/' in content: url = content.split('>vimeo.com/')[1] if '<' in url: