[ie/beacon] Fix error if subtitle language is not set by Beacon

This commit is contained in:
Deukhoofd 2024-05-25 18:26:48 +02:00
parent f1ab9a3d93
commit 6491712ede
No known key found for this signature in database
GPG key ID: F63E044490819F6F

View file

@ -77,7 +77,9 @@ def _real_extract(self, url):
for track in tracks:
if traverse_obj(track, 'kind') == 'captions':
file = track['file']
language = track['language'].lower()
language = traverse_obj(track, 'language')
if language is None:
language = "en"
subs = {language: [{'url': file}]}
self._merge_subtitles(subs, target=subtitles)