Results 1 to 8 of 8

Thread: Help please with yt-dlp and subtitles

  1. #1
    Join Date
    Nov 2008
    Posts
    2,439
    Blog Entries
    1

    Default Help please with yt-dlp and subtitles

    When I download a yt opera video as an .mp4 and play it I get the subtitles in Italian but when I watch it in YT in browser I get the subtitles in English. I assume I am missing something in my script but have no idea how to sort this out. Please could somebody help me with this.
    I do appreciate that not all have subtitles but this one does.

    The script I am using, for example is:-
    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 vtfGBkG5Fe8
    -o '%(title)s.%(ext)s'
    What am I doing wrong or missing.
    Budge

  2. #2
    Join Date
    Jun 2008
    Location
    East of Podunk
    Posts
    33,387
    Blog Entries
    15

    Default Re: Help please with yt-dlp and subtitles

    Quote Originally Posted by Budgie2 View Post
    When I download a yt opera video as an .mp4 and play it I get the subtitles in Italian but when I watch it in YT in browser I get the subtitles in English. I assume I am missing something in my script but have no idea how to sort this out. Please could somebody help me with this.
    I do appreciate that not all have subtitles but this one does.

    The script I am using, for example is:-
    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 vtfGBkG5Fe8
    -o '%(title)s.%(ext)s'
    What am I doing wrong or missing.
    Budge
    Hi
    Add the `--sub-langs "en.*"`? https://github.com/yt-dlp/yt-dlp#subtitle-options
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Nov 2008
    Posts
    2,439
    Blog Entries
    1

    Default Re: Help please with yt-dlp and subtitles

    Hi Malcolm and many thanks for the instant reply and link. Complicated isn't it!
    Anyhow I tried what I thought was required but alas the English subtitles do not appear. I suspect I have the syntax wrong so would appreciate your comment please. Here is what I ran just now:-

    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 vtfGBkG5Fe8 -o '%(title)s.%(ext)s' --sub-langs "en.*
    "
    
    Wrong place in line perhaps?

  4. #4

    Default Re: Help please with yt-dlp and subtitles

    USAGE AND OPTIONS

    Code:
    yt-dlp [OPTIONS] [--] URL [URL...]
    and

    Code:
    --list-subs
    to list available subs.

  5. #5
    Join Date
    Nov 2008
    Posts
    2,439
    Blog Entries
    1

    Default Re: Help please with yt-dlp and subtitles

    Hi and many thanks for the additional info. I corrected my command so I now have:-

    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 --sub-langs "en.*" vtfGBkG5Fe8 -o '%(title)s.%(ext)s
    
    but this didn't work, however running:-
    Code:
    alastair@IBMW530:~> yt-dlp -f 'bv*+ba' --merge-output-format mp4 --list-subs vtfGBkG5Fe8 -o '%(title)s.%(ext)s'      
    [youtube] vtfGBkG5Fe8: Downloading webpage 
    [youtube] vtfGBkG5Fe8: Downloading android player API JSON 
    [info] Available automatic captions for vtfGBkG5Fe8: 
    LanguageNameFormats
    af-en      Afrikaans from English             vtt, ttml, srv3, srv2, srv1, json3 
    ak-en      Akan from English                  vtt, ttml, srv3, srv2, srv1, json3 
    sq-en      Albanian from English              vtt, ttml, srv3, srv2, srv1, json3 
    am-en      Amharic from English               vtt, ttml, srv3, srv2, srv1, json3 
    ar-en      Arabic from English                vtt, ttml, srv3, srv2, srv1, json3 
    hy-en      Armenian from English              vtt, ttml, srv3, srv2, srv1, json3 
    as-en      Assamese from English              vtt, ttml, srv3, srv2, srv1, json3 
    ay-en      Aymara from English                vtt, ttml, srv3, srv2, srv1, json3 
    az-en      Azerbaijani from English           vtt, ttml, srv3, srv2, srv1, json3 
    bn-en      Bangla from English                vtt, ttml, srv3, srv2, srv1, json3 
    eu-en      Basque from English                vtt, ttml, srv3, srv2, srv1, json3 
    be-en      Belarusian from English            vtt, ttml, srv3, srv2, srv1, json3 
    bho-en     Bhojpuri from English              vtt, ttml, srv3, srv2, srv1, json3 
    bs-en      Bosnian from English               vtt, ttml, srv3, srv2, srv1, json3 
    bg-en      Bulgarian from English             vtt, ttml, srv3, srv2, srv1, json3 
    my-en      Burmese from English               vtt, ttml, srv3, srv2, srv1, json3 
    ca-en      Catalan from English               vtt, ttml, srv3, srv2, srv1, json3 
    ceb-en     Cebuano from English               vtt, ttml, srv3, srv2, srv1, json3 
    zh-Hans-en Chinese (Simplified) from English  vtt, ttml, srv3, srv2, srv1, json3 
    zh-Hant-en Chinese (Traditional) from English vtt, ttml, srv3, srv2, srv1, json3 
    co-en      Corsican from English              vtt, ttml, srv3, srv2, srv1, json3 
    hr-en      Croatian from English              vtt, ttml, srv3, srv2, srv1, json3 
    cs-en      Czech from English                 vtt, ttml, srv3, srv2, srv1, json3 
    da-en      Danish from English                vtt, ttml, srv3, srv2, srv1, json3 
    dv-en      Divehi from English                vtt, ttml, srv3, srv2, srv1, json3 
    nl-en      Dutch from English                 vtt, ttml, srv3, srv2, srv1, json3 
    en-en      English from English               vtt, ttml, srv3, srv2, srv1, json3 
    eo-en      Esperanto from English             vtt, ttml, srv3, srv2, srv1, json3 
    et-en      Estonian from English              vtt, ttml, srv3, srv2, srv1, json3 
    ee-en      Ewe from English                   vtt, ttml, srv3, srv2, srv1, json3 
    fil-en     Filipino from English              vtt, ttml, srv3, srv2, srv1, json3 
    fi-en      Finnish from English               vtt, ttml, srv3, srv2, srv1, json3 
    fr-en      French from English                vtt, ttml, srv3, srv2, srv1, json3 
    gl-en      Galician from English              vtt, ttml, srv3, srv2, srv1, json3 
    lg-en      Ganda from English                 vtt, ttml, srv3, srv2, srv1, json3 
    ka-en      Georgian from English              vtt, ttml, srv3, srv2, srv1, json3 
    de-en      German from English                vtt, ttml, srv3, srv2, srv1, json3 
    el-en      Greek from English                 vtt, ttml, srv3, srv2, srv1, json3 
    gn-en      Guarani from English               vtt, ttml, srv3, srv2, srv1, json3 
    gu-en      Gujarati from English              vtt, ttml, srv3, srv2, srv1, json3 
    ht-en      Haitian Creole from English        vtt, ttml, srv3, srv2, srv1, json3 
    ha-en      Hausa from English                 vtt, ttml, srv3, srv2, srv1, json3 
    haw-en     Hawaiian from English              vtt, ttml, srv3, srv2, srv1, json3 
    iw-en      Hebrew from English                vtt, ttml, srv3, srv2, srv1, json3 
    hi-en      Hindi from English                 vtt, ttml, srv3, srv2, srv1, json3 
    hmn-en     Hmong from English                 vtt, ttml, srv3, srv2, srv1, json3 
    hu-en      Hungarian from English             vtt, ttml, srv3, srv2, srv1, json3 
    is-en      Icelandic from English             vtt, ttml, srv3, srv2, srv1, json3 
    ig-en      Igbo from English                  vtt, ttml, srv3, srv2, srv1, json3 
    id-en      Indonesian from English            vtt, ttml, srv3, srv2, srv1, json3 
    ga-en      Irish from English                 vtt, ttml, srv3, srv2, srv1, json3 
    it-en      Italian from English               vtt, ttml, srv3, srv2, srv1, json3 
    ja-en      Japanese from English              vtt, ttml, srv3, srv2, srv1, json3 
    jv-en      Javanese from English              vtt, ttml, srv3, srv2, srv1, json3 
    kn-en      Kannada from English               vtt, ttml, srv3, srv2, srv1, json3 
    kk-en      Kazakh from English                vtt, ttml, srv3, srv2, srv1, json3 
    km-en      Khmer from English                 vtt, ttml, srv3, srv2, srv1, json3 
    rw-en      Kinyarwanda from English           vtt, ttml, srv3, srv2, srv1, json3 
    ko-en      Korean from English                vtt, ttml, srv3, srv2, srv1, json3 
    kri-en     Krio from English                  vtt, ttml, srv3, srv2, srv1, json3 
    ku-en      Kurdish from English               vtt, ttml, srv3, srv2, srv1, json3 
    ky-en      Kyrgyz from English                vtt, ttml, srv3, srv2, srv1, json3 
    lo-en      Lao from English                   vtt, ttml, srv3, srv2, srv1, json3 
    la-en      Latin from English                 vtt, ttml, srv3, srv2, srv1, json3 
    lv-en      Latvian from English               vtt, ttml, srv3, srv2, srv1, json3 
    ln-en      Lingala from English               vtt, ttml, srv3, srv2, srv1, json3 
    lt-en      Lithuanian from English            vtt, ttml, srv3, srv2, srv1, json3 
    lb-en      Luxembourgish from English         vtt, ttml, srv3, srv2, srv1, json3 
    mk-en      Macedonian from English            vtt, ttml, srv3, srv2, srv1, json3 
    mg-en      Malagasy from English              vtt, ttml, srv3, srv2, srv1, json3 
    ms-en      Malay from English                 vtt, ttml, srv3, srv2, srv1, json3 
    ml-en      Malayalam from English             vtt, ttml, srv3, srv2, srv1, json3 
    mt-en      Maltese from English               vtt, ttml, srv3, srv2, srv1, json3 
    mi-en      Māori from English                 vtt, ttml, srv3, srv2, srv1, json3 
    mr-en      Marathi from English               vtt, ttml, srv3, srv2, srv1, json3 
    mn-en      Mongolian from English             vtt, ttml, srv3, srv2, srv1, json3 
    ne-en      Nepali from English                vtt, ttml, srv3, srv2, srv1, json3 
    nso-en     Northern Sotho from English        vtt, ttml, srv3, srv2, srv1, json3 
    no-en      Norwegian from English             vtt, ttml, srv3, srv2, srv1, json3 
    ny-en      Nyanja from English                vtt, ttml, srv3, srv2, srv1, json3 
    or-en      Odia from English                  vtt, ttml, srv3, srv2, srv1, json3 
    om-en      Oromo from English                 vtt, ttml, srv3, srv2, srv1, json3 
    ps-en      Pashto from English                vtt, ttml, srv3, srv2, srv1, json3 
    fa-en      Persian from English               vtt, ttml, srv3, srv2, srv1, json3 
    pl-en      Polish from English                vtt, ttml, srv3, srv2, srv1, json3 
    pt-en      Portuguese from English            vtt, ttml, srv3, srv2, srv1, json3 
    pa-en      Punjabi from English               vtt, ttml, srv3, srv2, srv1, json3 
    qu-en      Quechua from English               vtt, ttml, srv3, srv2, srv1, json3 
    ro-en      Romanian from English              vtt, ttml, srv3, srv2, srv1, json3 
    ru-en      Russian from English               vtt, ttml, srv3, srv2, srv1, json3 
    sm-en      Samoan from English                vtt, ttml, srv3, srv2, srv1, json3 
    sa-en      Sanskrit from English              vtt, ttml, srv3, srv2, srv1, json3 
    gd-en      Scottish Gaelic from English       vtt, ttml, srv3, srv2, srv1, json3 
    sr-en      Serbian from English               vtt, ttml, srv3, srv2, srv1, json3 
    sn-en      Shona from English                 vtt, ttml, srv3, srv2, srv1, json3 
    sd-en      Sindhi from English                vtt, ttml, srv3, srv2, srv1, json3 
    si-en      Sinhala from English               vtt, ttml, srv3, srv2, srv1, json3 
    sk-en      Slovak from English                vtt, ttml, srv3, srv2, srv1, json3 
    sl-en      Slovenian from English             vtt, ttml, srv3, srv2, srv1, json3 
    so-en      Somali from English                vtt, ttml, srv3, srv2, srv1, json3 
    st-en      Southern Sotho from English        vtt, ttml, srv3, srv2, srv1, json3 
    es-en      Spanish from English               vtt, ttml, srv3, srv2, srv1, json3 
    su-en      Sundanese from English             vtt, ttml, srv3, srv2, srv1, json3 
    sw-en      Swahili from English               vtt, ttml, srv3, srv2, srv1, json3 
    sv-en      Swedish from English               vtt, ttml, srv3, srv2, srv1, json3 
    tg-en      Tajik from English                 vtt, ttml, srv3, srv2, srv1, json3 
    ta-en      Tamil from English                 vtt, ttml, srv3, srv2, srv1, json3 
    tt-en      Tatar from English                 vtt, ttml, srv3, srv2, srv1, json3 
    te-en      Telugu from English                vtt, ttml, srv3, srv2, srv1, json3 
    th-en      Thai from English                  vtt, ttml, srv3, srv2, srv1, json3 
    ti-en      Tigrinya from English              vtt, ttml, srv3, srv2, srv1, json3 
    ts-en      Tsonga from English                vtt, ttml, srv3, srv2, srv1, json3 
    tr-en      Turkish from English               vtt, ttml, srv3, srv2, srv1, json3 
    tk-en      Turkmen from English               vtt, ttml, srv3, srv2, srv1, json3 
    uk-en      Ukrainian from English             vtt, ttml, srv3, srv2, srv1, json3 
    und-en     Unknown Language from English      vtt, ttml, srv3, srv2, srv1, json3 
    ur-en      Urdu from English                  vtt, ttml, srv3, srv2, srv1, json3 
    ug-en      Uyghur from English                vtt, ttml, srv3, srv2, srv1, json3 
    uz-en      Uzbek from English                 vtt, ttml, srv3, srv2, srv1, json3 
    vi-en      Vietnamese from English            vtt, ttml, srv3, srv2, srv1, json3 
    cy-en      Welsh from English                 vtt, ttml, srv3, srv2, srv1, json3 
    fy-en      Western Frisian from English       vtt, ttml, srv3, srv2, srv1, json3 
    xh-en      Xhosa from English                 vtt, ttml, srv3, srv2, srv1, json3 
    yi-en      Yiddish from English               vtt, ttml, srv3, srv2, srv1, json3 
    yo-en      Yoruba from English                vtt, ttml, srv3, srv2, srv1, json3 
    zu-en      Zulu from English                  vtt, ttml, srv3, srv2, srv1, json3 
    [info] Available subtitles for vtfGBkG5Fe8: 
    LanguageNameFormats
    en        English vtt, ttml, srv3, srv2, srv1, json3 
    live_chat         json 
    alastair@IBMW530:~> 
    
    Which suggests that English sub titles are available but I am still making a mistake somewhere as I cannot get the subtitles on the download. Any further hints please?

  6. #6

    Default Re: Help please with yt-dlp and subtitles

    Try following command (as the available subtitle format looks different):
    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 --sub-langs "en-en" vtfGBkG5Fe8 -o '%(title)s.%(ext)s
    or
    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 --sub-langs "en" vtfGBkG5Fe8 -o '%(title)s.%(ext)s

  7. #7
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    4,186
    Blog Entries
    5

    Default Re: Help please with yt-dlp and subtitles

    Quote Originally Posted by Budgie2 View Post
    Hi and many thanks for the additional info. I corrected my command so I now have:-

    Code:
    yt-dlp -f 'bv*+ba' --merge-output-format mp4 --sub-langs "en.*" vtfGBkG5Fe8 -o '%(title)s.%(ext)s
    
    but this didn't work, however running:-
    Code:
    alastair@IBMW530:~> yt-dlp -f 'bv*+ba' --merge-output-format mp4 --list-subs vtfGBkG5Fe8 -o '%(title)s.%(ext)s'      
    [youtube] vtfGBkG5Fe8: Downloading webpage 
    [youtube] vtfGBkG5Fe8: Downloading android player API JSON 
    [info] Available automatic captions for vtfGBkG5Fe8: 
    LanguageNameFormats
    af-en      Afrikaans from English             vtt, ttml, srv3, srv2, srv1, json3 
    ...
    zu-en      Zulu from English                  vtt, ttml, srv3, srv2, srv1, json3 
    [info] Available subtitles for vtfGBkG5Fe8: 
    LanguageNameFormats
    en        English vtt, ttml, srv3, srv2, srv1, json3 
    live_chat         json 
    alastair@IBMW530:~> 
    
    Which suggests that English sub titles are available but I am still making a mistake somewhere as I cannot get the subtitles on the download. Any further hints please?
    Download a YouTube video subtitles file with yt-dlp: https://write.corbpie.com/download-a...e-with-yt-dlp/
    i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X, 5700U (2022) openSUSE Tumbleweed, KDE Plasma
    See also Blogs > KeepItSimple

  8. #8
    Join Date
    Nov 2008
    Posts
    2,439
    Blog Entries
    1

    Default Re: Help please with yt-dlp and subtitles

    Hi Karl,
    That was it. the command which works is:-

    Code:
    yt-dlp -f 'bv*+ba' --write-subs en --merge-output-format mp4 vtfGBkG5Fe8 -o '%(title)s.%(ext)s'
    
    The clue is in the write-subs command so I have no idea what my original command was for but thanks again.
    Hope this is useful for others.
    Budge.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •