mirror of
https://github.com/soimort/you-get.git
synced 2025-02-02 16:24:00 +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}
|
||||
|
||||
# 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
|
||||
elif sort == 'bangumi':
|
||||
@ -414,7 +414,7 @@ class Bilibili(VideoExtractor):
|
||||
'src': [[baseurl], [audio_baseurl]], 'size': size}
|
||||
|
||||
# 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
|
||||
elif sort == 'vc':
|
||||
@ -596,7 +596,7 @@ class Bilibili(VideoExtractor):
|
||||
'src': [[baseurl]], 'size': size}
|
||||
|
||||
# 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):
|
||||
# set UA and referer for downloading
|
||||
|
Loading…
Reference in New Issue
Block a user