Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube - Can not download automatic subtitle when manual subtitle exist #24011

Open
6 tasks done
orena1 opened this issue Feb 10, 2020 · 1 comment
Open
6 tasks done

Comments

@orena1
Copy link

orena1 commented Feb 10, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.01.24
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

Not relevant

Description

When a manual subtitle exist, youtube-dl download the manual subtitle, not matter the settings, see simple example:
This video - https://www.youtube.com/watch?v=1p11Prs5PHw has manual and automatic subtitles, the script below download both and compare them, and they are identical (even though it is clear in youtube that the two transcriptions are different)

def set_ydl_opts(auto_or_manual):
    ydl_opts = {
        'ignoreerrors':True,
         'dumpjson': True, ## lower -j
         'skip_download':True,
        'subtitleslangs':['en'],
        'verbose':True,
        'outtmpl':f'test_{auto_or_manual}/%(id)s_%(ext)s'
    }
    if auto_or_manual == 'auto':
        ydl_opts['writeautomaticsub'] = True
        ydl_opts['writesubtitles'] = False
    elif auto_or_manual =='manual':
        ydl_opts['writesubtitles'] = True
        ydl_opts['writeautomaticsub'] = False
    return ydl_opts

#download manual subtitle
auto_or_manual = 'manual'
ydl_opts = set_ydl_opts(auto_or_manual)
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    z =ydl.download(['https://www.youtube.com/watch?v=1p11Prs5PHw'])

#download automatic subtitle
auto_or_manual = 'auto'
ydl_opts = set_ydl_opts(auto_or_manual)
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    z =ydl.download(['https://www.youtube.com/watch?v=1p11Prs5PHw'])

Verbose -
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 3.7.3 (CPython) - Linux-4.15.0-30-generic-x86_64-with-debian-stretch-sid
[debug] exe versions: avconv 3.4.4-1, avprobe 3.4.4-1, ffmpeg 3.4.4-1, ffprobe 3.4.4-1
[debug] Proxy map: {}
[youtube] 1p11Prs5PHw: Downloading webpage
[youtube] 1p11Prs5PHw: Downloading video info webpage
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: test_manual/1p11Prs5PHw_mp4.en.vtt
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 3.7.3 (CPython) - Linux-4.15.0-30-generic-x86_64-with-debian-stretch-sid
[debug] exe versions: avconv 3.4.4-1, avprobe 3.4.4-1, ffmpeg 3.4.4-1, ffprobe 3.4.4-1
[debug] Proxy map: {}
[youtube] 1p11Prs5PHw: Downloading webpage
[youtube] 1p11Prs5PHw: Downloading video info webpage
[youtube] 1p11Prs5PHw: Looking for automatic captions
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: test_auto/1p11Prs5PHw_mp4.en.vtt

!diff test_manual/1p11Prs5PHw_mp4.en.vtt test_auto/1p11Prs5PHw_mp4.en.vtt
@OpaqueArc
Copy link

OpaqueArc commented Feb 11, 2020

Update2: I double checked my download time, and it was hours away from the vid upload time. But I still see this warning in my log
WARNING: Couldn't find automatic captions for Zmr3g83cgJo
Any idea?
PS: I'm 100% sure some vids that are reported without automatic captions, actually have them when I manually double check some time later. It should be expected that the vid was accessed hours after it was uploaded. Maybe a Youtube issue?

Same here, but I can't get subtitle even without manual sub when i run yt-dl in a routine script.
I'm adding verbose option to my script, will be help adding some logs when I run into this again

PS:Running the same script manually works fine, not sure why, I'm sure this works like 3 days before, and all paths are absolute

@orena1 orena1 changed the title Can not download automatic subtitle when manual subtitle exist YouTube - Can not download automatic subtitle when manual subtitle exist Feb 16, 2020
@ytdl-org ytdl-org deleted a comment from orena1 Feb 16, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Feb 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants