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] Fix age gate detection #26100

Merged
merged 2 commits into from
Sep 6, 2020
Merged

[youtube] Fix age gate detection #26100

merged 2 commits into from
Sep 6, 2020

Conversation

random-nick
Copy link
Contributor

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.

YouTube apparently renders errors using javascript now. I used the meta tag for age restriction as a workaround.

Closes #25954

@adrianheine
Copy link
Contributor

This fixes the currently-failing TestAgeRestriction.test_youtube.

@jet082
Copy link

jet082 commented Aug 24, 2020

I can confirm that this seems to fix the age gate detection. However, it does not yet detect automatic subtitles for age-gated content.

@dstftw dstftw merged commit 16ee69c into ytdl-org:master Sep 6, 2020
@blackjack4494
Copy link

@random-nick needs a little rework. Take this video as an example 7takIh1nK0s. A test could be added for this.
You can find more information here.
blackjack4494#54

Your approach assumes you can get information for age gated videos without being logged in. But like I mentioned in the post at the end this case is special. It requires you to be logged in to watch it and in addition it is age gated. If this combination is common - I have no clue. Who knows who ultimately decided that this video is age gated. Could be the community, the uploader or youtube itself or a mix.

@dstftw

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

Successfully merging this pull request may close these issues.

youtube extractor fails on age-gated videos
6 participants