[tiktok] fix extraction

This commit is contained in:
Mort Yao 2022-04-22 19:29:52 +02:00
parent 355e22584c
commit bbc4df7a89
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -23,7 +23,8 @@ def tiktok_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
}
html = getHttps(host, url, headers=headers)
data = r1(r'window\[\'SIGI_STATE\'\]=(.*?);window\[\'SIGI_RETRY\'\]', html)
data = r1(r'window\[\'SIGI_STATE\'\]=(.*?);window\[\'SIGI_RETRY\'\]', html) or \
r1(r'<script id="SIGI_STATE" type="application/json">(.*?)</script>', html)
info = json.loads(data)
downloadAddr = info['ItemModule'][vid]['video']['downloadAddr']
author = info['ItemModule'][vid]['author'] # same as uniqueId