invidious icon indicating copy to clipboard operation
invidious copied to clipboard

[Bug] Can't load the video on this Invidious instance. YouTube is currently trying to block Invidious instances.

Open TheEdgeOfRage opened this issue 1 year ago • 30 comments

EDIT: Switched title from Constant 403 errors while trying to load videoplayback to Can't load the video on this Invidious instance. YouTube is currently trying to block Invidious instances. in order to reflect the current error message.


EDIT by @unixfox: It appears that youtube is trying to block the popular invidious instances by returning 403 if the video stream is loaded through the invidious instance (with proxy or dash enabled).

Alternative solution is to switch off proxy or use another instance that is unblocked.

To public instances maintainers: https://github.com/iv-org/invidious/issues/4045#issuecomment-1682816728


Describe the bug I host my own invidious instance and some videos just won't load on it. The thumbnail loads, but the video itself does not. There's just a spinner and the timeline says 0:00/0:00. This does not happen with all videos, but I haven't spotted a pattern yet.

When looking at the network tab, I can see that the browser is constantly sending requests to /videoplayback and getting a 403 status with no response body. It sends about 10 requests per second and doesn't stop until I close the tab. For reference, I use DASH on my instance.

Steps to Reproduce

  1. Go to https://vid.theedgeofrage.com/watch?v=RBo1Mq1JMh8
  2. Try to play video
  3. See error

Logs Logs don't show anything besides the failing request log itself:

invidious-invidious-1     | 2023-08-10 09:50:50 UTC [info] 403 GET /videoplayback?expire=1691682024&ei=iLDUZJnwFNCOx_APssW3qAM&ip=94.130.141.40&id=o-ALEojr5Ke8EW5dc7Xuq-3wksylUWHvc81JCGu0Jw5dkp&itag=136&source=youtube&requiressl=yes&mh=Co&mm=31%2C26&mn=sn-4g5e6nzz%2Csn-f5f7kn7z&ms=au%2Conr&mv=m&mvi=4&pl=22&initcwndbps=445000&spc=UWF9f3uYf0Q_K1VEYIgDmPBkGM6dxrZqXRGhYOsRhw&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=438730931&dur=3145.775&lmt=1691291183341453&mt=1691660003&fvip=2&keepalive=yes&fexp=24007246&beids=24350018&c=ANDROID&txp=3309224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgLzQ6H_s28Scvwg6naQLHHEGK_-68OgYfih7J5xXWEdwCIQDdIlh8g6r6ZjTwl-kV2p4qAlFpOS0K6wzm0WBKq4wJsA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAOBrXV03okr0vNFfd6sxZ-7xvwhPg1UNe209RUtr9O_wAiBaZWVNy_C4QhxWpOxZ1IP67fbfVGc03skcndJdI_ef2Q%3D%3D&host=rr4---sn-4g5e6nzz.googlevideo.com 50.29ms

Screenshots

invidious

Additional context

  • Browser: Firefox 116
  • Desktop OS: Linux
  • Invidious deployed through docker, latest version from 2023-08-07

docker-compose.yml file:

version: "3"
services:
 invidious:
   image: quay.io/invidious/invidious:latest
   restart: unless-stopped
   ports:
     - "127.0.0.1:8030:3000"
   environment:
     # Please read the following file for a comprehensive list of all available
     # configuration options and their associated syntax:
     # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
     INVIDIOUS_CONFIG: |
       db:
         dbname: invidious
         user: kemal
         password: REDACTED
         host: invidious-db
         port: 5432
       check_tables: true
       hmac_key: REDACTED
       external_port: 443
       domain: vid.theedgeofrage.com
       https_only: true
       statistics_enabled: false
       use_quic: true
       popular_enabled: false
       captcha_enabled: false
       admins: [TheEdgeOfRage]
       channel_refresh_interval: 10m
       dark_mode: dark
       feed_menu: ["Subscriptions", "Playlists"]
       default_home: Subscriptions
       comments: ["youtube", "reddit"]
       quality: dash
       quality_dash: 1440p
       unseen_only: true
   healthcheck:
     test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
     interval: 30s
     timeout: 5s
     retries: 2
   logging:
     options:
       max-size: "1G"
       max-file: "4"
   depends_on:
     - invidious-db

 invidious-db:
   image: docker.io/library/postgres:14
   restart: unless-stopped
   volumes:
     - postgresdata:/var/lib/postgresql/data
     - ./config/sql:/config/sql
     - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
   environment:
     POSTGRES_DB: invidious
     POSTGRES_USER: kemal
     POSTGRES_PASSWORD: REDACTED
   healthcheck:
     test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
 postgresdata:

TheEdgeOfRage avatar Aug 10 '23 09:08 TheEdgeOfRage

Please post the invidious version (bottom of the page) and check if you are up to date.

unixfox avatar Aug 10 '23 10:08 unixfox

I'm running the latest image, from 3 days ago

TheEdgeOfRage avatar Aug 10 '23 20:08 TheEdgeOfRage

Please post the version anyway thank you.

And the video ID where you have these errors.

unixfox avatar Aug 10 '23 21:08 unixfox

I'm chiming in with +1 on this issue - 403 on videoplayback? route. I'm having the same, except not as constantly.

Container logs say the same:

2023-08-11 06:44:55 UTC [info] 403 GET /videoplayback?expire=1691757657&ei=-dfVZM_TAvC9x_APvce1wA4&ip=REDACTED&id=o-AIiUCaC5r4PPv9NR8x2HCsd90e5z0F7lKnoyglgAp4Jx&itag=398&source=youtube&requiressl=yes&mh=jt&mm=31%2C29&mn=sn-32o-1the%2Csn-5hnekn7d&ms=au%2Crdu&mv=m&mvi=2&pl=26&initcwndbps=3022500&spc=UWF9f8N6p4VTO2oChYGdB3gnM1LBkKYXrWmuZCCZBw&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=46003166&dur=857.880&lmt=1691441992636539&mt=1691735604&fvip=5&keepalive=yes&fexp=24007246&c=ANDROID&txp=5537434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgKG7B8BX1QxXs7KG6F3AP5EBDGY9ZLpJYLMc4EWBsi5cCIQC_FtCjYUiBmORbDPliDnDvBgX8Ydim7OPtZj2Tjq2Vbg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgekKYcP9okaaUSpSym8cuxU-QEXgRj8hdYhUZEeTOGi4CIQCz6Yk5ChMi5Nke81ZAv6TyOhdakvNoMf71sRSVAAUksw%3D%3D&host=rr2---sn-32o-1the.googlevideo.com 30.69ms

Version: 2023.08.07-3450896 @ master

Affected IDs: umpuS0jJs-s nQcPuFmA7XU ZPSqhb4KKNc Yi0WRF5WPFw

swolford avatar Aug 11 '23 06:08 swolford

@swolford funnily enough, all of those videos play on my instance. And whenever I encounter the 403 error, I just hit the "switch invidious instance" and they pretty much always work on another one.

Also, I just tried the video that was failing on my instance yesterday and it's working now. So it's definitely just an intermittent issue. But once it starts failing on an instance, it keeps happening even after hard reloading, restarting the instance and even updating it. I think this might be related to the communication to youtube itself

TheEdgeOfRage avatar Aug 11 '23 07:08 TheEdgeOfRage

I'm guessing it might be a cache issue.

YouTube recently implemented a change that broke playback as various streaming urls returned will just yield a 403 instead of actual video content. See #4027

A workaround was added in #4037 which was merged on August 7th.

However, due to the video cache, streaming urls from before the fix are still being used. The aforementioned video working now is probably because the cache got cleared.

syeopite avatar Aug 11 '23 08:08 syeopite

I guess I'll leave this open for a couple days then and see if the error resurfaces. If not, I'll close this issue

TheEdgeOfRage avatar Aug 11 '23 08:08 TheEdgeOfRage

I have it with almost all videos on my personal instance. Latest image also. Will report if it does not vanish with cache empty.

Edit: all new videos do not work - very strange! 403 all the way

blackandcold avatar Aug 11 '23 11:08 blackandcold

Rebuilding the Dockerimage and running docker-compose again made it work for now. The patch was integrated 3 days ago.

blackandcold avatar Aug 11 '23 11:08 blackandcold

I'm guessing it might be a cache issue.

I don't think so the cache is only kept for 6 hours max and refresh by invidious after that.

unixfox avatar Aug 11 '23 11:08 unixfox

I can affirm that this issue occurred in previous versions, rebuilding (through docker-compose build) and restarting brought it back to normal

foodornt avatar Aug 11 '23 17:08 foodornt

I haven't encountered the issue at all in the past few days, so I'll close this as resolved.

TheEdgeOfRage avatar Aug 14 '23 13:08 TheEdgeOfRage

I'm getting this error on https://iv.nboeck.de, https://vid.puffyan.us, https://invidious.io.lol, https://invidious.no-logs.com instances youtube URL: https://www.youtube.com/watch?v=KtQZRAkgLqo Screenshot-230815-1416-55

mortezadadgar avatar Aug 15 '23 10:08 mortezadadgar

Reopening as youtube appears to straight block the IP addresses of the popular public instances.

unixfox avatar Aug 16 '23 22:08 unixfox

The issue https://github.com/iv-org/invidious/issues/3915 still applies for discussing about how to circumvent youtube blockage.

Please see how to circumvent the blockage: https://github.com/iv-org/invidious/issues/4045#issuecomment-1763203512

unixfox avatar Aug 17 '23 19:08 unixfox

The issue #3915 still applies for discussing about how to circumvent youtube blockage.

This comment still apply for solutions on how to circumvent the youtube blockage: #3822 (comment)

Youtube might be blocking subnets, I get a 403 on IPv6es in both the 16 IPv6 and routed subnets of BuyVM Luxembourg. I also have the same issue on Racknerd Los Angeles, but I think that is because of the v6 being in the AAAA record, I'll update here after getting a secondary v6 from them.

I also will try (re)setting up the ipv6 thing on my home network and trying with that, to see if that will help.

The interesting part in all this is that Piped continues to work, with all the IPv6es I threw at it after this wave of blockages..

gi-yt avatar Aug 28 '23 15:08 gi-yt

Disabling IPV6 didn't help in my case

kuba-orlik avatar Sep 02 '23 10:09 kuba-orlik

I'd just like to add that I had the exact same problem with my instance and it went away after deleting the old docker image and building a new one. I guess that there was some breaking change on youtube's side and that invidious required a complete rebuild.

Tha14 avatar Sep 09 '23 23:09 Tha14

I'd just like to add that I had the exact same problem with my instance and it went away after deleting the old docker image and building a new one. I guess that there was some breaking change on youtube's side and that invidious required a complete rebuild.

It's very much possible that you were running an old invidious version that was blocked by youtube. We had to do some changes to get past this blockage.

It's unrelated to the current issue public instances are facing.

unixfox avatar Sep 10 '23 06:09 unixfox

Something I've noticed is that certain livestreams (not live, but completed) seem to be failing. Every Invidious instance I can think of fails to load watch?v=lrqNLU-js-k which was streamed, as of writing, 11 hours ago. On instances where download is enabled, the only files that show up are either video only or audio only (and didn't download, either), so I'm guessing it's just Youtube having not finished processing the video.

I've noticed it happening a lot within the past 48-ish hours with completed livestreams, which is why I'm mentioning it here. Also live livestreams seem to have been broken for weeks if not months (JS on or off), but that could be Youtube just blocking the instance (I mainly use yewtu.be or vid.puffyan.us).

ba06 avatar Sep 19 '23 10:09 ba06

@ba06 Yes you are correct those completed live streams haven't been reprocessed to normal videos yet, how YouTube prioritises which ones get processed first, isn't really known but more popular ones tend to get processed sooner.

The player that Invidious (and FreeTube) use, video.js, can't handle YouTube's live stream DASH (technical jargon: self-initialising segments) but YouTube also provides HLS manifests for those post-live-DVR videos, it only has the last 2 hours of the live stream, but it's better than nothing.

TL;DR If Invidious treats those post live DVR videos as live streams, playback should work (check if videoDetails.isPostLiveDvr is true in the Innertube /player response).

absidue avatar Sep 19 '23 19:09 absidue

I suspect there must be a different issue but a particular IP is being blocked. For invidious.garudalinux.org as well as piped.garudalinux.org we are utilizing Squid to proxy outgoing requests via random IPs of our /64 subnet. Invidious is constantly giving 403 while Piped works just fine. Recently had to rotate addresses to keep it working. Invidious however still does not work.

Restarting the instance is also not helping in this particular case. Is it possible that Invidious does not respect HTTP(S)_PROXY environment variables?

dr460nf1r3 avatar Sep 27 '23 12:09 dr460nf1r3

I suspect there must be a different issue but a particular IP is being blocked. For invidious.garudalinux.org as well as piped.garudalinux.org we are utilizing Squid to proxy outgoing requests via random IPs of our /64 subnet. Invidious is constantly giving 403 while Piped works just fine. Recently had to rotate addresses to keep it working. Invidious however still does not work.

Restarting the instance is also not helping in this particular case. Is it possible that Invidious does not respect HTTP(S)_PROXY environment variables?

invidious does not support http proxies yet, there is WIP for it though: https://github.com/syeopite/invidious/tree/http-proxy

gi-yt avatar Sep 27 '23 14:09 gi-yt

Now that explains quite a lot. Thanks for the information!

dr460nf1r3 avatar Sep 27 '23 15:09 dr460nf1r3

I cannot play Disney Channel videos.

joaquinito2070 avatar Oct 10 '23 17:10 joaquinito2070

Hello to all public instances owners or people that are running a private Invidious instance that is blocked!

We have officially released a tool that allow to automatically rotate the IPv6 address of your Invidious server: https://github.com/iv-org/smart-ipv6-rotator and thus escape from the YouTube block!

You can follow the detailed tutorial here: https://docs.invidious.io/ipv6-rotator/

Please give your feedback, it is very important to us! For any help related to this tool, please comment here: https://github.com/iv-org/invidious/issues/3915 or on matrix or on IRC.

unixfox avatar Oct 14 '23 23:10 unixfox

I followed all the instructions here: https://docs.invidious.io/ipv6-rotator/

root@invidious ~/invidious [1]# docker-compose exec invidious ping -c 1 ipv6.icanhazip.com
PING ipv6.icanhazip.com (2606:4700::6812:7361): 56 data bytes
64 bytes from 2606:4700::6812:7361: seq=0 ttl=58 time=1.799 ms

But

root@invidious ~/invidious# sudo lsof -i
COMMAND     PID            USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx       660        www-data   27u  IPv4 178042      0t0  TCP invidious:http->172.71.250.19:11990 (ESTABLISHED)
nginx       660        www-data   44u  IPv4 178047      0t0  TCP invidious:http->172.71.250.19:11978 (ESTABLISHED)
nginx       660        www-data   58u  IPv4 176403      0t0  TCP invidious:http->172.71.250.19:62074 (ESTABLISHED)
docker-pr 16742            root    4u  IPv4 180586      0t0  TCP localhost:3000 (LISTEN)

I'm still connected over IPv4

root@invidious ~/invidious# docker-compose exec invidious getent ahostsv6 google.com
2a00:1450:400e:811::200e STREAM google.com
2a00:1450:400e:811::200e DGRAM  google.com

IPv6 is the default though

gptlang avatar Oct 19 '23 00:10 gptlang

I just installed invidious, via docker and none of the videos are working and giving this error. Search works fine, I do not have proxy enabled. I currently have a premium youtube subscription as well so my ip shouldn't be blocked. This is a private instance and does not use public proxy. I'm just looking for a better UI, rather than trying to get around the adblock.

{ "name": "invidious", "version": "2023.10.26-8087e64d", "branch": "master" }

image

aram535 avatar Oct 31 '23 08:10 aram535

I just installed invidious, via docker and none of the videos are working and giving this error. Search works fine, I do not have proxy enabled. I currently have a premium youtube subscription as well

{ "name": "invidious", "version": "2023.10.26-8087e64d", "branch": "master" }

image

Completely unrelated to this github issue. I can see that you have not correctly configured invidious all the way, please check this documentation: https://docs.invidious.io/installation/#post-install-configuration

unixfox avatar Oct 31 '23 08:10 unixfox

We have fixed an issue where invidious would not send all the traffic in ipv6: https://github.com/iv-org/invidious/pull/4225 Please add this line in your config.yml to be sure that invidious send the traffic in ipv6:

force_resolve: ipv6

If you are using the rotator (https://docs.invidious.io/ipv6-rotator/), please make sure to have the line above and have updated Invidious!
We have reflected the documentation for this new change.

unixfox avatar Nov 02 '23 22:11 unixfox