4 Apr 2024 |
Ward |  Download image.png | 08:32:49 |
Ward | this is also mentioned in a issue on Invidious saying it requires auth | 08:33:04 |
Ward | without proxying i dont get 403'd | 08:35:18 |
absidue | In reply to @wardpearce:matrix.org doesnt appear to be correct, this is a instance im hosting locally with only caddy sitting in between docker. Making a request to a adaptive format video URL why proxying it gives a 403 error Have you checked that that 403 isn't coming from YouTube itself and that Invidious is just passing it through. YouTube likes to return 403s when something is off. | 08:35:23 |
absidue | In reply to @wardpearce:matrix.org doesnt appear to be correct, this is a instance im hosting locally with only caddy sitting in between docker. Making a request to a adaptive format video URL why proxying it gives a 403 error * Have you checked that that 403 isn't coming from YouTube itself and that Invidious is just passing it through? YouTube likes to return 403s when something is off. | 08:35:50 |
Ward | ofc 1st thing i checked, getting the video directly doesn't 403 | 08:36:13 |
absidue | In reply to @wardpearce:matrix.org ofc 1st thing i checked, getting the video directly doesn't 403 You need to check on the same IP as the Invidious instance is running on, as 403s during proxying usually means that YouTube has blocked the IP of your server. | 08:37:06 |
Ward | im running it locally, its the same IP | 08:37:31 |
unixfox | If you have ipv4 and ipv6 connectivity you may not use the same IP | 08:37:52 |
Ward | appears to be the same IP | 08:42:34 |
nohtyp | Anyone here have quadlet configuration files? | 08:44:26 |
Ward | In reply to @wardpearce:matrix.org appears to be the same IP just disabled IPv6 on my PC | 08:48:13 |
Ward | just tried 6 other Invidious instances not hosted by me with the same result, audio adaptiveStreams work fine but not video | 08:51:36 |
| @heterochromia420:tchncs.de changed their profile picture. | 09:00:12 |
absidue | In reply to @wardpearce:matrix.org sent an image. The URL in this screenshot has each query parameter duplicated, that's not normal, try removing the duplicated parameters and see if it works then. | 09:03:44 |
Ward | odd that came directly from the API | 09:04:20 |
absidue | In reply to @wardpearce:matrix.org odd that came directly from the API so you changed nothing about the URL? | 09:05:01 |
absidue | Not getting the duplicated URL parameters for the few public instances I've tried and streaming works fine for those. | 09:05:34 |
Ward | is local=true? | 09:05:46 |
absidue | just tried a different instance and got duplicated ones | 09:10:03 |
Ward | odd | 09:10:37 |
absidue | but not in the same way as in your screenshot, in the raw API response, it's a literal copy including the question mark, but it looks like the browser rearranges them when making the request | 09:10:41 |
| @heterochromia420:tchncs.de changed their profile picture. | 09:10:57 |
absidue | Ward It's not the proxy that is broken (if you remove the duplicate parameters, the 403 goes away), it's the API response. | 09:13:38 |
Ward | aah odd, wonder why its duplicating parameters on some instances | 09:14:02 |
absidue | In reply to @wardpearce:matrix.org aah odd, wonder why its duplicating parameters on some instances because of the code here: https://github.com/iv-org/invidious/blob/master/src/invidious/http_server/utils.cr#L16-L19
.request_target includes the query parameters and then the code appends the query parameters to the end of that
simplified example: https://play.crystal-lang.org/#/r/gn8v
to quote the docs:
Returns the concatenation of #path and #query as it would be used as a request target in an HTTP request.
https://crystal-lang.org/api/1.11.2/URI.html#request_target%3AString-instance-method
| 09:23:33 |
Ward | aaaahh | 09:24:45 |
absidue | would probably be better to use update_query_params : https://crystal-lang.org/api/1.11.2/URI.html#update_query_params%28%26%3AURI%3A%3AParams-%3E_%29%3AURI-instance-method | 09:26:56 |
absidue | or not, looks like Invidious' CI tests all the way down to Crystal 1.7.3 but that method was introduced in 1.9.0, there is probably another way of doing it without that method | 09:29:41 |
Ward | yea hopefully | 09:43:47 |