mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 04:32:27 +03:00
Print dammaku's url in json output
This commit is contained in:
parent
728360f4cc
commit
2ab43662f8
@ -95,6 +95,7 @@ class Bilibili(VideoExtractor):
|
||||
qlt = self.fmt2qlt.get(quality)
|
||||
api_xml = self.api_req(cid, qlt, bangumi)
|
||||
self.parse_bili_xml(api_xml)
|
||||
self.danmaku_url = 'http://comment.bilibili.com/{}.xml'.format(cid)
|
||||
self.danmuku = get_danmuku_xml(cid)
|
||||
else:
|
||||
for qlt in range(4, 0, -1):
|
||||
|
@ -16,6 +16,11 @@ def output(video_extractor, pretty_print=True):
|
||||
out['audiolang'] = ve.audiolang
|
||||
except AttributeError:
|
||||
pass
|
||||
try:
|
||||
if ve.danmaku_url:
|
||||
out['danmaku_url'] = ve.danmaku_url
|
||||
except AttributeError:
|
||||
pass
|
||||
if pretty_print:
|
||||
print(json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user