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
plugins.youtube.py: 404 Intermittent and Repeatable (and related, but not duplicate of 3724 of other 404 issues) #3795
Comments
Apologies, one key piece. This is NOT a 429 or similar block. We've seen this on First calls to a URL. Also, we can make an identical call via ffmpeg or youtube-dl within seconds to the same URL and neither reports a 429 / block / other countermeasures. Not clear if one or the other or both are compensating for this behind the scenes, but can confirm 100% of the time if we see this intermittent 404, we have not yet encountered any block or restriction on running the exact same youtube URL on the same machine via ytdl / ffmpeg or even manually scraping a stream payload. |
@back-to Could the private |
Apologies, I should have checked the other repos first. 18 days ago, there was an update on the youtube-dl plug-in with the following notes: "youtube.py [youtube] Fix get_video_info request (closes #29086, closes #29165) This seems to be the age gate, and it appears the plug in now looks for the message about sign in or age gating on get_video_info and falls back to extracting it from I'd resolve and check in the fix if I could, but afraid I'm a php person and barely competent in writing python (reading I can fake, so the reference on line 1476 appears to be how they resolved, but I could be way off... )... Does this look right? |
I've been working on a complete rewrite of the youtube plugin over the past couple of hours and will submit a PR soon, maybe later today. I will have to split this into multiple commits for reviewing purposes, but I can share a branch on my fork with my current/finished results, so you guys can test it. As said, the private API calls seem to be unnecessary as it looks like the data is always embedded in the video page via To be honest, I haven't really touched the Youtube plugin since I've been working on Streamlink, so I don't know what the edge cases here are as I'm also unfamiliar with Youtube's API and their player data/code, but I haven't found any video/stream types so far which didn't work with my rewrite. Apart from the protected streams of course, which are currently also not supported, but I can't change that. |
You can check my rewrite here: Only use this for testing, as it's the first iteration and will probably change again. I will submit a pull request once I've rebased my changes, but that will be later today. I've linked the changes via the branch name and the not commit ID, so I don't have to update my post when something gets changed. Install via pip (install it in a virtualenv) $ pip install -U git+https://github.com/bastimeyer/streamlink.git@plugins/youtube/rewrite Or sideload from here (use Streamlink's latest development version from the master branch)
|
also urls like |
Thanks, done. Also improved the embedded URL handling and fixed the data of the consent dialog which was html-escaped and could redirect to invalid URLs when more than one query params was set ( Diff here:
Looks like this could be dropped. It's not a video URL and if a channel is live, their live stream can be accessed via I'll take a look at this later and then submit a PR. |
Thank you, acknowledging receipt. We capture about 150 live events per day (government press conferences and hearings... very exciting!). We're firing up a parallel process to run the new branch to test not yet live/live/live stream but complete/pre-recorded. Thank you! |
btw, PR here: #3797 |
Is this going into a release anytime soon? would rather not have to wrestle with ripping out an installed version and replacing with a development one if I don't have to. YT is completely dead for me with Streamlink. It won't parse a single URL. The issue described here is exactly what I am experiencing. |
My pull request has just been submitted 7 hours ago. Not sure what you're expecting here... |
Cool.
Is there a way to try your YouTube.py into a 2.1.2 release?
(it seems to want other dependencies if you just drop it in the plugins
folder)
…On Thu, Jun 17, 2021, 8:57 PM Sebastian Meyer ***@***.***> wrote:
My pull request has just been submitted 7 hours ago. Not sure what you're
expecting here...
The changes first have to be reviewed before they can be merged into
master and after that there will be a 2.2.0 release. What I have shared
in this thread before submitting the PR was to get early feedback, as it's
a complete rewrite of the plugin and not just a small bugfix. This has the
potential to break certain video types which were working before and since
no official YT API is being used, this needs to be validated first.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3795 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNBVNCUQAKCUHXXTNEWEEDTTKKXTANCNFSM46Z3GGSA>
.
|
Already explained here: |
Plugin Issue
Description
There have been issues over the past couple of months with YouTube reporting 404s. It's been tricky because it's not always reproducable. We had no problems last two days, and today, half our captures have this problem.
The symptom is no different than 3724 and other previously reported items. The error is the same. Using the simplest execution.
However, what we are seeing is similar to what we couldn't narrow down when this occurred a month ago. If you wait 3-5 minutes, or do from different machines, the same call can work, or it can report an error.
From the same machine:
If you can test from machines with different IP addresses, you can run the same plain command a few times at the same time, and you'll see about half work, half return the 404.
I'm not sure if I'm missing something on the retry or other recommended fixes (e.g. cookies) but regardless of how complex or simple the query is, we see this intermittent vs. consistent behavior.
Thinking out loud / speculation: a partial rollout of something new in the youtube cluster, a potential change being tested. Just plain don't know. Clearly it's not the plug-in since it behaves some of the time on the same call, but some new behavior (or bug) on YouTube?
Reproduction steps / Explicit stream URLs to test
https://www.youtube.com/watch?v=YertdWavZdk
- note you can use any youtube link that was a live stream originally, whether it's not yet live, currently live, or after the stream finishes. URL, have not tested with previously recorded onlyLog output
When the command works / doesn't 404:
When the command 404s:
Note the two calls above were run on the same machine ~3 minutes apart.
Additional comments, etc.
I've seen and tried the other suggestions: manually adding a cookie, playing with retries. As best I can tell, this is something on YouTube's end that's now been appearing intermittently for at least 2 months and, in our daily use, has not once been affecting 100% of our calls, which are all structured identically other than the youtube link. Either everything works fine, or half the YouTube calls fail when this appears. Never 100%. In going through our internal Jira, it's always been an intermittent thing.
Love Streamlink? Please consider supporting our collective. Thanks!
The text was updated successfully, but these errors were encountered: