mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
[tiktok] fix extraction for alternative URLs
This commit is contained in:
parent
5e25e1b5e2
commit
fd5e313097
@ -15,9 +15,7 @@ def tiktok_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
|||||||
m = re.match('(https?://)?([^/]+)(/.*)', url)
|
m = re.match('(https?://)?([^/]+)(/.*)', url)
|
||||||
host = m.group(2)
|
host = m.group(2)
|
||||||
if host != 'www.tiktok.com': # non-canonical URL
|
if host != 'www.tiktok.com': # non-canonical URL
|
||||||
html = getHttps(host, url, headers=headers, gzip=False)
|
url = get_location(url, headers=headers)
|
||||||
url = r1(r'(https://www.tiktok.com/[^?"]+)', html)
|
|
||||||
# use canonical URL
|
|
||||||
m = re.match('(https?://)?([^/]+)(/.*)', url)
|
m = re.match('(https?://)?([^/]+)(/.*)', url)
|
||||||
host = m.group(2)
|
host = m.group(2)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user