mirror of https://gitlab.com/bashrc2/epicyon
Abandon tiktok embed
parent
025f701ec6
commit
179980eed3
|
@ -37,32 +37,6 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
domain: str) -> str:
|
domain: str) -> str:
|
||||||
"""Adds embedded videos
|
"""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:
|
if '<iframe' in content:
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue