mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
Enable downloading Acfun locked comments
This commit is contained in:
parent
3e68331e96
commit
34a9830e71
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user