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

[Bug] Age Restricted Videos do not play #2189

Closed
SimoonDude opened this issue Jun 22, 2021 · 46 comments · Fixed by #2205 or #2329
Closed

[Bug] Age Restricted Videos do not play #2189

SimoonDude opened this issue Jun 22, 2021 · 46 comments · Fixed by #2205 or #2329
Labels
bounty bounty:20$ bug Something isn't working stale type:server-side type:video-playback Any issue related to video playback

Comments

@SimoonDude
Copy link

SimoonDude commented Jun 22, 2021

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:

  1. Go to any age-restricted video
  2. See error

Even the play button doesn't work
image

Additional context

  • Browser: Latest Windows version of Chrome
  • OS: Win10 x64
@SimoonDude SimoonDude added the bug Something isn't working label Jun 22, 2021
@Mennaruuk
Copy link

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.

@unixfox
Copy link
Member

unixfox commented Jun 24, 2021

Can someone post a couple of age-restricted videos here? (this is for testing purposes though)

@Mennaruuk
Copy link

Mennaruuk commented Jun 24, 2021

https://www.youtube.com/watch?v=5gZCjMjoilo
https://www.youtube.com/watch?v=fzhHXt7NKUs
https://www.youtube.com/watch?v=cIVPYWyPqKA

@TheFrenchGhosty
Copy link
Member

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: #1898

@TheFrenchGhosty
Copy link
Member

TheFrenchGhosty commented Jun 25, 2021

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: yt-dlp/yt-dlp@4e6767b

@pukkandan
Copy link

Just add &c=TVHTML5&cver=6.20180913 to

embed_info = HTTP::Params.parse(YT_POOL.client &.get("/get_video_info?html5=1&video_id=#{id}&eurl=https://youtube.googleapis.com/v/#{id}&gl=US&hl=en&sts=#{sts}").body)

Note that this is a temporary fix and we expect it to break in the near future. See yt-dlp/yt-dlp#328 for some fallbacks

@syeopite
Copy link
Member

The x-youtube-client-version header would also have to be set to 6.20180913

@pukkandan
Copy link

The x-youtube-client-version header would also have to be set to 6.20180913

No. get_video_info doesnt need x-youtube-client-version header

@syeopite
Copy link
Member

Yep. However, Invidious appends those headers by default as seen in here:

def add_yt_headers(request)
request.headers["user-agent"] ||= "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36"
request.headers["accept-charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
request.headers["accept"] ||= "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
request.headers["accept-language"] ||= "en-us,en;q=0.5"
return if request.resource.starts_with? "/sorry/index"
request.headers["x-youtube-client-name"] ||= "1"
request.headers["x-youtube-client-version"] ||= "2.20200609"
# Preserve original cookies and add new YT consent cookie for EU servers
request.headers["cookie"] = "#{request.headers["cookie"]?}; CONSENT=YES+"
if !CONFIG.cookies.empty?
request.headers["cookie"] = "#{(CONFIG.cookies.map { |c| "#{c.name}=#{c.value}" }).join("; ")}; #{request.headers["cookie"]?}"
end
end

In order to get this fix to work, x-youtube-client-version would also have to be set to 6.20180913

@pukkandan
Copy link

pukkandan commented Jun 25, 2021

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?

@syeopite
Copy link
Member

syeopite commented Jun 25, 2021

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)

@neurodiverseEsoteric

This comment has been minimized.

@unixfox

This comment has been minimized.

@neurodiverseEsoteric

This comment has been minimized.

@unixfox unixfox reopened this Jul 14, 2021
@unixfox
Copy link
Member

unixfox commented Jul 14, 2021

Reopening as not every age restricted videos are unblocked.

@girst
Copy link
Contributor

girst commented Mar 29, 2022 via email

@unixfox
Copy link
Member

unixfox commented Mar 29, 2022

On Tue, Mar 29, 2022 at 01:00:24PM -0700, TheFrenchGhosty wrote:

Here's 4 SFW videos that are age restricted, for testing purpose:

there's a 4-tiered list of videos that's used to check agegate bypasses:
yt-dlp/yt-dlp#575 (comment)

Tiers 1,2 and 3 seems to work with the new method, which is great.

@tuxayo
Copy link

tuxayo commented Apr 30, 2022

Should this ticket be closed now that #2996 has been merged? Or is there still an issue?

@unixfox
Copy link
Member

unixfox commented Apr 30, 2022

Should this ticket be closed now that #2996 has been merged? Or is there still an issue?

No because not all age restricted videos can be bypassed so this issue is not entirely fixed.

@pukkandan
Copy link

tbh, It is doubtful this can ever can be fully fixed unless setting up an account proxy server is an acceptable option

@unixfox
Copy link
Member

unixfox commented Apr 30, 2022

tbh, It is doubtful this can ever can be fully fixed unless setting up an account proxy server is an acceptable option

We have been talking about integrating that into invidious so it may come one day.

@unixfox
Copy link
Member

unixfox commented Aug 6, 2022

Note: encrypted age-restricted videos don't work, see: #3245

Example video IDs:

@SamantazFox
Copy link
Member

Non-working video ID, reported to me by e-mail: A2W2EBMX8DY

@UlyssesZh
Copy link
Contributor

For me, I still have issues watching age restricted videos. Loading them are significantly more slowly (which greatly influences watching) than loading other videos. I can observe this for all videos listed in this comment.

@unixfox
Copy link
Member

unixfox commented Oct 26, 2023

For me, I still have issues watching age restricted videos. Loading them are significantly more slowly (which greatly influences watching) than loading other videos. I can observe this for all videos listed in this comment.

Known issue, it's tracked in #3245

Copy link

This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.

@github-actions github-actions bot added the stale label Oct 25, 2024
@unixfox
Copy link
Member

unixfox commented Oct 25, 2024

Closing as there is no way to circumvent anymore. Logging into a google account will do but it's tracked in #4977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty bounty:20$ bug Something isn't working stale type:server-side type:video-playback Any issue related to video playback
Projects
Archived in project
16 participants