1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-07 05:48:31 +00:00

fix actlist formatting when there is no role

a += o.join(",").replace(/【undefined】/g, "")
:)
This commit is contained in:
garret1317 2025-03-23 15:02:00 +00:00
parent 3291fe02a9
commit b0de307079

View File

@ -675,7 +675,7 @@ class NhkRadiruIE(InfoExtractor):
def _format_actlist(self, act_list): def _format_actlist(self, act_list):
role_groups = {} role_groups = {}
for act in act_list: for act in act_list:
role = act['role'] role = act.get('role')
if role not in role_groups: if role not in role_groups:
role_groups[role] = [] role_groups[role] = []
role_groups[role].append(act) role_groups[role].append(act)
@ -683,7 +683,7 @@ def _format_actlist(self, act_list):
formatted_roles = [] formatted_roles = []
for role, acts in role_groups.items(): for role, acts in role_groups.items():
for i, act in enumerate(acts): 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'): if title := act.get('title'):
res += f'{title}' res += f'{title}'
res += act.get('name') res += act.get('name')