muzika icon indicating copy to clipboard operation
muzika copied to clipboard

Can't fetch any data

Open AdrianVovk opened this issue 1 year ago • 13 comments

App doesn't seem to be able to load any content anymore. I deleted the app's data dir and recreated it to try and work around the problem, signed in again, but the problem still persists. Any page I try to open in the app leads to the same error message:

MuseError: Can't fetch data
{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "errors": [
      {
        "message": "Request contains an invalid argument.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

    MuseError@resource:///com/vixalien/muzika/js/main.js:9737:5
    request@resource:///com/vixalien/muzika/js/main.js:11274:15
    async*request_json@resource:///com/vixalien/muzika/js/main.js:11282:26
    get_home@resource:///com/vixalien/muzika/js/main.js:11309:24
    load@resource:///com/vixalien/muzika/js/main.js:19286:12
    load@resource:///com/vixalien/muzika/js/main.js:24757:38
    reload@resource:///com/vixalien/muzika/js/main.js:24787:17
    reload@resource:///com/vixalien/muzika/js/main.js:24916:17
    activate@resource:///com/vixalien/muzika/js/main.js:24897:16
    main@resource:///com/vixalien/muzika/js/main.js:32528:14
    run@resource:///org/gnome/gjs/modules/script/package.js:207:19
    @file:///app/bin/com.vixalien.muzika.Devel:22:40
    @file:///app/bin/com.vixalien.muzika.Devel:28:6

The app also logs the following to the terminal:

Gjs-Console-Message: 21:43:55.533: caching soup requests at /var/home/adrian/.var/app/com.vixalien.muzika.Devel/cache/com.vixalien.muzika.Devel/soup-cache
MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:763: FINISHME: support YUV colorspace with DRM format modifiers
MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:794: FINISHME: support more multi-planar formats with DRM modifiers

(com.vixalien.muzika.Devel:2): Gjs-Console-CRITICAL **: 21:43:56.236: Couldn't get logged in user

(com.vixalien.muzika.Devel:2): Gjs-WARNING **: 21:43:56.238: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
main@resource:///com/vixalien/muzika/js/main.js:32528:14
run@resource:///org/gnome/gjs/modules/script/package.js:207:19
@file:///app/bin/com.vixalien.muzika.Devel:22:40
@file:///app/bin/com.vixalien.muzika.Devel:28:6

Troubleshooting information:

{
  "argv": [
    "/app/bin/com.vixalien.muzika.Devel"
  ],
  "version": "nightly-67afe41",
  "uri": "library:playlists",
  "logged_in": true,
  "language": "English (US) - en"
}

AdrianVovk avatar Nov 13 '24 02:11 AdrianVovk

Thank you for reporting this. I’ve been running into it too. I’ll take a look asap

On Wed, 13 Nov 2024 at 04:45, Adrian Vovk @.***> wrote:

App doesn't seem to be able to load any content anymore. I deleted the app's data dir and recreated it to try and work around the problem, signed in again, but the problem still persists. Any page I try to open in the app leads to the same error message:

MuseError: Can't fetch data { "error": { "code": 400, "message": "Request contains an invalid argument.", "errors": [ { "message": "Request contains an invalid argument.", "domain": "global", "reason": "badRequest" } ], "status": "INVALID_ARGUMENT" } }

***@***.***:///com/vixalien/muzika/js/main.js:9737:5
***@***.***:///com/vixalien/muzika/js/main.js:11274:15
***@***.***:///com/vixalien/muzika/js/main.js:11282:26
***@***.***:///com/vixalien/muzika/js/main.js:11309:24
***@***.***:///com/vixalien/muzika/js/main.js:19286:12
***@***.***:///com/vixalien/muzika/js/main.js:24757:38
***@***.***:///com/vixalien/muzika/js/main.js:24787:17
***@***.***:///com/vixalien/muzika/js/main.js:24916:17
***@***.***:///com/vixalien/muzika/js/main.js:24897:16
***@***.***:///com/vixalien/muzika/js/main.js:32528:14
***@***.***:///org/gnome/gjs/modules/script/package.js:207:19
@file:///app/bin/com.vixalien.muzika.Devel:22:40
@file:///app/bin/com.vixalien.muzika.Devel:28:6

The app also logs the following to the terminal:

Gjs-Console-Message: 21:43:55.533: caching soup requests at /var/home/adrian/.var/app/com.vixalien.muzika.Devel/cache/com.vixalien.muzika.Devel/soup-cache MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:763: FINISHME: support YUV colorspace with DRM format modifiers MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:794: FINISHME: support more multi-planar formats with DRM modifiers

(com.vixalien.muzika.Devel:2): Gjs-Console-CRITICAL **: 21:43:56.236: Couldn't get logged in user

(com.vixalien.muzika.Devel:2): Gjs-WARNING : 21:43:56.238: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed @.@.**:///org/gnome/gjs/modules/script/package.js:207:19 @file:///app/bin/com.vixalien.muzika.Devel:22:40 @file:///app/bin/com.vixalien.muzika.Devel:28:6

Troubleshooting information:

{ "argv": [ "/app/bin/com.vixalien.muzika.Devel" ], "version": "nightly-67afe41", "uri": "library:playlists", "logged_in": true, "language": "English (US) - en" }

— Reply to this email directly, view it on GitHub https://github.com/vixalien/muzika/issues/217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJB5FCOTNN45WPM53GG3UOT2AK4MVAVCNFSM6AAAAABRVNIFLKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2TGOJVGQYTKNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vixalien avatar Nov 13 '24 08:11 vixalien

Same error here.

alvaroburns avatar Nov 13 '24 21:11 alvaroburns

This is due to a change on how YouTube handles authentication. Sadly, I don't know of any methods to use the new authentication scheme, but it seems they now use an Authorization Header with SAPISIDHASH hash instead of the older Bearer token.

Someone needs to reverse engineer this hash, but it's different from the old SAPISIDHASHs because the current ones all end with _u.

vixalien avatar Nov 14 '24 10:11 vixalien

Furthermore, YTM now requires you to be logged in before playing anything on iOS and Android, meaning our old method to play songs while not logged in won't work, i.e. unless we figure out how to decipher the streams YTM sends on browser (signatureCipher)

vixalien avatar Nov 14 '24 10:11 vixalien

I don't know if it's related bu spotify_to_ytmusic is using browser auth instead of oauth. Is this helpful?

https://github.com/sigma67/spotify_to_ytmusic/pull/117

dmnmsc avatar Nov 23 '24 22:11 dmnmsc

Same with youtui. They are switching to browser auth https://github.com/nick42d/youtui/commit/b206a8e5f4164559dde1472c7f7ec17df43eecbc

dmnmsc avatar Nov 24 '24 14:11 dmnmsc

is there any update on this?

yashoswalyo avatar Dec 30 '24 06:12 yashoswalyo

Monophony seems to work despite having no login, FWIW.

Henry-Hiles avatar Jan 03 '25 16:01 Henry-Hiles

is there any update on this?

is there any update on this?

I think vixalien has stopped maintaining. It would be great if someone could fork, as it doesn't look too hard: https://mas.to/@vixalientoots/113555145244776471

Henry-Hiles avatar Jan 03 '25 16:01 Henry-Hiles

very sad to see this go. I have some suggestions to chip in:

muse itself needs to work with browser cookie based auth, or a free/paid? google oauth app. https://github.com/sigma67/ytmusicapi (where muse was adapted from) has figured this out. I personally fixed part of muse's login problem here. now I'm stuck at fetching the streaming urls, as using constants_ng_js_1.default.{ANDROID/IOS}.DATA in get_song all returns an error 400, and constants_ng_js_1.default.DATA does not return the url itself but everything else - suggesting the auth tokens has to be put somewhere as well. its not hard work but im not incentivized to work on it either.

changing the backend is also an option - https://github.com/LuanRT/YouTube.js can still fetch without login.

lovegaoshi avatar Jan 06 '25 19:01 lovegaoshi

very sad to see this go. I have some suggestions to chip in:

muse itself needs to work with browser cookie based auth, or a free/paid? google oauth app. https://github.com/sigma67/ytmusicapi (where muse was adapted from) has figured this out. I personally fixed part of muse's login problem here. now I'm stuck at fetching the streaming urls, as using constants_ng_js_1.default.{ANDROID/IOS}.DATA in get_song all returns an error 400, and constants_ng_js_1.default.DATA does not return the url itself but everything else - suggesting the auth tokens has to be put somewhere as well. its not hard work but im not incentivized to work on it either.

changing the backend is also an option - https://github.com/LuanRT/YouTube.js can still fetch without login.

So, you fixed everything but the streaming itself? I wonder if yt-dlp could be used, all you'd need to do is supply the cookies.

Henry-Hiles avatar Feb 19 '25 19:02 Henry-Hiles

its not going to be drop in ready as ytdlp is python, and muse is js; but youtube.js is a drop in replacement, as this is how my app functions currently.

on the other hand, if someone do decide to put in the maintenance work for muse - thank you, I'm very interested in getting it to work.

On Wed, Feb 19, 2025, 11:31 AM Henry Hiles @.***> wrote:

very sad to see this go. I have some suggestions to chip in:

muse itself needs to work with browser cookie based auth, or a free/paid? google oauth app. https://github.com/sigma67/ytmusicapi (where muse was adapted from) has figured this out. I personally fixed part of muse's login problem here https://github.com/lovegaoshi/azusa-player-mobile/blob/9d96e839c41e0a819ce0fbb3d40dc3c68fdbc509/src/utils/muse.ts#L12. now I'm stuck at fetching the streaming urls, as using constants_ng_js_1.default.{ANDROID/IOS}.DATA in get_song all returns an error 400, and constants_ng_js_1.default.DATA does not return the url itself but everything else - suggesting the auth tokens has to be put somewhere as well https://github.com/sigma67/ytmusicapi/blob/3bd3da1bacc1894d1c55bdfd89e715e06434574b/ytmusicapi/ytmusic.py#L181. its not hard work but im not incentivized to work on it either.

changing the backend is also an option - https://github.com/LuanRT/YouTube.js can still fetch without login.

So, you fixed everything but the streaming itself? I wonder if yt-dlp could be used, all you'd need to do is supply the cookies.

— Reply to this email directly, view it on GitHub https://github.com/vixalien/muzika/issues/217#issuecomment-2669572954, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZMOVVW333CK6M6GWCNALLT2QTLYTAVCNFSM6AAAAABRVNIFLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGU3TEOJVGQ . You are receiving this because you commented.Message ID: @.***> [image: Henry-Hiles]Henry-Hiles left a comment (vixalien/muzika#217) https://github.com/vixalien/muzika/issues/217#issuecomment-2669572954

very sad to see this go. I have some suggestions to chip in:

muse itself needs to work with browser cookie based auth, or a free/paid? google oauth app. https://github.com/sigma67/ytmusicapi (where muse was adapted from) has figured this out. I personally fixed part of muse's login problem here https://github.com/lovegaoshi/azusa-player-mobile/blob/9d96e839c41e0a819ce0fbb3d40dc3c68fdbc509/src/utils/muse.ts#L12. now I'm stuck at fetching the streaming urls, as using constants_ng_js_1.default.{ANDROID/IOS}.DATA in get_song all returns an error 400, and constants_ng_js_1.default.DATA does not return the url itself but everything else - suggesting the auth tokens has to be put somewhere as well https://github.com/sigma67/ytmusicapi/blob/3bd3da1bacc1894d1c55bdfd89e715e06434574b/ytmusicapi/ytmusic.py#L181. its not hard work but im not incentivized to work on it either.

changing the backend is also an option - https://github.com/LuanRT/YouTube.js can still fetch without login.

So, you fixed everything but the streaming itself? I wonder if yt-dlp could be used, all you'd need to do is supply the cookies.

— Reply to this email directly, view it on GitHub https://github.com/vixalien/muzika/issues/217#issuecomment-2669572954, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZMOVVW333CK6M6GWCNALLT2QTLYTAVCNFSM6AAAAABRVNIFLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGU3TEOJVGQ . You are receiving this because you commented.Message ID: @.***>

lovegaoshi avatar Feb 19 '25 21:02 lovegaoshi

I have not abandoned this project yet, just very worked down. If someone knows something that does work, without using cookies, they can let me know and I'll try to copy the workings.

vixalien avatar Feb 20 '25 08:02 vixalien