Abandon tiktok embed

merge-requests/30/head
Bob Mottram 2022-10-08 19:29:10 +01:00
parent 025f701ec6
commit 179980eed3
1 changed files with 0 additions and 26 deletions

View File

@ -37,32 +37,6 @@ 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('/video/')[0]
video_id = url.split('/video/')[1]
if '?' in video_id:
video_id = video_id.split('?')[0]
content += \
'<center>\n' + \
'<blockquote class="tiktok-embed" ' + \
'cite="https://www.tiktok.com/@' + \
channel + '/video/' + video_id + '" data-video-id="' + \
video_id + '" >\n' + \
'<section>\n' + \
'<a target="_blank" title="@' + channel + \
'" href="https://www.tiktok.com/@' + channel + \
'?refer=embed">@' + channel + '</a>\n' + \
'</section>\n</blockquote>\n' + \
'<script async ' + \
'src="https://www.tiktok.com/embed.js">\n' + \
'</script>\n</center>\n'
return content
if '<iframe' in content:
return content