diff --git a/src/you_get/extractor/acfun.py b/src/you_get/extractor/acfun.py index 88e1a7d0..6903a617 100644 --- a/src/you_get/extractor/acfun.py +++ b/src/you_get/extractor/acfun.py @@ -15,6 +15,10 @@ def get_srt_json(id): url = 'http://comment.acfun.tv/%s.json' % id return get_html(url) +def get_srt_lock_json(id): + url = 'http://comment.acfun.tv/%s_lock.json' % id + return get_html(url) + def acfun_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False): info = json.loads(get_html('http://wenzhou.acfun.tv/api/getVideoByID.aspx?vid=' + id)) t = info['vtype'] @@ -35,6 +39,10 @@ def acfun_download_by_id(id, title = None, output_dir = '.', merge = True, info_ cmt = get_srt_json(vid) with open(os.path.join(output_dir, title + '.cmt.json'), 'w') as x: x.write(cmt) + print('Downloading %s ...' % (title + '.cmt_lock.json')) + cmt = get_srt_lock_json(vid) + with open(os.path.join(output_dir, title + '.cmt_lock.json'), 'w') as x: + x.write(cmt) def acfun_download(url, output_dir = '.', merge = True, info_only = False): assert re.match(r'http://[^\.]+.acfun.tv/v/ac(\d+)', url)