MTSP: Fix language code weirdness

This commit is contained in:
lambda 2025-10-10 04:34:28 +02:00
parent 04ea9fff63
commit 2b52ce5ab0

View File

@ -87,6 +87,12 @@ class MTSP(Service):
r = self.session.post(title.data['streamAccess']) r = self.session.post(title.data['streamAccess'])
access = r.json() access = r.json()
tracks = DASH.from_url(access["data"]["stream"]["dash"]).to_tracks(title.language) tracks = DASH.from_url(access["data"]["stream"]["dash"]).to_tracks(title.language)
# Audio tracks sometimes have 'random' language codes in the DASH manifest.
# Since there is only ever one language in practice anyway, force it to the correct one.
for track in tracks:
track.language = title.language
return tracks return tracks
def get_chapters(self, title: Movie) -> list[Chapter]: def get_chapters(self, title: Movie) -> list[Chapter]: