25huizengek1 / ViTune

An Android application for seamless music streaming
https://vitune.app
GNU General Public License v3.0
520 stars 34 forks source link

Couldn't find a playable Audio format #499

Open genericbetatester opened 1 month ago

genericbetatester commented 1 month ago

Steps to reproduce the bug

  1. Play an uncached song in my library

Expected behavior

It should play as normal

Actual behavior

It doesn't. It just says it cannot find a playable Audio format

Screenshots/Screen recordings

Screenshot_20241023-191108

Logs

No response

ViTune version

v1.1.0

What kind of build are you using?

Release (GitHub / F-Droid)

Android version

Android 10

Device info

I'm using a

Upstream reproducibility

No response

Additional information

No response

Checklist

25huizengek1 commented 1 month ago

Just woke up, and before I went to sleep this still worked, now it seems YouTube Music forces users to log in when on mobile. The only working FOSS YouTube player that still works seems to be NewPipe, since they don't use YouTube Music, but just the YouTube endpoints.

I'll work on this later on.

genericbetatester commented 1 month ago

Just woke up, and before I went to sleep this still worked, now it seems YouTube Music forces users to log in when on mobile. The only working FOSS YouTube player that still works seems to be NewPipe, since they don't use YouTube Music, but just the YouTube endpoints.

I'll work on this later on.

That's crazy. Yt always find ways to break one thing or the other.

25huizengek1 commented 1 month ago

YouTube seems to have implemented a new anti-bot system, looking for a workaround...

genericbetatester commented 1 month ago

YouTube seems to have implemented a new anti-bot system, looking for a workaround...

👀 Hmm

25huizengek1 commented 1 month ago

I've seen a lot of people reply that Piped is down. Just to be clear: Piped (or the Piped instance ViTune uses) is definitely not down (and it shouldn't even matter, we only use Piped as a back-up for when YouTube blocks requests), but they are experiencing the exact same issue as ViTune:

25huizengek1 commented 1 month ago

Haven't had the time yet to actually work on this, I'm sorry. I'll update y'all ASAP.

Wqttzicue commented 1 month ago

Haven't had the time yet to actually work on this, I'm sorry. I'll update y'all ASAP.

You diffenetly need helpers, at least 1 more dev Btw, im interested in programming, but im not enough computer-nerd

th3y commented 1 month ago

Haven't had the time yet to actually work on this, I'm sorry. I'll update y'all ASAP.

There are two ways to fix the current issue 1- Use g00gle acc c00kies 2- Use piped /streams/

25huizengek1 commented 1 month ago

Haven't had the time yet to actually work on this, I'm sorry. I'll update y'all ASAP.

There are two ways to fix the current issue 1- Use g00gle acc c00kies 2- Use piped /streams/

Both won't work, here's why:

MimirHim commented 1 month ago

Are we cooked?

25huizengek1 commented 1 month ago

Maybe. I'm looking into implementing this like NewPipe does; by using an entire JavaScript engine to make it work. Expect it to perform poor on low/medium-end devices. Might as well just import NewPipeExtractor at this point.

gechoto commented 1 month ago

Might as well just import NewPipeExtractor at this point.

Even that is not a guaranteed fix. NewPipe works unreliably for me lately. Often videos just don't play. Others have the same issue, see: https://github.com/TeamNewPipe/NewPipe/issues/11139

In my experience the only things that currently work are: 1.) Actually log in (no problems since I did in InnerTune) 2.) Use a real browser (I always use this as a workaround when NewPipe refuses to work)

th3y commented 1 month ago

Haven't had the time yet to actually work on this, I'm sorry. I'll update y'all ASAP.

There are two ways to fix the current issue 1- Use g00gle acc c00kies 2- Use piped /streams/

Both won't work, here's why:

  • ViTune already uses Piped as a backup mechanism for when calling YouTube Music directly doesn't work, and they are having the same issues as ViTune does
  • Google started enforcing a JavaScript challenge on all platforms other than iOS, so it seems like we have to impersonate iOS in order to make this work. NewPipe has been doing that for a while now
  • Even when logged in, the JavaScript challenge is still mandatory. See for yourself: open your devtools in your browser when starting a random song on music.youtube.com. The player request doesn't return stream urls anymore.

Google account actually work, i did a minimal change and it works now. But videos that need confirmation are not working. Other apps that use the same system are working if you logged in. Also, some windows apps are not working too unless you log in

gechoto commented 1 month ago

yt-dlp added a po_token: https://github.com/yt-dlp/yt-dlp/pull/10648

Seems it needs to be "generated in a browser" so it still needs a js engine (or maybe it works in a in-app webview?) but maybe only once per session and not for every song? Idk how it works - haven't had time to really look into it not sure how much it helps in the case of ViTune but might be something to look into

25huizengek1 commented 1 month ago

Might as well just import NewPipeExtractor at this point.

Even that is not a guaranteed fix. NewPipe works unreliably for me lately. Often videos just don't play. Others have the same issue, see: TeamNewPipe/NewPipe#11139

In my experience the only things that currently work are: 1.) Actually log in (no problems since I did in InnerTune) 2.) Use a real browser (I always use this as a workaround when NewPipe refuses to work)

That is true. I just used NewPipe and it seems like it only works some of the time. Age-restricted video's are not working anymore though. I was trying to implement this mechanism they are using, but no wonder it doesn't work: YouTube just doesn't allow this anymore

Adding login to ViTune will also work unreliably, I believe. I cannot get it to work in any FOSS YTM app (Innertune included) I saw @toasterofbread came up with a fix (the same as I intended to implement, the impersonation of an iOS client, which I'm going to work on tomorrow, I'm going to sleep now). We'll just have to pray that YouTube doesn't block this client in the future, as it's the only thing that keeps FOSS YTM clients alive right now (theoretically the JavaScript challenge can be implemented, but since the challenges automatically get generated, I don't think it would work reliably).

I don't think Google will add such a challenge to iOS though, I guess it isn't allowed on the App Store.

Driftinginfinitely commented 1 month ago

Don't if this is helpful but just wanted to mention here that the only music app that I am still able to use is Harmony Music. Someone suggested it on Reddit and I checked, and it's surprisingly playing music. Not sure but wondering if it would be of interest to see how that app works.

25huizengek1 commented 1 month ago

https://support.google.com/youtube/thread/269521462/enforcement-on-third-party-apps?hl=en

I guess this finally hit us like it's nothing. 😔

MimirHim commented 1 month ago

https://support.google.com/youtube/thread/269521462/enforcement-on-third-party-apps?hl=en

I guess this finally hit us like it's nothing. 😔

That can't be we weren't affected in April ? There has to be way

25huizengek1 commented 1 month ago

@Driftinginfinitely They use a port of YouTube Explode, which takes a similar approach to NewPipeExtractor.

I think we can conclude nobody really has a proper workaround for this yet. I even tried the patch SpMp implemented, but not a lot of success. Even when I do find a URL to stream audio from, YouTube still enforces logging in. In some cases, YouTube doesn't even respond with anything at all. Really hard to investigate overall. YouTube has safety guards (not really though; I'd call it security by obscurity) for everything, they even validate basic client metadata.

Now I'm actually going to sleep 😂 I'll see tomorrow if this can be fixed reliably. I guess having a lot of fallbacks (iOS client, Android web client, Desktop web client, etc.) should work, at least in theory.

NXTler commented 1 month ago

So, that's it?

25huizengek1 commented 1 month ago

https://support.google.com/youtube/thread/269521462/enforcement-on-third-party-apps?hl=en I guess this finally hit us like it's nothing. 😔

That can't be we weren't affected in April ? There has to be way

It depends on the implementation. Invidious has been experiencing issues for way longer: https://github.com/iv-org/invidious/issues/4734

25huizengek1 commented 1 month ago

Great news! Have been trying different IOS player versions, and it seems to be working fine as of right now. I'll have to clean up after the mess I just created in my local working copy, but I'll release the fix ASAP.

P4r73x3 commented 1 month ago

I wish the fix is released asap...

25huizengek1 commented 1 month ago

Hi everyone, I committed an experimental fix ==> 504b6f717b6b3bef8e71e7ff976a0a2fed4c4e0d

Normally I would test a lot more, then release, but I'll release anyway, it's better than nothing. For more information, read the commit message.

I'll keep this issue open even after the release, just so we can test a bit more before calling it 'fixed'. I added a lot more logging to the entire stream fetching process, so debugging this became a lot easier. Feel free to post your logs in here.

Mexiater commented 1 month ago

@25huizengek1 soooo how do we make it work with the current release? Are you gonna make a new one soon?

Ayusha94751 commented 1 month ago

Sir, I tried installing the app but only source code is available for version 1.1.1

25huizengek1 commented 1 month ago

@Mexiater @Ayusha94751 I hadn't released the new version yet. You should be able to update your app in F-Droid / from GitHub releases now.

(F-Droid broke on me because of the AGP upgrade, so I literally had to debug Python in the meantime, see https://github.com/androguard/androguard/issues/1014 if you're interested, I guess I should PR to fdroidserver or smth 😂 )

Mexiater commented 1 month ago

thank you!

Ayusha94751 commented 1 month ago

I also want to learn how to do Android Developement like you. Could you suggest me the resources for it?

Wqttzicue commented 1 month ago

Too much computernerding things for me T-T

genericbetatester commented 1 month ago

Good job! everyone, it now works!

Ayusha94751 commented 1 month ago

Oh! It works so smoothly. And this fluffy pip mode is insane. I can play ping pong with it all day long LOL.

Ayusha94751 commented 1 month ago

You know what, I got this error once again Screenshot_20241025-175522 Screenshot_20241025-175631

Ayusha94751 commented 1 month ago

You know what, I got this error once again Screenshot_20241025-175522 Screenshot_20241025-175631

But now it worked after searching the same song again.

25huizengek1 commented 1 month ago

That song works for me, maybe it got blocked in your region/you need to sign in. I'll work on a login system later on. (As I said earlier, some songs still won't work due to regional/age restrictions)

Ayusha94751 commented 1 month ago

Nah, it's alright. Lemme be clear:

  1. When I tried to play the song from favourites after importing my data from Vimusic, it doesn't play and shows that error.
  2. When I searched the song from the app and then played it, it played normally.

By the way, the song in the 2nd step I mentioned was not set as favourite. So I think that these songs had a different IDs despite being the same song.

25huizengek1 commented 1 month ago

I guess the song actually got deleted from YouTube Music and got re-released. That stuff happens every now and again, I don't know why.

DaniloPedrazzi commented 1 month ago

I just wanna thank the dev for the quick fix, appreciate that, thank you!!!

pseudoparenchymatous commented 1 month ago

Is this to be expected? No thumbnails

Screenshot_2024-10-26-11-12-42-974_app vitune android-edit

Screenshot_2024-10-26-11-12-25-441_app vitune android-edit

Ayusha94751 commented 1 month ago

It works for me. I can see all of the thumbnails and it plays nicely. Maybe you can try to change the DNS settings or somethin'.

kjay23 commented 1 month ago

So far everything works pretty well on the latest release 🤷‍♂️

Metgus commented 1 month ago

I am writing through a translator so if something is not clear, all questions to the translator. As you know, there are already problems with YouTube in Russia and I am afraid that even if a solution to the problem is found, it will not work in Russia.

Wqttzicue commented 1 month ago

I am writing through a translator so if something is not clear, all questions to the translator. As you know, there are already problems with YouTube in Russia and I am afraid that even if a solution to the problem is found, it will not work in Russia.

Вообще, от провайдера и ВПН зависит, но да, если твой провайдер послушный, то вероятно ViTune не будет работать.

25huizengek1 commented 4 weeks ago

I am writing through a translator so if something is not clear, all questions to the translator. As you know, there are already problems with YouTube in Russia and I am afraid that even if a solution to the problem is found, it will not work in Russia.

@Metgus YouTube is not available in Russia, I'm sorry. (Or as YouTube describes themselves: temporarily unavailable)