mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +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):
|
||||
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)
|
||||
title = '%s [%s]' % (title, video_id)
|
||||
dataText = r1(r'var data = \[(.*)\] ', html) or r1(r'var data = (\{.*\})', html)
|
||||
data = json.loads(dataText)
|
||||
source = 'http:' + data['video']['play_addr']['url_list'][0]
|
||||
source = r1(r'<video .*?src="([^"]+)"', html)
|
||||
mime, ext, size = url_info(source)
|
||||
|
||||
print_info(site_info, title, mime, size)
|
||||
|
Loading…
Reference in New Issue
Block a user