logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git
commit: 17d295a1ec6d04362740dd8a0c583690f5ba082a
parent 49c5293014bc11ec8c009856cd63cffa6296c1e1
Author: lihan7 <lihan7@xiaomi.com>
Date:   Fri, 25 Mar 2022 15:46:28 +0800

[extractor/bilibili] Fix path "/audio/auxxxxx" download return 403

Diffstat:

Myoutube_dl/extractor/bilibili.py5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git 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 {}