From b2965fa3b2643f3d87eaad92cfa1fdfe33c67e86 Mon Sep 17 00:00:00 2001 From: grqx_wsl <173253225+grqx@users.noreply.github.com> Date: Sat, 27 Jul 2024 22:51:15 +1200 Subject: [PATCH] =?UTF-8?q?[BiliBiliBangumiIE]=20support=20format=2012240(?= =?UTF-8?q?format=20name=20=E6=99=BA=E8=83=BD=E4=BF=AE=E5=A4=8D,=20premium?= =?UTF-8?q?=20only)=20[cleanup]code=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yt_dlp/extractor/bilibili.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/bilibili.py b/yt_dlp/extractor/bilibili.py index bd04b0e48..6b6859287 100644 --- a/yt_dlp/extractor/bilibili.py +++ b/yt_dlp/extractor/bilibili.py @@ -726,7 +726,7 @@ class BiliBiliIE(BilibiliBaseIE): else: formats = self.extract_formats(play_info) - if not traverse_obj(play_info, ('dash')): + if not play_info.get('dash'): # we only have legacy formats and need additional work has_qn = lambda x: x in traverse_obj(formats, (..., 'quality')) for qn in traverse_obj(play_info, ('accept_quality', lambda _, v: not has_qn(v), {int})): @@ -858,7 +858,7 @@ class BiliBiliBangumiIE(BilibiliBaseIE): headers['Referer'] = url play_info = self._download_json( 'https://api.bilibili.com/pgc/player/web/v2/playurl', episode_id, - 'Extracting episode', query={'fnval': '4048', 'ep_id': episode_id}, + 'Extracting episode', query={'fnval': 12240, 'ep_id': episode_id}, headers=headers) premium_only = play_info.get('code') == -10403 play_info = traverse_obj(play_info, ('result', 'video_info', {dict})) or {}