lamarios / clipious

Invidious client for android
GNU Affero General Public License v3.0
978 stars 33 forks source link

Cannot load subscriptions #631

Closed thejevans closed 3 weeks ago

thejevans commented 3 weeks ago

Describe the bug Cannot load videos on subscriptions page.

To Reproduce Steps to reproduce the behavior:

  1. Go to Subscriptions
  2. See error "Could not fetch videos. Tap to try again."

Expected behavior I should see the subscriptions available.

Smartphone (please complete the following information):

Additional context

log output:

[INFO] [Service] - 2024-11-06 18:24:15.851710 - Response from GET https://xxxxxxxxxx/api/v1/channels/UCPPZoYsfoSekIpLcz9plX1Q/videos?sort_by=newest, status: 500 
[SEVERE] [Service] - 2024-11-06 18:24:15.852125 - Error while calling service: Could not extract JSON. Youtube API returned error 400 with message:<br>"Request contains an invalid argument." 

Looking at my server logs, this is the same behavior as this issue on the Invidious repo, but happens when I try to load subscriptions instead on Clipious. I've cleared app data and logged in with both token and cookies. I've made sure my Invidious docker containers are up to date. Also, everything works fine on the Invidious web app.

lamarios commented 3 weeks ago

The error code is 500. Which is server error. Something is wrong with your instance. If you load the URL from the logs in your browser. What do you get?

thejevans commented 3 weeks ago

Thanks for responding. I get the second line in the logs I sent:

{"error":"Could not extract JSON. Youtube API returned error 400 with message:<br>\"Request contains an invalid argument.\""}

The log on my Invidious server when I try to load the URL from the Clipious log or try to reload the subscriptions page in Clipious:

invidious_1       | 2024-11-07 02:34:08 UTC [error] YoutubeAPI: Got error 400 when requesting /youtubei/v1/browse
invidious_1       | 2024-11-07 02:34:08 UTC [error] YoutubeAPI: Request contains an invalid argument.
invidious_1       | 2024-11-07 02:34:08 UTC [info] YoutubeAPI: POST data was: {"context" => {"client" => {"hl" => "en", "gl" => "US", "clientName" => "WEB", "clientVersion" => "2.20240814.00.00", "clientScreen" => "WATCH_FULL_SCREEN", "osName" => "Windows", "osVersion" => "10.0", "platform" => "DESKTOP", "visitorData" => "REDACTED"}}, "continuation" => "REDACTED"}
invidious_1       | 2024-11-07 02:34:08 UTC [info] 500 GET /api/v1/channels/UC1snsNabJq-Tp5ugRMb1W4w/videos?sort_by=newest 132.3ms

When loading the subscription page from the Invidious web UI, it works correctly and this is the resulting log:

invidious_1       | 2024-11-07 02:39:36 UTC [info] 200 GET /feed/subscriptions 5.93ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/7htFHSkGYYU/mqdefault.jpg 298.01ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/yIdX3gfzlUo/mqdefault.jpg 368.01ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/1stJ9agSVn0/mqdefault.jpg 282.87ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/otL1uWxnZiY/mqdefault.jpg 410.96ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/T3KjeNHF8Y0/mqdefault.jpg 61.82ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/J-kHOXp3CHo/mqdefault.jpg 222.72ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/FbGqj8FULbU/mqdefault.jpg 202.27ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/UmH6F8y3_OE/mqdefault.jpg 114.46ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/rwNYwOLtJ4k/mqdefault.jpg 92.78ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/8oYF0vegV4A/mqdefault.jpg 273.34ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/rmV4ijEaRtI/mqdefault.jpg 188.54ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/s-lFgbzU3LY/mqdefault.jpg 379.99ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/X8tYY7hl3Nw/mqdefault.jpg 402.28ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/CK542nGThwI/mqdefault.jpg 202.49ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/GOTpkf4rVPQ/mqdefault.jpg 180.78ms
invidious_1       | 2024-11-07 02:39:37 UTC [info] 200 GET /vi/xeVq4PnorpI/mqdefault.jpg 292.04ms
invidious_1       | 2024-11-07 02:39:38 UTC [info] 200 GET /api/v1/auth/subscriptions 2.09ms
lamarios commented 3 weeks ago

From your log. The subscriptions are loading the channel page on clipious side. Meaning you're subscribing to the channels on your phone and not your invidious account.

This is different than the subscription page of the web ui.

The error log

{"error":"Could not extract JSON. Youtube API returned error 400 with message:<br>\"Request contains an invalid argument.\""}

Shows that clipious is receiving HTML instead of the expected JSON from the api. Try to load the same URL in your browser and see what is the output.

The invidious logs also show 500. This is an issue with your server.

thejevans commented 3 weeks ago

Try to load the same URL in your browser and see what is the output.

What I sent in the last comment was what I got back from the server when opening the URL in my browser. I did get JSON back.

The subscriptions are loading the channel page on clipious side. Meaning you're subscribing to the channels on your phone and not your invidious account.

That's very interesting because all I ever did on my phone was log in to my account on my server, where all my subscriptions are (I know because I imported them there directly from Google checkout in the Invidious web UI). I never subscribed to any new channels on my phone because I hide everything except what I am already subscribed to.

On my Shield, I have subscribed to two new channels over the past few months, and selected "both" when asked whether to subscribe on the device or on the server. Both of the apps worked fine for weeks after my last subscription, and then both stopped working sometime in the last 12 hours.

I uninstalled the app from my phone and reinstalled it, so maybe the data wipe didn't take. That fixed the issue there. Wiping the app data on my Shield fixed that as well.

My issue is resolved, but I'm still not clear as to what caused this.

lamarios commented 3 weeks ago

Hmm. I checked on my own app and I canlt load channels anymore with similar error. I'll need to check if something has changed on invidious side.

Not sure when i will have the time to do so.

thejevans commented 3 weeks ago

My guess is that this is some weird interaction between a recent and ongoing bug on the Invidious side, and the fact that I had subscribed to some things on my Shield. Anyway, thanks for your help.