Skip to content

Commit

Permalink
Filter out translated audio tracks
Browse files Browse the repository at this point in the history
See comment in code
  • Loading branch information
user234683 committed Jul 2, 2023
1 parent 942dda7 commit 7292fed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions youtube/yt_data_extract/watch_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,13 @@ def _extract_formats(info, player_response):
for yt_fmt in yt_formats:
itag = yt_fmt.get('itag')

# Translated audio track
# Example: https://www.youtube.com/watch?v=gF9kkB0UWYQ
# Only get the original language for now so a foreign
# translation will not be picked just because it comes first
if deep_get(yt_fmt, 'audioTrack', 'audioIsDefault') is False:
continue

fmt = {}
fmt['itag'] = itag
fmt['ext'] = None
Expand Down

0 comments on commit 7292fed

Please sign in to comment.