TeamPiped / Piped

An alternative privacy-friendly YouTube frontend which is efficient by design.
https://piped.video
GNU Affero General Public License v3.0
8.44k stars 696 forks source link

Incorrect audio language on some videos #3439

Open jim3692 opened 8 months ago

jim3692 commented 8 months ago

Official Instance

Describe the bug

It looks like that in some videos there is (mistakenly?) a second English audio track. In the case of the video in the reproduction steps, one has the following info in its API response (filtered output):

{
  "audioTrackId": "en-US.4",
  "audioTrackName": "English (United States) original",
  "audioTrackType": "ORIGINAL"
}

and the other English track has this info:

{
  "audioTrackId": "en.3",
  "audioTrackName": "English",
  "audioTrackType": "DUBBED"
}

Trying in official YouTube, it seems that the non-original English audio track is indeed not English. However, in Piped only one of those tracks appear in the list. After some digging, I found this part of the code, which should prioritize the original, over the dubbed track and/or not use substr(0, 2) as it results to "en" for both tracks: https://github.com/TeamPiped/Piped/blob/6275202f2cf3d04e84097727e0423c5dd49e62cc/src/utils/DashUtils.js#L69-L76

To Reproduce

  1. Go to https://piped.video/watch?v=iWWWyG5ZwG8
  2. Select the English language
  3. It's not English

Expected behavior

It should be English

Logs/Errors

No response

Browser, and OS with Version.

Firefox 122.0.1 on Debian 12

Additional context

No response

arisuv commented 6 months ago

substr(0, 2) should prevent duplication of audio not prioritize the original audio, as I understood.