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 videos) java.io.IOException: Invalid status code for video info response: 404 #638

Open
Muh9049 opened this issue Jun 18, 2021 · 4 comments

Comments

@Muh9049
Copy link

Muh9049 commented Jun 18, 2021

I already reported this in the JDA server but I’ll just create it here as well so it’s easier to keep track of. PR #627 fixed this issue previously, however, it has broken again due to some YouTube changes (?)

The error message you’ll get is something along the lines of “java.io.IOException: Invalid status code for video info response: 404”.

@Muh9049 Muh9049 changed the title java.io.IOException: Invalid status code for video info response: 404 (Age-restricted videos) java.io.IOException: Invalid status code for video info response: 404 Jun 18, 2021
@JellyBrick
Copy link

@Muh9049
Copy link
Author

Muh9049 commented Jun 20, 2021

I tried a few different ones from the comments on that repository, and none of them seem to work for age-restricted videos. However, they do for regular videos. So unless I'm doing this totally wrong, I'm not sure how else to do it. Does anyone know how to do this part properly?

Here are two I tried by editing the URL here. I tried a couple of others as well but I've lost track of them at this point.

  1. String url = "https://www.youtube.com/get_video_info?video_id=" + videoId + "&eurl=" + encodedApiUrl + "hl=en_GB&html5=1&c=TVHTML5&cver=7.20201028";
  2. String url = "https://www.youtube.com/get_video_info?video_id=" + videoId + "&eurl=" + encodedApiUrl + "html5=1&c=TVHTML5&cver=7.20201028";
  3. String url = "https://www.youtube.com/get_video_info?video_id=" + videoId + "&eurl=" + videoApiUrl + "&sts" + sts + "&html5=1&c=TVHTML5&cver=7.20201028";

1 and 3 result in an argument "content" is null error.
2 results in an Invalid status code for video info response: 404 error.

Update:
For anyone who is still having this issue, please check PR #640 as it will fix this issue for you. It definitely isn’t going to be a permanent fix because YouTube will likely change this again, but it’s worth trying if you are fed up with 404 errors in your logs.

@Muh9049
Copy link
Author

Muh9049 commented Jul 25, 2021

Welp, the 404 error is now back so PR #640 or 1.3.78 won’t work anymore for age restricted videos unfortunately 😔

Not sure what fixes there are at the moment

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

No branches or pull requests

3 participants
@JellyBrick @Muh9049 and others