Test for channel name

main
Bob Mottram 2022-10-08 15:15:06 +01:00
parent 53b2d3c773
commit 00765d4b26
1 changed files with 5 additions and 1 deletions

View File

@ -43,7 +43,11 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url = content.split('www.twitch.tv/')[1] url = content.split('www.twitch.tv/')[1]
if '<' in url: if '<' in url:
channel = url.split('<')[0] channel = url.split('<')[0]
if channel and '/' not in channel and ' ' not in channel: if channel and \
'/' not in channel and \
'?' not in channel and \
'=' not in channel and \
' ' not in channel:
content += \ content += \
'<center>\n<span itemprop="video">\n' + \ '<center>\n<span itemprop="video">\n' + \
'<iframe src="https://player.twitch.tv/?channel=' + \ '<iframe src="https://player.twitch.tv/?channel=' + \