diff --git a/src/you_get/extractors/douyin.py b/src/you_get/extractors/douyin.py index e39775f4..5de1fdd9 100644 --- a/src/you_get/extractors/douyin.py +++ b/src/you_get/extractors/douyin.py @@ -1,7 +1,7 @@ # coding=utf-8 import re -import json +from urllib.parse import unquote from ..common import ( url_size, @@ -18,17 +18,17 @@ __all__ = ['douyin_download_by_url'] def douyin_download_by_url(url, **kwargs): page_content = get_content(url, headers=fake_headers) - match_rule = re.compile(r'var data = \[(.*?)\];') - video_info = json.loads(match_rule.findall(page_content)[0]) - video_url = video_info['video']['play_addr']['url_list'][0] - # fix: https://www.douyin.com/share/video/6553248251821165832 - # if there is no title, use desc - cha_list = video_info['cha_list'] - if cha_list: - title = cha_list[0]['cha_name'] - else: - title = video_info['desc'] + # The easiest way to get the title is, obviously, from