Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player fixes #1789

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open

Player fixes #1789

wants to merge 24 commits into from

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/12826161103/artifacts/2445847661

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.

@mikooomich mikooomich mentioned this pull request Jan 8, 2025
8 tasks
@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

@KEVIN970712
Copy link

Hello everyone,

This message is a reminder for those using the debug version of InnerTune with the NewPipe Extractor. You may experience some delay because your build is not a Full Release. For optimal performance, you should compile the Full Release version, which will resolve any performance issues.

You can find the Pull Request for the version proposed by @gechoto at the following link: https://github.com/z-huang/InnerTune/tree/930cc4c8faeec0a84a88f677c8475c2fe0c03685

Please note that when compiling, you will need to sign the application with your own key. This means you won’t be able to update the InnerTune app as usual. You’ll need to uninstall the previous version and install your newly compiled build.

wait a minute......
I don't know much about Android development, what does this mean and what should I do?

@josprox
Copy link

josprox commented Jan 14, 2025

wait a minute...... I don't know much about Android development, what does this mean and what should I do?

Hello @KEVIN970712,

This might not be the best place to explain how to do this, as the discussion here is specifically about the solution to the issue addressed by the Pull Request. If you want to learn how to do it, you can check out the ticket "[SOLUTION] Unknown error / Song not playing / Youtube API broken #1792", where they explain how to install Android Studio and compile your own version. Although the guide is not very detailed, it’s a good starting point.

The community has opened many tickets regarding this bug, making it difficult to go through all of them to find a solution. However, I believe the ticket that has discussed this issue the most is "Unable to play songs in the app #1748". There, you’ll find valuable information, such as an analysis of why YouTube’s API on Android no longer accepts login parameters. Additionally, @gechoto has shared some debug versions for testing in that thread.

I hope this information helps.

@KananHasanov747
Copy link

Why doesn't the developer merge pull requests? There are some from the previous year.

@Figim
Copy link

Figim commented Jan 14, 2025

Why doesn't the developer merge pull requests? There are some from the previous year.

Because he's busy.

@KananHasanov747
Copy link

Found a bug in debug-foss artifact (Idk if it's still persistent in the other one, or even in the official releases). If you use % sign in the search bar, it crashes the app.

video_2025-01-15_14-39-11.mp4

@ecomaikgolf
Copy link

Found a bug in debug-foss artifact (Idk if it's still persistent in the other one, or even in the official releases). If you use % sign in the search bar, it crashes the app.

Can confirm it happens in the debug-foss and latest release. As it happens on latest release and not in this merge CI apk, I would suggest creating a separate issue.

@KananHasanov747
Copy link

KananHasanov747 commented Jan 15, 2025

Found a bug in debug-foss artifact (Idk if it's still persistent in the other one, or even in the official releases). If you use % sign in the search bar, it crashes the app.

Can confirm it happens in the debug-foss and latest release. As it happens on latest release and not in this merge CI apk, I would suggest creating a separate issue.

In order to create a separate issue I have to use adb logcat, which requires to download the android studio, which I don't want to.

@th3y
Copy link

th3y commented Jan 15, 2025

Broken Today: got Response code: 403 while playing AgeRestricted Content (It was working before).

@KananHasanov747
Copy link

Broken Today: got Response code: 403 while playing AgeRestricted Content (It was working before).

Can confirm, I couldn't listen to the songs (not age-restricted ones) while riding on train. It gives error after 30 seconds of listening.

@gechoto
Copy link
Contributor Author

gechoto commented Jan 17, 2025

Found a bug in debug-foss artifact (Idk if it's still persistent in the other one, or even in the official releases). If you use % sign in the search bar, it crashes the app.

This is unrelated to this PR. Open a separate issue.

In order to create a separate issue I have to use adb logcat

You can open an issue without logs in this case since it seems that...

Can confirm it happens in the debug-foss and latest release.

...other people can reproduce it.

which requires to download the android studio

you don't need that - adb works perfectly fine without android studio

@gechoto
Copy link
Contributor Author

gechoto commented Jan 17, 2025

Broken Today: got Response code: 403 while playing AgeRestricted Content (It was working before).

@th3y Do you have a chance to attach a debugger and look at the response of the player request with the WEB_CREATOR client?

Can confirm, I couldn't listen to the songs (not age-restricted ones) while riding on train. It gives error after 30 seconds of listening.

@KananHasanov747 The "while riding on train" part might be the issue. Sometimes even official clients refuse to work when on public wifi or mobile network.

If you aren't already you can try logging in.

If you are using mobile network you can try to enable/disable airplane mode and restart the app (make sure it is fully stopped and not running in background anymore before starting again).

@th3y
Copy link

th3y commented Jan 17, 2025

Broken Today: got Response code: 403 while playing AgeRestricted Content (It was working before).

@th3y Do you have a chance to attach a debugger and look at the response of the player request with the WEB_CREATOR client?

Can confirm, I couldn't listen to the songs (not age-restricted ones) while riding on train. It gives error after 30 seconds of listening.

@KananHasanov747 The "while riding on train" part might be the issue. Sometimes even official clients refuse to work when on public wifi or mobile network.

If you aren't already you can try logging in.

If you are using mobile network you can try to enable/disable airplane mode and restart the app (make sure it is fully stopped and not running in background anymore before starting again).

Error 403 (Logged in only) so its about newpipe issue

@gechoto
Copy link
Contributor Author

gechoto commented Jan 17, 2025

Error 403 (Logged in only) so its about newpipe issue

@th3y how have you tested "Logged in only"?
Does it immediately start working if you log out in the settings?

Can you test fresh install logged in vs fresh install logged out?

@th3y
Copy link

th3y commented Jan 17, 2025

Error 403 (Logged in only) so its about newpipe issue

@th3y how have you tested "Logged in only"? Does it immediately start working if you log out in the settings?

Can you test fresh install logged in vs fresh install logged out?

Works logged out, using another client than WEB_CREATOR gives error 403.

@gechoto
Copy link
Contributor Author

gechoto commented Jan 17, 2025

@th3y please test the TVHTML5 client

@th3y
Copy link

th3y commented Jan 17, 2025

@th3y please test the TVHTML5 client

You are a hero, using TVHTML5 works! (Logged in and age restricted)

@gechoto
Copy link
Contributor Author

gechoto commented Jan 17, 2025

New test build

https://github.com/z-huang/InnerTune/actions/runs/12826161103/artifacts/2445847661

@th3y
Copy link

th3y commented Jan 19, 2025

@th3y please test the TVHTML5 client

While TVHTML5 works, there are some urls that returns 403 (Most of them are music videos or from video section)

@gechoto
Copy link
Contributor Author

gechoto commented Jan 20, 2025

While TVHTML5 works, there are some urls that returns 403 (Most of them are music videos or from video section)

  • Does it return 403 consistently on the same videos or do they work if you close the app and try again a few minutes later?
  • Does it fall to the IOS client for those videos and does this allow playback?

@th3y
Copy link

th3y commented Jan 20, 2025

While TVHTML5 works, there are some urls that returns 403 (Most of them are music videos or from video section)

  • Does it return 403 consistently on the same videos or do they work if you close the app and try again a few minutes later?
  • Does it fall to the IOS client for those videos and does this allow playback?

• Does it return 403 consistently on the same videos or do they work if you close the app and try again a few minutes later?
Its consistently, i tried different browser and networks and its the same
• Does it fall to the IOS client for those videos and does this allow playback?
It allows Playback of this video, but i can't never be sure of using IOS since its having problems sometimes (30 seg playback and error)

@gechoto
Copy link
Contributor Author

gechoto commented Jan 20, 2025

i tried different browser

If it doesn't even work with the official client in a browser your IP or account might be blocked.

i can't never be sure of using IOS since its having problems sometimes (30 seg playback and error)

How often does this happen?
Can you test if it also happens with NewPipe if you apply this PR TeamNewPipe/NewPipeExtractor#1262 ?

@th3y
Copy link

th3y commented Jan 20, 2025

While TVHTML5 works, there are some urls that returns 403 (Most of them are music videos or from video section)

  • Does it return 403 consistently on the same videos or do they work if you close the app and try again a few minutes later?
  • Does it fall to the IOS client for those videos and does this allow playback?

I can give you some ids to test (I think i should not share yt links)
zqoj_3r9oqg
6cNFimD69ns
O-B-BBwfAWU
IQQ4ZFtDShE
vQqGz1yqYrE

Its not about the owner channel, i think it could be related from the 'embed' or something behind it, they are managed in a different way

@th3y
Copy link

th3y commented Jan 20, 2025

i tried different browser

If it doesn't even work with the official client in a browser your IP or account might be blocked.

i can't never be sure of using IOS since its having problems sometimes (30 seg playback and error)

How often does this happen? Can you test if it also happens with NewPipe if you apply this PR TeamNewPipe/NewPipeExtractor#1262 ?

Im sorry, typo error, it works with official client.

IOS gives 30 seg error or LOGIN_REQUIRED (Confirm you are not a bot) sometimes. Or it plays at 30 seg and then error.
Lets says its not 100% stable.

About the PR, i can't test it right now

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