Skip to content
New issue

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

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

Already on GitHub? # to your account

Cannot DL Twitch subscriber only content #30558

Open
5 tasks done
Pryodon opened this issue Jan 26, 2022 · 7 comments
Open
5 tasks done

Cannot DL Twitch subscriber only content #30558

Pryodon opened this issue Jan 26, 2022 · 7 comments

Comments

@Pryodon
Copy link

Pryodon commented Jan 26, 2022

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2021.12.17
  • 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 issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-u', 'PRIVATE', '-p', 'PRIVATE', 'https://www.twitch.tv/videos/1275957915']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: none
[debug] Proxy map: {}
[twitch:vod] Downloading login page
[twitch:vod] Logging in
ERROR: Unable to login. Twitch said: Please enter a Login Verification Code.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 533, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 437, in initialize
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\twitch.py", line 58, in _real_initialize
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\twitch.py", line 113, in _login
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\twitch.py", line 90, in login_step
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\twitch.py", line 67, in fail
youtube_dl.utils.ExtractorError: Unable to login. Twitch said: Please enter a Login Verification Code.

Description

The video is restricted to subscribers. I subscribe to the channel. I can play the video in my browser.

It appears that Twitch is thinking that Youtube-dl is a new device and is wanting input of a verification code that was sent via email.

Youtube-dl could prompt for this code and wait for it to be entered. I did not notice a way to request a prompt. Even if a code could be entered, is there a way to save the cookies so this process does not need to be repeated?

The video is located in this Twitch account which restricts all VOD's to subscribers only. To gain access to a video, you must subscribe to the channel.

https://www.twitch.tv/msfiiire

@Pryodon
Copy link
Author

Pryodon commented Jan 26, 2022

I got it to work by saving my browser cookies to a file.

https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl

It would be super helpful if a link to that help page was in the built-in help because some people don't know about or forget that there is a usage help page available online.

@dirkf
Copy link
Contributor

dirkf commented Jan 26, 2022

Actually that link only works with JS enabled because of the way GH fakes up documentation pages.

An actual HTML link is https://github.com/ytdl-org/youtube-dl#user-content-how-do-i-pass-cookies-to-youtube-dl.

The help facilities that I'm aware of are the page with that link and (for Unix-like installations) man youtube-dl (where you can find the FAQ item by searching for "pass cookies").

What online help should be modified?

@dirkf
Copy link
Contributor

dirkf commented Jan 26, 2022

Youtube-dl could prompt for this code and wait for it to be entered. I did not notice a way to request a prompt.

-2/--two-factor option allows you to provide this code, or you will be prompted at the console, but the extractor has to recognise the TFA page, and then be able to submit the code correctly.

The Twitch extractor looks for a <form> element with id="two-factor-submit". Perhaps the site has started to get the TFA code with JS instead of a proper form (but then the whole login procedure is probably broken), or changed the page in some other way.

@Pryodon
Copy link
Author

Pryodon commented Jan 26, 2022

What online help should be modified?

I'm talking about modifying the built-in help to display a link to the online help.

@dirkf
Copy link
Contributor

dirkf commented Jan 26, 2022

If you mean the diagnostic message, that's just being passed straight through from the Twitch response, so yt-dl doesn't know what is going to be reported and so can't edit it except to add a general message like "Please read the Fine Manual".

Perhaps what is happening here is that the TFA request is now coming back as an error, and this specific error should be detected and skipped so that the code can be provided as above.

@Pryodon
Copy link
Author

Pryodon commented Jan 28, 2022

No... I mean when you enter the command:

youtube-dl --help

The output of that command should include a link to the online help page. So people can get more information.

https://github.com/ytdl-org/youtube-dl#user-content-description

And/or adding this link to the section of the help about two factor auth...

https://github.com/ytdl-org/youtube-dl#user-content-how-do-i-pass-cookies-to-youtube-dl

@dirkf
Copy link
Contributor

dirkf commented May 25, 2024

This can, probably should, be achieved with the epilog parameter to OptionParser.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants