提交 f10123b9 编写于 作者: M Mort Yao

Acfun & Bilibili: 'Downloading %s ...\n'

上级 822c8394
...@@ -38,11 +38,11 @@ def acfun_download_by_vid(vid, title=None, output_dir='.', merge=True, info_only ...@@ -38,11 +38,11 @@ def acfun_download_by_vid(vid, title=None, output_dir='.', merge=True, info_only
if not info_only: if not info_only:
title = get_filename(title) title = get_filename(title)
try: try:
print('Downloading %s ...' % (title + '.cmt.json')) print('Downloading %s ...\n' % (title + '.cmt.json'))
cmt = get_srt_json(danmakuId) cmt = get_srt_json(danmakuId)
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')) print('Downloading %s ...\n' % (title + '.cmt_lock.json'))
cmt = get_srt_lock_json(danmakuId) cmt = get_srt_lock_json(danmakuId)
with open(os.path.join(output_dir, title + '.cmt_lock.json'), 'w') as x: with open(os.path.join(output_dir, title + '.cmt_lock.json'), 'w') as x:
x.write(cmt) x.write(cmt)
......
...@@ -100,7 +100,7 @@ def bilibili_download(url, output_dir = '.', merge = True, info_only = False): ...@@ -100,7 +100,7 @@ def bilibili_download(url, output_dir = '.', merge = True, info_only = False):
if not info_only: if not info_only:
title = get_filename(title) title = get_filename(title)
print('Downloading %s ...' % (title + '.cmt.xml')) print('Downloading %s ...\n' % (title + '.cmt.xml'))
xml = get_srt_xml(id) xml = get_srt_xml(id)
with open(os.path.join(output_dir, title + '.cmt.xml'), 'w', encoding='utf-8') as x: with open(os.path.join(output_dir, title + '.cmt.xml'), 'w', encoding='utf-8') as x:
x.write(xml) x.write(xml)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册