question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get subtitle in original audio language without translation ?

See original GitHub issue

Checklist

Question

I want to download subtitle of original audio without translation. This is the one I get on screen by default when I press de CC button.

With the key writeautomaticsub I get a translation in English. I want it to, but I can’t find the way to get the text of original language.

Thank you for your help.

Verbose log

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Briciocommented, Feb 10, 2022

Pukkadan I think I understand him.

When downloading captions yt-dlp always downloads translated to english when is available. Even if you don’t tell yt-dlp to do that.

https://github.com/yt-dlp/yt-dlp/blob/455a15e2dcf29b4712d92a89a95ad5f3ddad69a1/yt_dlp/YoutubeDL.py#L2669-L2670

[debug] Invoking downloader on "https://www.youtube.com/api/timedtext?v=tQqDBySHYlc&asr_langs=de%2Cen%2Ces%2Cfr%2Cid%2Cit%2Cja%2Cko%2Cnl%2Cpt%2Cru%2Ctr%2Cvi&caps=asr&exp=xctw&xoaf=5&hl=en&ip=0.0.0.0&ipbits=0&expire=1644532828&sparams=ip%2Cipbits%2Cexpire%2Cv%2Casr_langs%2Ccaps%2Cexp%2Cxoaf&signature=99999999999999999999999999999999999999999999999999999999999999999999999999999999999&key=yt8&kind=asr&lang=pt&tlang=en&fmt=vtt"

The YT behavior is captions generate on original language, it only translate if you tell YT to translate. image

So, to match YT behavior, default requested langs should be the one returned on JSON not hard coded as ‘en’

  "captions": {
    "playerCaptionsTracklistRenderer": {
      "captionTracks": [
        {
          "baseUrl": "https://www.youtube.com/api/timedtext?v=tQqDBySHYlc&asr_langs=de,en,es,fr,id,it,ja,ko,nl,pt,ru,tr,vi&caps=asr&exp=xctw&xoaf=5&hl=en&ip=0.0.0.0&ipbits=0&expire=1644533677&sparams=ip,ipbits,expire,v,asr_langs,caps,exp,xoaf&signature=9999999999999999999999999999999999999999999999999999999999999999999999999999999999&key=yt8&kind=asr&lang=pt&fmt=srv3",
          "name": {
            "runs": [
              {
                "text": "Portuguese (auto-generated)"
              }
            ]
          },
          "vssId": "a.pt",
          "languageCode": "pt",
          "kind": "asr",
          "isTranslatable": true
        }
      ],
      "audioTracks": [
        {
          "captionTrackIndices": [
            0
          ]
        }
      ],
      "defaultAudioTrackIndex": 0
    }
  },
0reactions
nastia-diaphancommented, Feb 12, 2022

yt-dlp --cookies cookies.txt --sub-langs 'en.*,.*orig' --write-auto-subs https://www.youtube.com/watch?v=tQqDBySHYlc work as expected. Many thanks again.

'subtitleslangs': ['en.*','.*orig'],
'writeautomaticsub': True,

Work as expected too. Thank you


Very sorry for the video sample. I even not watched it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change a video's language settings - Android - Google Play ...
On your device, open Google Play Movies & TV Play Movies . · Tap a movie or TV show. · Scroll to “More...
Read more >
Change subtitles or languages for videos in the Apple TV app ...
To change the default subtitles language in Settings, go to Settings > Video and Audio > Audio > Subtitle Language, then choose the...
Read more >
The Best Type of Subtitles to Use When Learning a Foreign ...
As such, if you have only limited proficiency in your target language, it might be better for you to use subtitles in your...
Read more >
Why subtitles or audio isn't available in a specific language
If subtitles or audio aren't available for a particular language, you can: Choose the language in the Shows & Movies Languages settings for...
Read more >
is it possible to translate the audio of movie into other language?
Fully automated (error prone): you upload the video to YouTube (YT), wait until the YT software has produced automatic subtitles; you download them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found