From b0de307079d2f64db68ad151775cb4aaf63efb30 Mon Sep 17 00:00:00 2001 From: garret1317 Date: Sun, 23 Mar 2025 15:02:00 +0000 Subject: [PATCH] fix actlist formatting when there is no role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a += o.join(",").replace(/【undefined】/g, "") :) --- yt_dlp/extractor/nhk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/nhk.py b/yt_dlp/extractor/nhk.py index 0246511131..216cc8b414 100644 --- a/yt_dlp/extractor/nhk.py +++ b/yt_dlp/extractor/nhk.py @@ -675,7 +675,7 @@ class NhkRadiruIE(InfoExtractor): def _format_actlist(self, act_list): role_groups = {} for act in act_list: - role = act['role'] + role = act.get('role') if role not in role_groups: role_groups[role] = [] role_groups[role].append(act) @@ -683,7 +683,7 @@ def _format_actlist(self, act_list): formatted_roles = [] for role, acts in role_groups.items(): for i, act in enumerate(acts): - res = f'【{role}】' if i == 0 else '' + res = f'【{role}】' if i == 0 and role is not None else '' if title := act.get('title'): res += f'{title}…' res += act.get('name')