diff --git a/webapp_media.py b/webapp_media.py index 776a46e21..f502418f7 100644 --- a/webapp_media.py +++ b/webapp_media.py @@ -37,6 +37,33 @@ def _add_embedded_video_from_sites(translate: {}, content: str, domain: str) -> str: """Adds embedded videos """ + if 'www.tiktok.com/@' in content and \ + 'www.tiktok.com/embed.js' not in content: + url = content.split('www.tiktok.com/@')[1] + if '<' in url: + url = url.split('<')[0] + if '/video/' in url: + channel = url.split('/')[0] + video_id = url.split('/')[1] + if '?' in video_id: + video_id = video_id.split('?')[0] + content += \ + '
\n\n' + \ + '
\n' + \ + '
\n' + \ + '@' + channel + '\n' + \ + '
\n
\n' + \ + '
\n
\n' + return content + if '