diff options
author | bashonly <88596187+bashonly@users.noreply.github.com> | 2025-03-30 17:54:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-30 22:54:55 +0000 |
commit | 29560359120f28adaaac67c86fa8442eb72daa0d (patch) | |
tree | fda3782ce3af3deec3ea7730b4aec5acbbb8b21b | |
parent | 22e34adbd741e1c7072015debd615dc3fb71c401 (diff) |
[ie/sbs] Fix subtitles extraction (#12785)
Closes #12783
Authored by: bashonly
-rw-r--r-- | yt_dlp/extractor/sbs.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/yt_dlp/extractor/sbs.py b/yt_dlp/extractor/sbs.py index 8d61e22fc..7edb5214e 100644 --- a/yt_dlp/extractor/sbs.py +++ b/yt_dlp/extractor/sbs.py @@ -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', } |