From: lihan7 Date: Fri, 25 Mar 2022 07:46:28 +0000 (+0800) Subject: [extractor/bilibili] Fix path "/audio/auxxxxx" download return 403 X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=17d295a1ec6d04362740dd8a0c583690f5ba082a;p=youtube-dl [extractor/bilibili] Fix path "/audio/auxxxxx" download return 403 --- 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 {}