mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +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
|
url = 'http://comment.acfun.tv/%s.json' % id
|
||||||
return get_html(url)
|
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):
|
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))
|
info = json.loads(get_html('http://wenzhou.acfun.tv/api/getVideoByID.aspx?vid=' + id))
|
||||||
t = info['vtype']
|
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)
|
cmt = get_srt_json(vid)
|
||||||
with open(os.path.join(output_dir, title + '.cmt.json'), 'w') as x:
|
with open(os.path.join(output_dir, title + '.cmt.json'), 'w') as x:
|
||||||
x.write(cmt)
|
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):
|
def acfun_download(url, output_dir = '.', merge = True, info_only = False):
|
||||||
assert re.match(r'http://[^\.]+.acfun.tv/v/ac(\d+)', url)
|
assert re.match(r'http://[^\.]+.acfun.tv/v/ac(\d+)', url)
|
||||||
|
Loading…
Reference in New Issue
Block a user