1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-04-04 14:10:17 -05:00

[ie/sbs] Fix subtitles extraction (#12785)

Closes #12783
Authored by: bashonly
This commit is contained in:
bashonly 2025-03-30 17:54:55 -05:00 committed by GitHub
parent 22e34adbd7
commit 2956035912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -122,6 +122,15 @@ class SBSIE(InfoExtractor):
if traverse_obj(media, ('partOfSeries', {dict})):
media['epName'] = traverse_obj(media, ('title', {str}))
# Need to set different language for forced subs or else they have priority over full subs
fixed_subtitles = {}
for lang, subs in subtitles.items():
for sub in subs:
fixed_lang = lang
if sub['url'].lower().endswith('_fe.vtt'):
fixed_lang += '-forced'
fixed_subtitles.setdefault(fixed_lang, []).append(sub)
return {
'id': video_id,
**traverse_obj(media, {
@ -151,6 +160,6 @@ class SBSIE(InfoExtractor):
}),
}),
'formats': formats,
'subtitles': subtitles,
'subtitles': fixed_subtitles,
'uploader': 'SBSC',
}