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 age-gated video error #26647

Open
someziggyman opened this issue Sep 21, 2020 · 2 comments
Open

Youtube age-gated video error #26647

someziggyman opened this issue Sep 21, 2020 · 2 comments

Comments

@someziggyman
Copy link

@someziggyman someziggyman commented Sep 21, 2020

Checklist

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

youtube-dl -v -F https://www.youtube.com/watch?v=R89f5YMT-QA
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.youtube.com/watch?v=R89f5YMT-QA']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.09.20
[debug] Python version 2.7.16 (CPython) - Darwin-18.7.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] R89f5YMT-QA: Downloading webpage
[youtube] R89f5YMT-QA: Downloading embed webpage
[youtube] R89f5YMT-QA: Refetching age-gated info webpage
ERROR: Watch this video on YouTube. Playback on other websites has been disabled by the video owner.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 2231, in _real_extract
    raise ExtractorError(error_message, expected=True)
ExtractorError: Watch this video on YouTube. Playback on other websites has been disabled by the video owner.

Description

Looks like Youtube has change behavior for age-gated video. Now, youtube-dl returns ERROR: Watch this video on YouTube. Playback on other websites has been disabled by the video owner. This did not happen before.

Passing cookies, login and user-agent did not help.

@someziggyman
Copy link
Author

@someziggyman someziggyman commented Sep 26, 2020

Seems like I've found a solution!

20 days ago, on Sep 6, 2020 youtube-dl main repo had a commit related to age-gated content.
16ee69c

So, in youtube_dl/extractor/youtube.py
I just removed the newly added 2 lines and returned the old one:
if re.search(r'player-age-gate-content">', video_webpage) is not None:

This way we can not by-pass geo restriction, but at least it works with --cookies parameter.
Worked for links like:
https://www.youtube.com/watch?v=MxCRYXg6hLs
https://www.youtube.com/watch?v=fh2cDKyFdyU

@pukkandan
Copy link

@pukkandan pukkandan commented Oct 18, 2020

Also see #26652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.