mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[tiktok] fix extraction
This commit is contained in:
parent
f6b28b7697
commit
2e5ced0700
@ -6,12 +6,10 @@ from ..common import *
|
|||||||
|
|
||||||
def tiktok_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
def tiktok_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||||
html = get_html(url, faker=True)
|
html = get_html(url, faker=True)
|
||||||
title = r1(r'<title>(.*?)</title>', html)
|
title = r1(r'<title.*?>(.*?)</title>', html)
|
||||||
video_id = r1(r'/video/(\d+)', url) or r1(r'musical\?id=(\d+)', html)
|
video_id = r1(r'/video/(\d+)', url) or r1(r'musical\?id=(\d+)', html)
|
||||||
title = '%s [%s]' % (title, video_id)
|
title = '%s [%s]' % (title, video_id)
|
||||||
dataText = r1(r'var data = \[(.*)\] ', html) or r1(r'var data = (\{.*\})', html)
|
source = r1(r'<video .*?src="([^"]+)"', html)
|
||||||
data = json.loads(dataText)
|
|
||||||
source = 'http:' + data['video']['play_addr']['url_list'][0]
|
|
||||||
mime, ext, size = url_info(source)
|
mime, ext, size = url_info(source)
|
||||||
|
|
||||||
print_info(site_info, title, mime, size)
|
print_info(site_info, title, mime, size)
|
||||||
|
Loading…
Reference in New Issue
Block a user