Skip to content

Conversation

@gechoto
Copy link
Contributor

@gechoto gechoto commented Jan 5, 2025

Should fix #1748 #1781 #1775 #1770 #1758 #1764 #1760 #1757 #1787 #1788 #1790

This supersedes #1774 with additional improvements.

Compared to the previous PR this adds:

  • fixes for metadata (normalization works again)
  • support for premium formats (better audio quality for logged in users with a premium account)
  • a better client fallback system and streaming url status checks so playback is more likely to work
  • a fix to prevent using expired urls from songUrlCache

Current test build:
https://github.com/z-huang/InnerTune/actions/runs/13220889696/artifacts/2559580736

@gitguardian
Copy link

gitguardian bot commented Jan 5, 2025

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@gechoto
Copy link
Contributor Author

gechoto commented Jan 5, 2025

@z-huang can you have a look?
Many users are waiting for the next release because the latest one is broken.
Would be happy to get this done and get the app back up working again.

There is one last thing I'm not sure about. The http clients in NewPipeDownloaderImpl and YTPlayerUtils do not use the proxy yet. But I wonder if it is even worth keeping the proxy since YT usually blocks most datacenter IPs now.

What do you think? Should the proxy be removed?
If it will be kept how should it be used in NewPipeDownloaderImpl and YTPlayerUtils?

@gechoto gechoto mentioned this pull request Jan 5, 2025
4 tasks
@PSJahn
Copy link

PSJahn commented Jan 6, 2025

The crashing after logging in seems to be fixed in the latest commit build! (However, the youtube music webpage is opened after logging in successfully, it would maybe be better if it exited out of the login prompt automatically, after logging in successfully)
The second issue which I was facing, with the app closing itself if not connected to the internet also seems to be fixed for me!
Hope this gets merged soon!

EDIT: Playing songs, as well as downloading, also works of course!

@MLGHerobrine
Copy link

MLGHerobrine commented Jan 7, 2025

Works great! Only issue is increased startup time and decreased UI performance on a lower end device like mine (Cat S22 Flip).

It takes about 10-15 seconds for my phone to start it up, and then the UI renders slowly (5-10 FPS when scrolling)

@thornySoap
Copy link

It takes about 10-15 seconds for my phone to start it up, and then the UI renders slowly (5-10 FPS when scrolling)

@MLGHerobrine if you used the link to download the debug version, that is normal. I haven't tested but I assume that when building the release APK, performance should be as usual.

@gechoto
Copy link
Contributor Author

gechoto commented Jan 9, 2025

Proxy support is now also added. Turns out it wasn't hard because the proxy is only applied on app start. This means if you change the proxy settings you will have to fully close and restart the app. That was already the case before and just made adding the proxy to the new http clients easier.

@Figim
Copy link

Figim commented Jan 10, 2025

This video won't play or download when you sign in. I have selected "high" for audio quality and it shows mp4 in the details:

https://music.youtube.com/watch?v=wxHRqPtWHOU

Screenshot_20250110-131915_InnerTune Debug
Screenshot_20250110-131911_InnerTune Debug

@gechoto
Copy link
Contributor Author

gechoto commented Jan 10, 2025

This video won't play or download when you sign in.

@Figim Please follow these steps:

1.) Clear app data (full reset without restoring a backup)
2.) Try to play the song again (without login at this point) - LEAVE A COMMENT HERE IF IT WORKS
3.) Clear app data again (full reset without restoring a backup) - YES A SECOND TIME
4.) Login in within InnerTune
5.) Try to play the songs again - LEAVE A COMMENT HERE IF IT WORKS

I have selected "high" for audio quality and it shows mp4 in the details

This PR does not change anything about the code which chooses the format.

"high" in InnerTune just means the format with the highest bitrate (for you).
It has a slight preference for opus but only to some extent so you can still get other formats in some cases.

This could be improved in the future but for now you get the same formats as with older InnerTune versions.

@Figim
Copy link

Figim commented Jan 10, 2025

This video won't play or download when you sign in.

@Figim Please follow these steps:

1.) Clear app data (full reset without restoring a backup) 2.) Try to play the song again (without login at this point) - LEAVE A COMMENT HERE IF IT WORKS 3.) Clear app data again (full reset without restoring a backup) - YES A SECOND TIME 4.) Login in within InnerTune 5.) Try to play the songs again - LEAVE A COMMENT HERE IF IT WORKS

I have selected "high" for audio quality and it shows mp4 in the details

This PR does not change anything about the code which chooses the format.

"high" in InnerTune just means the format with the highest bitrate (for you). It has a slight preference for opus but only to some extent so you can still get other formats in some cases.

This could be improved in the future but for now you get the same formats as with older InnerTune versions.

2. Playing this video
5. This video not playing

@th3y
Copy link

th3y commented Feb 16, 2025

Btw @gechoto could you keep updating and add PoToken in this PR?

@gechoto
Copy link
Contributor Author

gechoto commented Feb 16, 2025

Btw @gechoto could you keep updating and add PoToken in this PR?

I don't know yet since this is possibly going nowhere.

For now I focus on OuterTune first because it is an active project where more people can enjoy the fixes.

@th3y
Copy link

th3y commented Feb 16, 2025

Btw @gechoto could you keep updating and add PoToken in this PR?

I don't know yet since this is possibly going nowhere.

For now I focus on OuterTune first because it is an active project where more people can enjoy the fixes.

Thanks in advance, im trying to get it work in a private build from other project, but without success.
Edit: i get it working

@MLGHerobrine
Copy link

For now I focus on OuterTune first because it is an active project where more people can enjoy the fixes.

Should I switch to OuterTune then? I wasn't using it because of differences in the UI, and trouble with my imported playlists (from InnerTune) but I could get used to the UI.

@ecomaikgolf
Copy link

For now I focus on OuterTune first because it is an active project where more people can enjoy the fixes.

Should I switch to OuterTune then? I wasn't using it because of differences in the UI, and trouble with my imported playlists (from InnerTune) but I could get used to the UI.

I switched and imported my InnerTune. There are differences such as the caching system (AFAIK) which I don't completely like but at least it works.

@kevin970712
Copy link

For now I focus on OuterTune first because it is an active project where more people can enjoy the fixes.

Should I switch to OuterTune then? I wasn't using it because of differences in the UI, and trouble with my imported playlists (from InnerTune) but I could get used to the UI.

I switched and imported my InnerTune. There are differences such as the caching system (AFAIK) which I don't completely like but at least it works.

If you are used to using innertune,I recommend this link, it fixes the player issues and is no different than the original
https://github.com/MZaFaRM/InnerTune/releases/tag/v5.10.1

@Figim
Copy link

Figim commented Feb 26, 2025

For now I focus on OuterTune first because it is an active project where more people can enjoy the fixes.

Should I switch to OuterTune then? I wasn't using it because of differences in the UI, and trouble with my imported playlists (from InnerTune) but I could get used to the UI.

I switched and imported my InnerTune. There are differences such as the caching system (AFAIK) which I don't completely like but at least it works.

If you are used to using innertune,I recommend this link, it fixes the player issues and is no different than the original https://github.com/MZaFaRM/InnerTune/releases/tag/v5.10.1

There should be Potoken support to fix the unknown error or bot error. But it doesn't support innertune yet. Yours is a temporary fix

@Vigneshputti
Copy link

While playing music is stooping

@Figim
Copy link

Figim commented Feb 27, 2025

While playing music is stooping

PoToken support is needed. Don't worry.

@hasanelfalakiy
Copy link

I tried this debug app but still can't play music

@gechoto
Copy link
Contributor Author

gechoto commented Mar 9, 2025

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.

However I have contributed all of this and PO token support to OuterTune.
If you want to give it a try:
https://github.com/OuterTune/OuterTune

@hasanelfalakiy
Copy link

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.

However I have contributed all of this and PO token support to OuterTune.
If you want to give it a try:
https://github.com/OuterTune/OuterTune

I've try outertune, but why result of search song not much many like innertune and the seekbar doesn't have any wavy options like innertune

@rcky844
Copy link

rcky844 commented Mar 11, 2025

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.
However I have contributed all of this and PO token support to OuterTune.
If you want to give it a try:
https://github.com/OuterTune/OuterTune

I've try outertune, but why result of search song not much many like innertune and the seekbar doesn't have any wavy options like innertune

I have created an unofficial release build of InnerTube over at a comment on a discussion, which also includes some of my own changes and enables support down to Android 5.0, with fixes for Discord RPC.

@hasanelfalakiy
Copy link

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.
However I have contributed all of this and PO token support to OuterTune.
If you want to give it a try:
https://github.com/OuterTune/OuterTune

I've try outertune, but why result of search song not much many like innertune and the seekbar doesn't have any wavy options like innertune

I have created an unofficial release build of InnerTube over at a comment on a discussion, which also includes some of my own changes and enables support down to Android 5.0, with fixes for Discord RPC.

thank you, I'll try it

@hasanelfalakiy
Copy link

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.
However I have contributed all of this and PO token support to OuterTune.
If you want to give it a try:
https://github.com/OuterTune/OuterTune

I've try outertune, but why result of search song not much many like innertune and the seekbar doesn't have any wavy options like innertune

I have created an unofficial release build of InnerTube over at a comment on a discussion, which also includes some of my own changes and enables support down to Android 5.0, with fixes for Discord RPC.

because the signature is different, I can't install it, if I delete the old application the downloaded songs will be lost While some of these songs are no longer available on the music server, is there a way I can save these songs to the internal memory folder?

@rcky844
Copy link

rcky844 commented Mar 12, 2025

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.
However I have contributed all of this and PO token support to OuterTune.
If you want to give it a try:
https://github.com/OuterTune/OuterTune

I've try outertune, but why result of search song not much many like innertune and the seekbar doesn't have any wavy options like innertune

I have created an unofficial release build of InnerTube over at a comment on a discussion, which also includes some of my own changes and enables support down to Android 5.0, with fixes for Discord RPC.

because the signature is different, I can't install it, if I delete the old application the downloaded songs will be lost While some of these songs are no longer available on the music server, is there a way I can save these songs to the internal memory folder?

Use the backup & restore feature.

@rcky844
Copy link

rcky844 commented Mar 12, 2025

I tried this debug app but still can't play music

This PR is still missing PO token support and I have paused working on it because InnerTune is not actively maintained currently.

However I have contributed all of this and PO token support to OuterTune. If you want to give it a try: https://github.com/OuterTune/OuterTune

Perhaps it is just a case of cherry-picking? I have ported the relevant changes from OuterTune and added it to my own "vanilla" fork of InnerTune.

rcky844@cdd41ec
rcky844@c433098
rcky844@3e20fba
rcky844@14d439f

Please check whether this would be enough, since no test suite had been written in OuterTune.

@Rokiu Rokiu mentioned this pull request Mar 13, 2025
4 tasks
This was referenced Mar 20, 2025
@rcky844
Copy link

rcky844 commented Mar 25, 2025

It appears this patch series may no longer fix playing completely.

@josprox
Copy link

josprox commented Mar 25, 2025

Hello @rcky844 and @gechoto,

I'm not sure if this is an error on my side or a general issue, but lately, the PoToken method has been throwing errors in my Firebase console, indicating that www.youtube.com is not responding to requests.

Additionally, I’ve encountered an issue that is starting to affect some users: whenever any song is played, the audio stream stops after a few seconds.

For this reason, I decided to remove PoToken support from Joss Music. Reverting to the previous implementation (using YouTube API V1 and Newpipe) resolves these problems.

I’m sharing this message as a warning about these potential issues, especially since your requests are already available in Outertune.

The most affected devices are those running Android 13 or low-end smartphones.

Best regards!

@Figim
Copy link

Figim commented Mar 25, 2025

Hello @rcky844 and @gechoto,

I'm not sure if this is an error on my side or a general issue, but lately, the PoToken method has been throwing errors in my Firebase console, indicating that www.youtube.com is not responding to requests.

Additionally, I’ve encountered an issue that is starting to affect some users: whenever any song is played, the audio stream stops after a few seconds.

For this reason, I decided to remove PoToken support from Joss Music. Reverting to the previous implementation (using YouTube API V1 and Newpipe) resolves these problems.

I’m sharing this message as a warning about these potential issues, especially since your requests are already available in Outertune.

The most affected devices are those running Android 13 or low-end smartphones.

Best regards!

**Potoken is created in two ways. Potoken created with cookies is different. Potoken created without cookies cannot be used with cookies, Visitordata and DATASYNC ID are not required. It is like this: Visitordata+Potoken (when not logged in), Cookies+Potoken(when logged in). Cookies only work with web_remix and web_music client. Innertube does not support Potoken. Outertune supports it and there is no problem when not logged in. (There was an error while logging in recently. This must be due to Visitordata. It will probably be fixed.) Potoken is required by yt. You should keep the "android system webview" application updated.

@josprox
Copy link

josprox commented Mar 25, 2025

Hello @Figim , thank you so much for your detailed explanation!

This really helps us better understand how PoToken works and the differences when using it with or without cookies.

We'll adapt PoToken in Joss Music based on this information to avoid issues and improve compatibility.

Thanks again for your support!

@Figim
Copy link

Figim commented Mar 25, 2025

Hello @Figim , thank you so much for your detailed explanation!

This really helps us better understand how PoToken works and the differences when using it with or without cookies.

We'll adapt PoToken in Joss Music based on this information to avoid issues and improve compatibility.

Thanks again for your support!

For cookies, use music.youtube instead of youtube.com. I forgot that.

@gechoto
Copy link
Contributor Author

gechoto commented Mar 25, 2025

It appears this patch series may no longer fix playing completely.

@rcky844 This is caused by:

NewPipeExtractor fails to find the deobfuscation function:
TeamNewPipe/NewPipeExtractor#1287

(also affects others like OuterTune: OuterTune/OuterTune#464)

Missing PO Token support

@rcky844
Copy link

rcky844 commented Mar 25, 2025

It appears this patch series may no longer fix playing completely.

@rcky844 This is caused by:

NewPipeExtractor fails to find the deobfuscation function: TeamNewPipe/NewPipeExtractor#1287

(also affects others like OuterTune: OuterTune/OuterTune#464)

Missing PO Token support

The second one has been solved in my own fork, so it should primarily be the first issue.

One quick and dirty workaround involves using the pre-existing session from another device, even Android emulator may work, and transfer its backup to the target device.

Edit: My PoToken support addition seems to work fine, I just needed to clear data and music starts playing without logging in. I will wait for someone to implement the patch at OuterTune as I am busy atm.

Edit 2: My patch series of PoToken ported from OuterTune: https://github.com/rcky844/InnerTune/commits/dev/
If @gechoto wants to add it in this PR then run git fetch https://github.com/rcky844/InnerTune; git cherry-pick cdd41ec^..5853a78 c40d7e7 0a3891f.

@gechoto
Copy link
Contributor Author

gechoto commented Mar 25, 2025

One quick and dirty workaround involves using the pre-existing session from another device

This will not fix the NewPipeExtractor issue

If your problem is caused by the session you might be missing this visitor data extraction fix:
OuterTune/OuterTune#434

Edit: My PoToken support addition seems to work fine, I just needed to clear data and music starts playing without logging in.

Would be interesting to see which client is used for playback. Can you share logs?

Edit 2: My patch series of PoToken ported from OuterTune: https://github.com/rcky844/InnerTune/commits/dev/
If @gechoto wants to add it in this PR then run git fetch https://github.com/rcky844/InnerTune; git cherry-pick cdd41ec^..5853a78 c40d7e7 0a3891f.

Thanks for the offer but I do not plan to add more to this PR for now since the project is inactive anyway.

There are other things missing as well (like the visitor data extraction and continuation fixes) but I don't want to waste my time on an inactive project.


Edit:
In case you added brand account support to your fork you might be interested in this fix: OuterTune/OuterTune#466

@rcky844
Copy link

rcky844 commented Mar 26, 2025

One quick and dirty workaround involves using the pre-existing session from another device

This will not fix the NewPipeExtractor issue

If your problem is caused by the session you might be missing this visitor data extraction fix: OuterTune/OuterTune#434

Edit: My PoToken support addition seems to work fine, I just needed to clear data and music starts playing without logging in.

Would be interesting to see which client is used for playback. Can you share logs?

Edit 2: My patch series of PoToken ported from OuterTune: https://github.com/rcky844/InnerTune/commits/dev/
If @gechoto wants to add it in this PR then run git fetch https://github.com/rcky844/InnerTune; git cherry-pick cdd41ec^..5853a78 c40d7e7 0a3891f.

Thanks for the offer but I do not plan to add more to this PR for now since the project is inactive anyway.

There are other things missing as well (like the visitor data extraction and continuation fixes) but I don't want to waste my time on an inactive project.

Edit: In case you added brand account support to your fork you might be interested in this fix: OuterTune/OuterTune#466

I still believe the inactivity of this project will be resolved by this summer, as it seems like the project owner is away preparing for TSMC or something. We all know how hectic this could be.

Anyways, it's your all to not incorporate these changes. I have added PoToken support and fixed continuation (partially, I suspect OuterTune still has this broken). I think it is important to leave a base with the original project's feature set for other projects to branch out from.

@Manasilayi
Copy link

Hyy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to play songs in the app