ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.23k stars 9.93k forks source link

Cannot download YouTube Red video because TFA rejected #13050

Open cameronetchart opened 7 years ago

cameronetchart commented 7 years ago

Please follow the guide below


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.05.09. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?


The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

C:\Users\MYUSER>youtube-dl https://www.youtube.com/watch?v=PpG0z-npFIY -v
[debug] System config: []
[debug] User config: ['-o', '~/Downloads/youtube-dl/%(uploader)s/%(uploader)s - %(upload_date)s - %(title)s.%(ext)s', '-f', 'bestvideo[height<=2500]+bestaudio', '--write-sub', '-w', '--write-thumbnail', '--download-archive', 'C:\\Users\\MYUSER\\Dropbox\\Misc\\youtube-dl_archive.txt', '-R', '20', '-u', 'PRIVATE', '-p', 'PRIVATE']
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=PpG0z-npFIY', '-v']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2017.05.09
[debug] Python version 3.4.4 - Windows-10-10.0.15063
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
Type 2-step verification code and press [Return]:
[youtube] Submitting TFA code
WARNING: Unable to submit TFA code: HTTP Error 500: Internal Server Error
WARNING: Unable to extract CheckCookie URL
[youtube] PpG0z-npFIY: Downloading webpage
[youtube] I6DKmXrC7YE: Downloading webpage
[youtube] I6DKmXrC7YE: Downloading video info webpage
[youtube] I6DKmXrC7YE: Extracting video information
[youtube] {22} signature length 40.43, html5 player vfljmjb-X
[youtube] I6DKmXrC7YE: Downloading player https://www.youtube.com/yts/jsbin/player-vfljmjb-X/en_US/base.js
[youtube] {43} signature length 40.43, html5 player vfljmjb-X
[youtube] {18} signature length 40.43, html5 player vfljmjb-X
[youtube] {36} signature length 40.43, html5 player vfljmjb-X
[youtube] {17} signature length 40.43, html5 player vfljmjb-X
[youtube] {137} signature length 38.43, html5 player vfljmjb-X
[youtube] I6DKmXrC7YE: Downloading player https://www.youtube.com/yts/jsbin/player-vfljmjb-X/en_US/base.js
[youtube] {248} signature length 40.43, html5 player vfljmjb-X
[youtube] {136} signature length 40.43, html5 player vfljmjb-X
[youtube] {247} signature length 40.43, html5 player vfljmjb-X
[youtube] {135} signature length 40.43, html5 player vfljmjb-X
[youtube] {244} signature length 40.43, html5 player vfljmjb-X
[youtube] {134} signature length 40.43, html5 player vfljmjb-X
[youtube] {243} signature length 40.43, html5 player vfljmjb-X
[youtube] {133} signature length 40.43, html5 player vfljmjb-X
[youtube] {242} signature length 40.43, html5 player vfljmjb-X
[youtube] {160} signature length 40.43, html5 player vfljmjb-X
[youtube] {278} signature length 40.43, html5 player vfljmjb-X
[youtube] {140} signature length 40.43, html5 player vfljmjb-X
[youtube] {171} signature length 40.43, html5 player vfljmjb-X
[youtube] {249} signature length 40.43, html5 player vfljmjb-X
[youtube] {250} signature length 40.43, html5 player vfljmjb-X
[youtube] {251} signature length 40.43, html5 player vfljmjb-X
[youtube] I6DKmXrC7YE: Downloading player https://www.youtube.com/yts/jsbin/player-vfljmjb-X/en_US/base.js
[youtube] I6DKmXrC7YE: Downloading MPD manifest
WARNING: [youtube] I6DKmXrC7YE: Skipping DASH manifest: ExtractorError('Failed to download MPD manifest: HTTP Error 403: Forbidden (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.',)
[info] Writing video subtitles to: C:\Users\MYUSER\Downloads\youtube-dl\vlogbrothers\vlogbrothers - 20170427 - Kedi - Free Preview.en.vtt
[youtube] I6DKmXrC7YE: Downloading thumbnail ...
[youtube] I6DKmXrC7YE: Writing thumbnail to: C:\Users\MYUSER\Downloads\youtube-dl\vlogbrothers\vlogbrothers - 20170427 - Kedi - Free Preview.jpg
WARNING: You have requested multiple formats but ffmpeg or avconv are not installed. The formats won't be merged.
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on 'https://r6---sn-n4v7sn7z.googlevideo.com/videoplayback?clen=45162081&ip=71.93.87.21&usequic=no&ms=au&mt=1494471327&dur=132.757&mv=m&gir=yes&mm=31&ipbits=0&mn=sn-n4v7sn7z&initcwndbps=1181250&expire=1494493025&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cusequic%2Cexpire&ei=AdMTWdaYB4vH-AOtn6zYBA&itag=137&beids=%5B9466592%5D&mime=video%2Fmp4&pl=19&source=youtube&key=yt6&upn=0bosdK8oW2M&id=o-AIxDEQzyDsvaNSqeU9soVSh4DCT9MvgzrWBpNf3posPw&lmt=1493318750715618&requiressl=yes&gcr=us&keepalive=yes&signature=506FE07B9E19E6235481387DEA698FADFB5DD6.D45692D8787A9C2CFDD9D80BF05C61C3E1D8E42F&ratebypass=yes'
[download] Destination: C:\Users\MYUSER\Downloads\youtube-dl\vlogbrothers\vlogbrothers - 20170427 - Kedi - Free Preview.f137.mp4
[download]   4.6% of 43.07MiB at  3.75MiB/s ETA 00:10
ERROR: Interrupted by user

<end of log>

Description of your issue, suggested solution and other information

Hi, youtube-dl is now rejecting my attempts to enter my two-factor code, making me unable to download a YouTube Red video. I add my username and password to my config file, and youtube-dl correctly asks for my two-factor, but it rejects it every time with the "HTTP Error 500: Internal Server Error" error. I have tried doing this on a separate computer with a separate internet connection, and I have tried using both my Authy token and a backup code token. I have also tried it manually without using any config file. This worked several months ago, so maybe something changed on the app's end or youtube's end? Thx!

QWp6t commented 7 years ago

u downloadin kedi? i downloaded that yesterday no prob.

i don't know how to RESOLVE your issue, but as a WORKAROUND, you can use the --cookie option. get cookies.txt extension for chrome or firefox and then export your cookies and use with youtube-dl.

cameronetchart commented 7 years ago

@QWp6t Thanks for the suggestion, appreciate it. Using --cookies as a workaround worked perfectly. I'm still not sure why the TFA prompt is failing, so I'll leave this up, but using the workaround is actually preferable to me.

japzone1 commented 7 years ago

I also got this same error:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=efBgXjbd2uQ', '-u', 'PRIVATE', '-p', 'PRIVATE', '-2', '845517', '-f', '135+140', '-v']
[debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252
[debug] youtube-dl version 2017.05.14
[debug] Python version 3.4.4 - Windows-10-10.0.15063
[debug] exe versions: ffmpeg N-84679-gd65b595, ffprobe N-84679-gd65b595
[debug] Proxy map: {}
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
[youtube] Submitting TFA code
WARNING: Unable to submit TFA code: HTTP Error 500: Internal Server Error
WARNING: Unable to extract CheckCookie URL
[youtube] efBgXjbd2uQ: Downloading webpage
[youtube] mKScYV9jzG0: Downloading webpage
[youtube] mKScYV9jzG0: Downloading video info webpage
[youtube] mKScYV9jzG0: Extracting video information
WARNING: Unknown codec dtseWARNING: Unknown codec eac3[youtube] mKScYV9jzG0: Downloading MPD manifest
[download] Captain America - Civil War - Trailer-mKScYV9jzG0.mp4 has already been downloaded and merged
fishilico commented 7 years ago

I also experiment this issue when downloading a private Youtube playlist (youtube-dl version 2017.05.14 on Arch Linux x86-64):

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/playlist?list=PL0plX2SYAzLRiFR0K7iNf0RMZnUtz8JhW', '--username', 'PRIVATE', '--password', 'PRIVATE', '--get-id', '--get-title', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.05.14
[debug] Python version 3.6.1 - Linux-4.10.13-1-selinux-x86_64-with-arch
[debug] exe versions: ffmpeg 3.3, ffprobe 3.3, rtmpdump 2.4
[debug] Proxy map: {}
Type 2-step verification code and press [Return]: 
WARNING: Unable to submit TFA code: HTTP Error 500: Internal Server Error
WARNING: Unable to extract CheckCookie URL
ERROR: This playlist is private, use --username or --netrc to access it.
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 760, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 433, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 2216, in _real_extract
    has_videos, playlist = self._extract_playlist(playlist_id)
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 2159, in _extract_playlist
    raise ExtractorError(message, expected=True)
youtube_dl.utils.ExtractorError: This playlist is private, use --username or --netrc to access it.

Using --cookies instead of --username/--password worked fine.