FreeTubeApp / FreeTube

An Open Source YouTube app for privacy
https://freetubeapp.io/
GNU Affero General Public License v3.0
12.48k stars 764 forks source link

[Bug]: Local API error 400 (bad request) and falling back to Invidious API when loading videos or searches #4700

Closed zBUS-549 closed 4 months ago

zBUS-549 commented 4 months ago

Guidelines

Describe the bug

Freetube is working perfectly fine, but I keep getting these two errors when loading videos or searches, even when loading as a new window:

I believe these errors in the console are causing these error messages:

Am I the only one getting these errors, or is this something on YouTube's end?

Expected Behavior

No error messages when loading videos or searches.

Issue Labels

API issue

FreeTube Version

v0.19.1

Operating System Version

Windows 10 Pro 22H2

Installation Method

.exe

Primary API used

Local API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

No response

Nightly Build

ACR-Jeff commented 4 months ago

I came here due to having this same issue, I have been using the latest release since the day it was released and have not had this problem until today, Suspecting something that YT has changed?

halotroop2288 commented 4 months ago

Tested on nightly-3891 *and nightly-3981**.

thatmikeguy2 commented 4 months ago

Same, just started doing it around an hour ago. v0.19.1

GJJellyfish commented 4 months ago

Updated to a nightly build to see if this was fixed but seems too recent a bug. v0.19.1-nightly-3981 Beta

mandolith commented 4 months ago

Same Issue

mattdawolf commented 4 months ago

can confirm on Linux :3

VideoGames1000 commented 4 months ago

Been having this one for the last while as per #4699 Not sure I have any useful information that isn't already listed, but I will mention that at least for me and for now the Invideous API seems to be functional.

ACR-Jeff commented 4 months ago

I also noticed since this particular bug/issue, While searching for one particular search, If you want to search something else afterwards, You have to close Freetube completely to follow through with a new search, Otherwise the previous search results are still present.

Edit: This only causes an issue with Preferred API Backend set to use Local API, Changing to invidious API solves all of the above issues on my end.

stortzm commented 4 months ago

you can solve this by changing your Invidius API (https://api.invidious.io/) and then setting your Preferred API Backend to Invidius API

this solved the 400 error for me

EDIT: most instances are still struggling with whatever changes must have happened

PikachuEXE commented 4 months ago

Not our code issue Youtube change their response data in sw.js_data, it's not always the same (AB testing some stuff?) Reported in https://github.com/LuanRT/YouTube.js/issues/602

Made an untested workaround - https://github.com/PikachuEXE/FreeTube/actions/runs/8000502141 Like nightly version use at your own risk and backup before using it It's for myself (don't ask me to add stuff to it, just make your own fork)

hemna commented 4 months ago

I'm seeing this on macos freetube version 0.19.1. It just started for me today. Yesterday was fine.

salvoza commented 4 months ago

I am also seeing this happening today on Windows 11 and version 0.19.1 as well

Cyborgscode commented 4 months ago

Switching to "Invidius API" helps, but it's also not loading all the time.

Lilian63720 commented 4 months ago

I have the same problem

halotroop2288 commented 4 months ago

Stop bumping the post to say you have the same problem, unless you have something unique to add. Upvote the thread and follow.

We don't need emails for every single person using the app today. We're all seeing the same thing.

Joel21 commented 4 months ago

I haven't put it in my repository, but thanks to PikachuEXE the problem is solved

Lilian63720 commented 4 months ago

@Joel21 How did you do it. thanks

zBUS-549 commented 4 months ago

Guess I'll just uninstall...

Joel21 commented 4 months ago

Not our code issue Youtube change their response data in sw.js_data, it's not always the same (AB testing some stuff?) Reported in LuanRT/YouTube.js#602

Made an untested workaround - https://github.com/PikachuEXE/FreeTube/actions/runs/8000502141 Like nightly version use at your own risk and backup before using it It's for myself (don't ask me to add stuff to it, just make your own fork)

There is the solution

Lence23 commented 4 months ago

I solved this issue by. Settings > General Settings > chose Invidious API from 'Preferred API backend' and 'click' "Current Instance as Default" button.

if it slow just chose another 'invidious instance'.

profucius commented 4 months ago

For anyone recommending to switch from "Local API" to "Invidious API": This is not a solution for everyone. It may be the case that it works for you, but once a user's subscription count is over a threshold it will no longer work; Local API is the only solution for some of us.

John-foobar-Doe commented 4 months ago

I noticed some other issues that are probably associated with this bug: the thumbnail preview when hovering on video progress bar and screen caption/subtitles stop working in both Local API and Invidious API. This happened since about yesterday - at the same time as this bug appeared.

GrumbleAus commented 4 months ago

My subscriptions load perfectly. Every video I try to play has this issue. If I copy the invidious link into Brave browser, it plays fine. Seems to be the link from local API to Invidious as the invidious 'share' link works perfectly. Only started in the last 10 hours. I tried different Invidious servers.

Gorrrg commented 4 months ago

If your Preferred API Backend is set to "Local API" you either need to activate "Fallback to Non-Preferred Backend on Failure" in case YouTube reverses the changes you'll be back to normal. Or you set your preferred API to Invidious to wait for a bug fix to arrive in the nightlies. In either case you will want to switch to a working Individous instance that's also fast to not ruin your experience.

f-rank commented 4 months ago

That doesn't work for all cases and it already has been stated before.

If your Preferred API Backend is set to "Local API" you either need to activate "Fallback to Non-Preferred Backend on Failure" in case YouTube reverses the changes you'll be back to normal. Or you set your preferred API to Invidious to wait for a bug fix to arrive in the nightlies. In either case you will want to switch to a working Individous instance that's also fast to not ruin your experience.

AlekseiKhatkevich commented 4 months ago

I had installed fresh nigtly build (v0.19.1-nightly-3982 ) https://github.com/FreeTubeApp/FreeTube/actions/runs/8011359874 and problem did not disappear. Error: Request to https://www.youtube.com/youtubei/vtrue/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false&alt=json failed with status 400

Kirsty99 commented 4 months ago

I'm getting this now after selecting video.

image

JamarleyHub commented 4 months ago

My subscriptions load perfectly. Every video I try to play has this issue. If I copy the invidious link into Brave browser, it plays fine. Seems to be the link from local API to Invidious as the invidious 'share' link works perfectly. Only started in the last 10 hours. I tried different Invidious servers.

I assume that is because it doesn't use Invidious to fetch the feed, it uses RSS Feeds and those work perfectly fine still. For playback it switches to invidious and that's where the problem is. Also have this same issue, hope someone finds the cause soon and can make a patch.

ChipSendype commented 4 months ago

Using : v0.19.1 Beta I also solved the problem by using https://iv.ggtyler.dev "Set current instance as Default" I used to use https://vid.puffyan.us/ but that instance just spins videos indefinitely. Worked great for a while. Then set Invidious API as the Preferred API Backend. Search works as intended and videos play with no error messages. Although it's a little slow to load videos, I suspect with all the shinanigans Google is pulling, there's bound to be some kind of lag. Better than Google mining your soul for absolute control. :) Rage on privacy brothas!.

ezgoodnight commented 4 months ago

Thanks @ChipSendype, confirming that instance works for me also.

karolyi commented 4 months ago

I think the issue will be solved soon as there is already a merged PR for this: https://github.com/FreeTubeApp/FreeTube/pull/4704

So if it builds right, an update will solve the problem everywhere.

John-foobar-Doe commented 4 months ago

When will there be a new release containing this bug fix?

openforfuture commented 4 months ago

When will there be a new release containing this bug fix?

If you really need it, I found here the nightly with the bug fixed (backup data first and be aware it can have other bugs): https://github.com/FreeTubeApp/FreeTube/actions/workflows/build.yml

Gorrrg commented 4 months ago

It's fixed in the nightly now