diff options
author | lihan7 <lihan7@xiaomi.com> | 2022-03-25 15:46:28 +0800 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2022-04-01 00:46:34 +0100 |
commit | 17d295a1ec6d04362740dd8a0c583690f5ba082a (patch) | |
tree | a475088e3dc442dd6adbc3c1a50270148a761ce7 | |
parent | 49c5293014bc11ec8c009856cd63cffa6296c1e1 (diff) | |
download | youtube-dl-17d295a1ec6d04362740dd8a0c583690f5ba082a.tar.gz youtube-dl-17d295a1ec6d04362740dd8a0c583690f5ba082a.tar.xz |
[extractor/bilibili] Fix path "/audio/auxxxxx" download return 403
-rw-r--r-- | youtube_dl/extractor/bilibili.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/bilibili.py b/youtube_dl/extractor/bilibili.py index bff6ea194..d42f0e98a 100644 --- a/youtube_dl/extractor/bilibili.py +++ b/youtube_dl/extractor/bilibili.py @@ -369,6 +369,11 @@ class BilibiliAudioIE(BilibiliAudioBaseIE): 'filesize': int_or_none(play_data.get('size')), }] + for a_format in formats: + a_format.setdefault('http_headers', {}).update({ + 'Referer': url, + }) + song = self._call_api('song/info', au_id) title = song['title'] statistic = song.get('statistic') or {} |