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

Age restricted video's not reporting error #317

Closed
ghost opened this issue May 5, 2018 · 4 comments
Closed

Age restricted video's not reporting error #317

ghost opened this issue May 5, 2018 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented May 5, 2018

Hi,

info.js
if (!body.includes('<div id="watch7-player-age-gate-content"')) { return callback(new Error(util.between(body, '<h1 id="unavailable-message" class="message">', '</h1>').trim())); }

This piece of code causes an application to freeze since it does not get a response.

if (!body.includes('class="subreason style-scope ytd-player-error-message-renderer"')) { return callback(new Error(util.between(body, '<h1 id="unavailable-message" class="message">', '</h1>').trim())); }

This resolves the issue, an error is thrown back, and i can use the application further.

Would it be possible to research this further? My locale is NL.

@fent
Copy link
Owner

fent commented May 5, 2018

Age restricted videos don't throw an error. Their info is still retrieved

https://github.com/fent/node-ytdl-core/blob/master/test/irl-test.js#L10-L12

Can you clarify what you mean by your app freezing? Is no error or response given with age restricted videos? Is an error thrown but not caught?

Is there a video you have where this happens?

@ghost
Copy link
Author

ghost commented May 9, 2018

Hmm, the application that freezes has been referenced.
No response or error is given with the current code, which causes the application to go into a non-responsive state(hang). When adjusting the code as stated in my opening post, the application throws an error instead, as expected.

The video (do not judge me): https://www.youtube.com/watch?v=Ggwn7htyBCs

@PrestonN
Copy link
Contributor

Hey there, I'm the developer of the app in question. It looks like the issue has to do with the player_response object returning as a string when I access an age restricted video. Typically it's returned as an array of objects but doesn't seem to be the case when attempting to view an age restricted video. Here are some snapshots if it helps.

This is what is usually returned when a video is called.

playerresponseobject1

This is what is returned with an age restricted video.

playerresponseobject2

I can work around this issue in my application, but I figured it would be better if I mentioned it here for you to take a look at. Thanks again for the project, it's been a massive help. :)

@fent fent closed this as completed in 66ee72f May 13, 2018
@fent
Copy link
Owner

fent commented May 13, 2018

Hi, just published a fixed for this, v0.20.4. Please update and see if this fixes it for you.

Nice app you have there btw :)

@fent fent added the bug label May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants