z-huang / InnerTune

A Material 3 YouTube Music client for Android
GNU General Public License v3.0
4.51k stars 278 forks source link

YT Music Official blocks non-login user's music play aggressively #1653

Open CanglanXYA opened 1 week ago

CanglanXYA commented 1 week ago

Checklist

Steps to reproduce the bug

  1. Open a new music
  2. "Please sign in"

Expected behavior

Play music in anonymous mode.

PS: Change the local identity when YT blocks you (to try to evade ban) or guide user to login page automatically

Actual behavior

YT block you

Screenshots/Screen recordings

e5c033c4-9d65-487d-b148-15aba766183c

Logs

no

InnerTune version

0.5.10

Android version

Android 14

Additional information

Thats not an IP based ban, I changed my ip to different locations but the ban is persisting.

stephnradd commented 1 week ago

I had this problem too. This problem just appeared a few hours ago imo

Aji-prakoso commented 1 week ago

Same problem

celengbalap commented 1 week ago

they're blocking legit browser access too btw, i guess it's time to abandon this terrible spyware company products. it was fun while it lasted, bye2 youtube/music.

pigeonmal commented 1 week ago

I have tested multiple requests, if not visitorData proivided that reject. Some Times, there IS visitorData that work, and some other visitorData that don't work. I speak about Android music requests. But maybe for solve this issue, do requests with tv or browser music client, i have noticed if not visitorData that don't reject the request

blacklizzt commented 1 week ago

they're blocking legit browser access too btw, i guess it's time to abandon this terrible spyware company products. it was fun while it lasted, bye2 youtube/music.

i'm sure there's a way around this since rimusic had this issue, let's not lose hope

Vasco10 commented 1 week ago

For over a week, I've been listening to music. Now, every time I want to listen to any music, I get the same: 'Please sign in'

rayn000 commented 1 week ago

Yup! I'm also facing the same problem

in-plaintext commented 1 week ago

Newpipe (and its forks) function at the time of writing (use the background player to stream only audio).

azgaresncf commented 5 days ago

They're just banning sessions (visitorData) imo, because if we delete the db from the app's data, it works totally well (for me personally).

eu-kode commented 2 days ago

Having the same exact issue Screenshot_20241024_221555_Gallery.jpg

ben2talk commented 1 day ago

This is upsetting. Tried a couple alternatives, and just one working at the moment - ViTune (forked from ViMusic)

z-huang commented 1 day ago

Can someone investigate on this commit and make a PR? https://github.com/25huizengek1/ViTune/commit/504b6f717b6b3bef8e71e7ff976a0a2fed4c4e0d Sorry, I'm busy these days.

BluePixel4k commented 1 day ago

Can someone investigate on this commit and make a PR? 25huizengek1/ViTune@504b6f7 Sorry, I'm busy these days.

Maybe @Malopieds could help? 😇

Malopieds commented 1 day ago

Maybe @Malopieds could help? 😇

I was looking for something yesterday, I'll have a look into this later on today, and PR if I found something.

techy2245 commented 1 day ago

Will this issue be fixed soon cause rimusic, vi tune, harmony music and my favorite Inner tune isn't working 😢

ihaadi commented 1 day ago

I hope the developer of InnerTune is doing well, as they haven't been active on GitHub since last month. Wishing them all the best, and hoping everything is okay.

techy2245 commented 1 day ago

issue now is I can't play songs even though I have signed showing some Java error Screenshot_2024_1025_230625.jpg

Malopieds commented 1 day ago

Setting it to IOS player is enough to make it work (maybe not for long). The commit linked before is also trying to implement a way to make it work without using IOS agent, in the same way as youtube is doing it, but is still buggy. I'm trying to find a workaround but I won't be able to PR before tomorrow at least.

const val USER_AGENT_IOS = "com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X;)"
val IOS =
  YouTubeClient(
     clientName = "IOS",
     clientVersion = "19.29.1",
     api_key = "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc",
     userAgent = USER_AGENT_IOS,
  )

This should be enough, by replacing the old call from the player in YouTube.kt (from ANDROID_MUSIC to IOS) I will try to get the other way working tomorrow. But they can easily replace it anytime now. @z-huang

pigeonmal commented 1 day ago

Why not use basic web remix client and do decipher ?

thetalkingsquirrel commented 1 day ago

They're just banning sessions (visitorData) imo, because if we delete the db from the app's data, it works totally well (for me personally).

you deleted the data/cache or a db at the app folder?

Malopieds commented 1 day ago

Why not use basic web remix client and do decipher ?

That's what I'm planning in the end, but do you know how to decipher? They're curently using some obfuscated js, I think I got most of it, but I'll need more time. Furthermore I'm missing a parameter called cpn, so I need to know where get that from.

pigeonmal commented 1 day ago

Why not use basic web remix client and do decipher ?

That's what I'm planning in the end, but do you know how to decipher? They're curently using some obfuscated js, I think I got most of it, but I'll need more time. Furthermore I'm missing a parameter called cpn, so I need to know where get that from.

Yes I have created my own music app for mobile, but I use innertune for my tablet. Check youtube.js source code they have down very usefull decipher code. An other usefull code IS ytdl core but not work any more, you must change the regex for 'n', because youtube changed their code : they do .slice(0,0). I Can send you my personal code, but it's in typescript not kotlin (my app is in react native)

For "cpn" it's not mandatorry, it's for send After playback stats. It's usefull if you have a unique visitorData of the user. Youtube music will update their home page, with New recommandations, because you send playback stats request (like you watched the song)

Sorry for my Bad english, i'm french

z-huang commented 1 day ago

@Malopieds Thanks for the quick fix! I've committed the change. It will be grateful for other people to double-check.

Why not use basic web remix client and do decipher ?

Running js in JVM is noticeably slow. In fact, the very old version of InnerTune uses a JavaScript Emulator to do decipher. This will be the last step if no other viable methods are found.

pigeonmal commented 1 day ago

You have right, it will be very slow. So if the problem IS from visitorData, why can't create session and save locally the generate visitorData ?The Android client for player will be not rejected. Maybe thinks about that if they block on iOS client too. In my last tests, they have also blocked tv client

Malopieds commented 1 day ago

I Can send you my personal code, but it's in typescript not kotlin (my app is in react native)

In your code do you decipher or call a js script from youtube? If decipher yourself I could maybe use some of that.

For "cpn" it's not mandatorry, it's for send After playback stats. It's usefull if you have a unique visitorData of the user. Youtube music will update their home page, with New recommandations, because you send playback stats request (like you watched the song)

I see, but when not sending cpn the cipher does not look the same...

@Malopieds Thanks for the quick fix

No problem!

Running js in JVM is noticeably slow. In fact, the very old version of InnerTune uses a JavaScript Emulator to do decipher. This will be the last step if no other viable methods are found.

I also agree.

z-huang commented 16 hours ago

So if the problem IS from visitorData, why can't create session and save locally the generate visitorData ?The Android client for player will be not rejected.

The problem doesn't seem to be visitorData, since I create different visitorData for each user. https://github.com/z-huang/InnerTune/blob/dev/app/src/main/java/com/zionhuang/music/App.kt#L79:L92

ShaKabosh commented 12 hours ago

@z-huang Is there a working workaround yet? If so, do you know when it will be incorporated into a release? Thank you for your time and effort!

z-huang commented 12 hours ago

Yes, you can try out the latest build. If there's no other issue from this fix, I will release a new version as soon as possible.