invidious
invidious copied to clipboard
[Bug] Age Restricted Videos do not play
Videos that have been marked age-restricted don't play Any video with age-restriction doesn't work. All you can see is the thumbnail. I've tested this on all public instances.
Steps to reproduce the behavior:
- Go to any age-restricted video
- See error
Even the play button doesn't work

Additional context
- Browser: Latest Windows version of Chrome
- OS: Win10 x64
Yeah, I’ve been facing the same issue. It seems like a recent problem. I don’t know if it’s related to what is going on at youtube-dl. But I couldn’t download using youtube-dl either, and I’m not in the E.U. nor do I have a Google account.
Can someone post a couple of age-restricted videos here? (this is for testing purposes though)
https://www.youtube.com/watch?v=5gZCjMjoilo
https://www.youtube.com/watch?v=fzhHXt7NKUs
https://www.youtube.com/watch?v=cIVPYWyPqKA
A 20$ bounty has been added to this issue.
Anyone opening a PR fixing this issue, will receive 20$ (in BTC) from the Invidious project.
More details: https://github.com/iv-org/invidious/issues/1898
Note: the yt-dlp people found a way to get access to the video by (I think) using the mobile website's embed. However this only works with videos that can be embedded. Having this solution implemented is "enough" for you to get the bounty.
Related: https://github.com/yt-dlp/yt-dlp/commit/4e6767b5f2e2523ebd3dd1240584ead53e8c8905
Just add &c=TVHTML5&cver=6.20180913 to https://github.com/iv-org/invidious/blob/993d731c92f6f07e4bee4a222c02e1e47d7f9d6e/src/invidious/videos.cr#L994
Note that this is a temporary fix and we expect it to break in the near future. See https://github.com/yt-dlp/yt-dlp/pull/328 for some fallbacks
The x-youtube-client-version header would also have to be set to 6.20180913
The
x-youtube-client-versionheader would also have to be set to6.20180913
No. get_video_info doesnt need x-youtube-client-version header
Yep. However, Invidious appends those headers by default as seen in here: https://github.com/iv-org/invidious/blob/993d731c92f6f07e4bee4a222c02e1e47d7f9d6e/src/invidious/helpers/utils.cr#L4-L17
In order to get this fix to work, x-youtube-client-version would also have to be set to 6.20180913
hm.. that is a problem. The header for all other requests should still be 2.20210407.08.00
Is it not possible to send this request without the header?
Nope. If we want to use the connection pool, all of those headers would get added no matter what. The only workaround for this is to set x-youtube-client-version to 6.20180913 during the request function call since the add_yt_headers function doesn't override existing headers.
required_parameters = URI::Params.new({
"video_id" => [id],
"eurl" => ["https://youtube.googleapis.com/v/#{id}"],
"html5" => ["1"],
"c" => ["TVHTML5"],
"cver" => ["6.20180913"],
})
embed_info = HTTP::Params.parse(YT_POOL.client &.get("/get_video_info?#{required_parameters}", headers: HTTP::Headers{"x-youtube-client-version" => "6.20180913"}).body)
Can this userscript be pasted somewhere into invidious? It worked for https://www.youtube.com/watch?v=KgmoMO66uPg :
https://raw.githubusercontent.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/main/Simple-YouTube-Age-Restriction-Bypass.user.js#bypass=true
Can this userscript be pasted somewhere into invidious? It worked for youtube.com/watch?v=KgmoMO66uPg :
That's already what the PR #2205 is doing.
Oh ok, nevermind then....
Reopening as not every age restricted videos are unblocked.
@unixfox can you name a problem video? I think I have a fix
Well this video used to not work with the fix for bypassing age restricted videos: https://www.youtube.com/watch?v=cIVPYWyPqKA but now it works :thinking:. I can't find a video that we can't bypass though.
We are still interested in your potential fix though.
https://github.com/yt-dlp/yt-dlp/pull/328#issuecomment-864117168
Cr381pDsSsA is one that still doesn't play even after #2205
Using cookies obviously work, the challenge is making it work without logging in
you can make a request to /get_video_info using the ANDROID client [4].
Doesn't work https://www.youtube.com/get_video_info?video_id=Cr381pDsSsA&eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2FCr381pDsSsA&html5=1&c=ANDROID&cver=16.20
I have a strange feeling that all of get_video_info has been removed as I've seen it 404 on everything I've thrown it - age restricted or not. Some googling shows that a while back they added more required fields which could be a possiblity, but I'd say they probably just entirely removed this endpoint to stop people from bypassing age restriction for legal reasons.
I have a strange feeling that all of get_video_info has been removed as I've seen it 404 on everything I've thrown it
Seems like it. We also couldn't find a set of parameters that works. the embed-workaround still works for embeddable videos, but auth seems necessary for everything else now
there seems to be a greasyfork script to fix this issue, so does this code help? https://greasyfork.org/en/scripts/375525-youtube-age-verification-bypass/code
there seems to be a greasyfork script to fix this issue, so does this code help? https://greasyfork.org/en/scripts/375525-youtube-age-verification-bypass/code
This is what https://github.com/iv-org/invidious/pull/2205 did. That method no longer works
the embed-workaround still works for embeddable videos
@pukkandan Could you point out which one is that?
You need to re-request the /browse API with the WEB_EMBEDDED_PLAYER client instead of WEB (other clients that work: ANDROID_EMBEDDED_PLAYER, IOS_MESSAGES_EXTENSION). See related params here
This method can bypass embeddable videos like HtVdAasjOgU, but others like Tq92D6wQ1mg will still not work
https://github.com/iv-org/invidious/pull/2220 already implements most of what is needed for this
There's a new bypass method: https://github.com/yt-dlp/yt-dlp/issues/574#issuecomment-887171136
All our findings so far: https://github.com/yt-dlp/yt-dlp/pull/575#issuecomment-887739287
Updated method created in PR https://github.com/iv-org/invidious/pull/2329, feel free to test it and submit your feedback.
Reopening like https://github.com/iv-org/invidious/issues/2189#issuecomment-880080346
I just stumbled across this issue. It worked in my build from 2022.01.21 and failed in the latest. After some testing, according to git disect commit 99091e919c9af56c27ca8aebd790c3b64b564f78 broke it again:
last good: 2022.02.03-6ddbccbc first bad: 2022.02.03-99091e91
Message from @TheFrenchGhosty:
The age restriction bypass isn't working consistently, it will only properly work after ~5 requests (just refreshing the page on the instance works). When it works once, it will work consistently everytime (because of caching I'm guessing).
Screenshots
Additional context
I can provide some examples videos IDs at request.
On a related note: the age restricted videos, don't have descriptions.
Youtube is rolling out some changes that breaks tier 3 age-gate bypass. There is currently no known workaround (other than passing the request through a proxy). yt-dlp and newpipe are also affected
