mirror of
https://github.com/soimort/you-get.git
synced 2025-02-09 03:37:52 +03:00
fix: [extractors.bilibili] add headers when requesting for danmaku
This commit is contained in:
parent
01fa32419e
commit
f7face20fa
@ -335,7 +335,7 @@ class Bilibili(VideoExtractor):
|
|||||||
'src': [[baseurl]], 'size': size}
|
'src': [[baseurl]], 'size': size}
|
||||||
|
|
||||||
# get danmaku
|
# get danmaku
|
||||||
self.danmaku = get_content('http://comment.bilibili.com/%s.xml' % cid)
|
self.danmaku = get_content('http://comment.bilibili.com/%s.xml' % cid, headers=self.bilibili_headers(referer=self.url))
|
||||||
|
|
||||||
# bangumi
|
# bangumi
|
||||||
elif sort == 'bangumi':
|
elif sort == 'bangumi':
|
||||||
@ -414,7 +414,7 @@ class Bilibili(VideoExtractor):
|
|||||||
'src': [[baseurl], [audio_baseurl]], 'size': size}
|
'src': [[baseurl], [audio_baseurl]], 'size': size}
|
||||||
|
|
||||||
# get danmaku
|
# get danmaku
|
||||||
self.danmaku = get_content('http://comment.bilibili.com/%s.xml' % cid)
|
self.danmaku = get_content('http://comment.bilibili.com/%s.xml' % cid, headers=self.bilibili_headers(referer=self.url))
|
||||||
|
|
||||||
# vc video
|
# vc video
|
||||||
elif sort == 'vc':
|
elif sort == 'vc':
|
||||||
@ -596,7 +596,7 @@ class Bilibili(VideoExtractor):
|
|||||||
'src': [[baseurl]], 'size': size}
|
'src': [[baseurl]], 'size': size}
|
||||||
|
|
||||||
# get danmaku
|
# get danmaku
|
||||||
self.danmaku = get_content('http://comment.bilibili.com/%s.xml' % cid)
|
self.danmaku = get_content('http://comment.bilibili.com/%s.xml' % cid, headers=self.bilibili_headers(referer=self.url))
|
||||||
|
|
||||||
def extract(self, **kwargs):
|
def extract(self, **kwargs):
|
||||||
# set UA and referer for downloading
|
# set UA and referer for downloading
|
||||||
|
Loading…
Reference in New Issue
Block a user