FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

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

Open zBUS-549 opened this issue 2 years ago • 34 comments

Guidelines

  • [X] I have encountered this bug in the latest release of FreeTube.
  • [X] I have encountered this bug in the official downloads of FreeTube.
  • [X] I have searched the issue tracker for open and closed issues that are similar to the bug report I want to file, without success.
  • [X] I have searched the documentation for information that matches the description of the bug I want to file, without success.
  • [X] This issue contains only one bug.

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:

  • Local API Error (Click to copy): Error: Request to https://www.youtube.com/youtubei/vtrue/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false&alt=json failed with status 400
  • Falling back to Invidious API

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

  • renderer.js:2 VIDEOJS: WARN: using Vhs.BANDWIDTH_VARIANCE is UNSAFE be sure you know what you are doing
  • www.youtube.com/youtubei/vtrue/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false&alt=json:1 Failed to load resource: the server responded with a status of 400 ()
  • Error: Request to https://www.youtube.com/youtubei/vtrue/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false&alt=json failed with status 400 at Object. (renderer.js:2:1334762) at Generator.next () at a (renderer.js:2:876803) www.youtube.com/youtubei/vtrue/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false&alt=json:1
  • Failed to load resource: the server responded with a status of 400 ()

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

zBUS-549 avatar Feb 22 '24 00:02 zBUS-549

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?

ACR-Jeff avatar Feb 22 '24 01:02 ACR-Jeff

Tested on nightly-3891 and nightly-3981*.

halotroop2288 avatar Feb 22 '24 01:02 halotroop2288

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

thatmikeguy2 avatar Feb 22 '24 01:02 thatmikeguy2

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

GJJellyfish avatar Feb 22 '24 01:02 GJJellyfish

Same Issue

mandolith avatar Feb 22 '24 04:02 mandolith

can confirm on Linux :3

mattdawolf avatar Feb 22 '24 04:02 mattdawolf

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.

VideoGames1000 avatar Feb 22 '24 04:02 VideoGames1000

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.

ACR-Jeff avatar Feb 22 '24 05:02 ACR-Jeff

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

stortzm avatar Feb 22 '24 06:02 stortzm

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)

PikachuEXE avatar Feb 22 '24 07:02 PikachuEXE

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

hemna avatar Feb 22 '24 13:02 hemna

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

salvoza avatar Feb 22 '24 13:02 salvoza

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

Cyborgscode avatar Feb 22 '24 14:02 Cyborgscode

I have the same problem

Lilian63720 avatar Feb 22 '24 15:02 Lilian63720

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.

halotroop2288 avatar Feb 22 '24 15:02 halotroop2288

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

Joel21 avatar Feb 22 '24 17:02 Joel21

@Joel21 How did you do it. thanks

Lilian63720 avatar Feb 22 '24 17:02 Lilian63720

Guess I'll just uninstall...

zBUS-549 avatar Feb 22 '24 17:02 zBUS-549

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

Joel21 avatar Feb 22 '24 17:02 Joel21

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'.

Lence23 avatar Feb 22 '24 18:02 Lence23