pylerSM / YouTubeBackgroundPlayback

[Xposed module] Enable background playback in YouTube
http://repo.xposed.info/module/com.pyler.youtubebackgroundplayback
BSD 3-Clause "New" or "Revised" License
313 stars 81 forks source link

YTM Report thread #362

Open th3an7 opened 6 years ago

th3an7 commented 6 years ago

I've created a new branch that supports YouTube Music - it works ok in video mode (playing songs as videos) - sound only is not available without YouTube RED subscription...

The .java code is exactly the same as original one for normal YT app - the only changes I've made are hooks direct URL and YTM package name...

I've tested it on Genymotion android emulator with Xposed Framework installed and it's working fine - music is played in a background with playback controls visible as notification

It's also confirmed that it's working on a physical devices - Honor 8 and Galaxy S4 - XDA

If you want to test it yourself, check this XDA post HERE

If anyone better at programming wants to try merging YTM and YT apps support together in one YT/MBP Xposed module - there you have it :)

th3an7 commented 6 years ago

Forgot about one thing - if YouTube Music is not available in your country - use US VPN or setup a proxy connection for your WiFi network...

wokawoka commented 5 years ago

This is just great. Is there a way to get the compiled apk for a more recent version? If not, would it be possible to get the sources for the YT music to compile? Many thanks in advance

wokawoka commented 5 years ago

In addition, I tested your 0.1 version with an old yt music 2.23.56 version and the music unfortunately stops when the app is minimized. It's strange because that old ytm version doesn't even add any notification with controls on my phone, differently to what you were showing in your video. Maybe I'd need to find a 2.23.55 apk but I couldn't find online.

th3an7 commented 5 years ago

@wokawoka try 2.53.54 HERE

I was looking at the latest version but it has changed so much i don't really know which classes is which :/

2.53.54 is the latest one added to the sources... it should work but haven't tested this since I made it :P Module is exactly the same as for the normal YT app with a differences in package name to hook and direct link to file with hooks - the rest is the same (even app package name is the same so it may be a problem when getting logs since you probably won't know which one generates errors...)

That's why it is experimental AF :P

wokawoka commented 5 years ago

Thank you very much for your reply @th3an7 I've just tried again with YTM version 2.53.54 and it looks like I'm experiencing the same problem as with version 2.23.56 (that I previously downloaded from apkmirror as well): the music stops when the app is minimized and there is absolutely no notification with play controls like in the video I've seen online. The xposed module is correcltly activated (v.0.1-experimental4), I'm running stock android 7.1 with latest xposed installed

I'm just wondering if the fact that I'm using youtube vanced could interfer with your module. If your module is targeting the YTM specific hooks I tend to believe that it shouldn't.

Any other idea/suggestion? Thank you very much and keep up with the great work on YouTubeBackgroundPlayback

th3an7 commented 5 years ago

@wokawoka well... if you're not using module for normal YT app then you should check logcat and xposed logs - maybe you'll find something there

If you'd be using both modules at the same time it would be difficult since both apps are generating logs with the same tags... but in this case you should be fine as you're using Vanced only :P

wokawoka commented 5 years ago

Thank you for replying. Nothing interesting in the xposed log, this is what I've found in the logcat:

12-11 17:41:17.456 I/YTMusicBackgroundPlayback(30213): No hook details were found for the version of YouTube installed on your device. [vc:25354330]

12-11 17:41:17.456 I/YTMusicBackgroundPlayback(30213): Using the fall-back hook details for YouTube as a last resort.

12-11 17:41:17.461 W/YTMusicBackgroundPlayback(30213): One of the hooks could not be applied: java.lang.ClassNotFoundException: com.google.android.libraries.youtube.player.background.BackgroundTransitioner

12-11 17:41:17.465 W/YTMusicBackgroundPlayback(30213): One of the hooks could not be applied: java.lang.ClassNotFoundException: com.google.android.libraries.youtube.innertube.model.PlayabilityStatusModel

12-11 17:41:17.465 W/YTMusicBackgroundPlayback(30213): Ignoring an unrecognized hook action for YouTube in the list. [a:return_string;vc:25354330]

12-11 17:41:17.469 W/YTMusicBackgroundPlayback(30213): One of the hooks could not be applied: java.lang.ClassNotFoundException: com.google.android.apps.youtube.app.background.BackgroundSettings

12-11 17:41:17.473 I/YTMusicBackgroundPlayback(30213): Done applying the hooks. [vc:25354330]

Any suggestion?

th3an7 commented 5 years ago

Hmm... looks like it didn't find hooks for your version despite it's already added here on github... 12-11 17:41:17.456 I/YTMusicBackgroundPlayback(30213): No hook details were found for the version of YouTube installed on your device. [vc:25354330]

2.53.54 = 25354330/1000 which is OK

Try restarting your device or force closing YTMusic app once again... We'll try something...

wokawoka commented 5 years ago

You know what, I rebooted once again and not it works: "done applying hooks"! It's quite strange because I already did reboot at least once previously. Do you know why it needed more than one reboot in order to be able to correctly get the hooks?

Youtube music in the background It's so cool. If now I could get rid of the ads (on some more recent versions they were blocked from my host file but youtube music from time to time was still interrupting the music and playing a short jingle) , I still have to test this version tough.

Do you by chance plan to eventually release an update version working with a more recent version? It would be great, I can't understand why other users haven't commented much here or on xda (or at least that's the impression I got) because being able to reduce youtube music is even more useful than doing it on regular youtube. Thank you once again for your prompt assistance and for the generous job you are doing.

th3an7 commented 5 years ago

@wokawoka I knew it... I am so f** stupid... I was updating hooks but forgot that the link inside the module points to wrong repo 🤦‍♂️

Note to myself - release either update for module with corrected link OR update hooks on my fork...

About module - it's useless for most users since YT Music works only in US and to test it I had to use emulator with VPN - that's why it's experimental AF - probably only You are using it right now :P

I could check the latest version once again but in the meantime, you'd better be using this one as it's working (I guess :P)

wokawoka commented 5 years ago

I didn't get what was the problem about the wrong repo. Are you speaking about the dropbox link from which I downloaded the xposed module? According to your description it was supposed to work with youtube music version 2.23.56 and 2.23.55, while it's running perfectly with version 2.23.54 atm. Anyway, it works and I'm extremely happy now.

I have also to say that I'm writing from Europe in this right moment (Germany) and youtube music works perfectly (now in the background thanks to your module!) on both my mobile and my laptop so I guess that there are some Countries outside the US where the service works (I guess it could be easy to find them out reading online). I bet you could make more people than just me happy (especially considering that using a "freemium" spotify on a mobile is not as easy as it use to be.

th3an7 commented 5 years ago

@wokawoka hmm... maybe they are finally expanding YTM market...

About the link - in source code there is direct link to hooks:

https://github.com/pylerSM/YouTubeBackgroundPlayback/blob/5cb6427de03c527da0a20bb9e091bb5091725ee7/java/com/pyler/youtubebackgroundplayback/YouTubeBackgroundPlayback.java#L47

I guess after uploading that module for testing purposes, I forgot to build it again with correct link...

I'll leave it for now as it is as it's working - i just need to remember to update both repos respectively...

wokawoka commented 5 years ago

I see. Then I just hope that you'll not change the hooks on the github repo while we are listening successfully with this combo (xposed module + ytm 2.23.54 version works). I cross my fingers for an updated version in the future and I'll keep monitoring this repo. Many thanks once again!

th3an7 commented 5 years ago

Well @wokawoka your prayers may have been heard - can you please test it for 2.61.50?

As I said - there was a lot of changes so it may or may not work - backup your current version first :)

So - Install YT Music v2.61.50 and either force close app or completely reboot your device to force download new hooks

wokawoka commented 5 years ago

Great news! Alright, I've backed up the current version of the module. But, as a general question, if each time, after a reboot, it fetches the hooks from the repo, is there a way to just freeze it like it is (say, with the hooks for the 2.23.54 version), other than, maybe, blocking its access via the firewall? Does it mean that, since you updated the hooks on the repo, my setup would have stopped working after a reboot? Or maybe you did keep the hooks for both versions?

Anyway I'm going to install ytm 2.61.50 and report back in a few minutes. Thanks

th3an7 commented 5 years ago

Everything stays the same - I am just adding next version to the already existing ones so... if latest one is not working, just downgrade and it will be working again - that's why it said before it couldn't find hooks for specified version as it wasn't in .json file.

No need of blocking anything - you just need to install correct version of the app :P

On Tue, Dec 11, 2018 at 8:39 PM wokawoka notifications@github.com wrote:

Great news! Alright, I've backed up the current version of the module. But, as a general question, if each time, after a reboot, it fetches the hooks from the repo, is there a way to just freeze it like it is (say, with the hooks for the 2.23.54 version), other than, maybe, blocking its access via the firewall? Does it mean that, since you updated the hooks on the repo, my setup would have stopped working after a reboot? Or maybe you did keep the hooks for both versions?

Anyway I'm going to install ytm 2.61.50 and report back in a few minutes. Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pylerSM/YouTubeBackgroundPlayback/issues/362#issuecomment-446334389, or mute the thread https://github.com/notifications/unsubscribe-auth/AMxxbKm8q9TsTeAhUQ52FOX1Vdn_V21Iks5u4AoLgaJpZM4UyAlc .

wokawoka commented 5 years ago

You are my hero. It looks like it's working with ytm 2.61.50 as well!

While testing the 2.23.54 version I didn't get any ads (they were blocked by the adway hosts file or the one on my router, I guess) but from time to time (not really often) I was still getting the opening/closing jingle that the app plays before and after each ad. Do you think that this is hardcoded in the app and there's nothing to do or it may be somehow possible to remove this jingle as well? Honestly it's not bothering me much, but removing that as well would be just the perfect setup for me to go back to listen to my music in streaming.

th3an7 commented 5 years ago

In theory you could check if YouTube AdAway works for YT Music (and it should as it also looks for ads there) but it may crash - use this prebuild version from HERE

In the past some users reported that using both YTBP and YTAdAway crashes YouTube app so be cautious...

As I said - it may work but you need to check it yourself :)

wokawoka commented 5 years ago

Thank you for the suggestion. I installed the version you linked and I've installed it. So far it's not crashing but I'm not able to say if it's removing the ads since my host file is already blocking them. I tend to think that the short sound that announces and closes the ads is hardcoded in the app and it's not being downloaded. If I'll be able to block it I'll surely report back. Thank you once again. I go back listening to some music now. I did appreciate your help a lot. Keep up with the great work you are doing

Untzo commented 5 years ago

is not working anymore on version 3.03.55 of YTmusic

th3an7 commented 5 years ago

I'll try to update it... But don't expect miracles :P YTM app could change a lot since then

In the meantime you can use some old version that's supported or just normal YT app with YTBP Module

On Mon, Feb 25, 2019, 13:54 Untzo notifications@github.com wrote:

is not working anymore on version 3.03.55 of YTmusic

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pylerSM/YouTubeBackgroundPlayback/issues/362#issuecomment-467000363, or mute the thread https://github.com/notifications/unsubscribe-auth/AMxxbNETJVkvjY6q7Xq1EJYeGpg93--Zks5vQ9zogaJpZM4UyAlc .

Untzo commented 5 years ago

Thx

th3an7 commented 5 years ago

@Untzo Check if it works again - just force close YTM app or reboot your phone (FC should be enough tho)

Seems like it didn't change much so 🤞

Untzo commented 5 years ago

Yes it's fully working thx for your help

Untzo commented 5 years ago

Plz post the new link when will be readyl

th3an7 commented 5 years ago

@Untzo sorry it took me so long... should work again - as always - just force close YTMusic app :)

Untzo commented 5 years ago

Yes i confirm it's workin for version 3.05.54

Untzo commented 5 years ago

YTM just got an update. And the module is not working

th3an7 commented 5 years ago

Will do an update if I find a while today...

On Wed, Mar 20, 2019, 22:03 Untzo notifications@github.com wrote:

YTM just got an update. And the module is not working

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pylerSM/YouTubeBackgroundPlayback/issues/362#issuecomment-475027235, or mute the thread https://github.com/notifications/unsubscribe-auth/AMxxbCDrSiLNCFuGE8baIu0X7E-DwssWks5vYqIUgaJpZM4UyAlc .

th3an7 commented 5 years ago

@Untzo I've added 3.07.54 - should work for that version I've skipped 3.07.52 as it looks like it's only for one CPU arch and 3.07.54 is the latest one - let me know if I should still add .52 :D

Untzo commented 5 years ago

Thx. Fully working again. But im still thinking that u should add an option to modify audio quality

th3an7 commented 5 years ago

Like i was saying before - I was trying to add audio only option but I failed - I think I found the class with that but when I added it into hooks, the module all of the sudden stopped working... Nothing worked, not even background playback so I left it as it is now...

It's just modified normal YTBP module with changed hooks and YTM package name - the rest is exactly as it was before...

Untzo commented 5 years ago

Oooh ok understood


From: Łukasz Ordon notifications@github.com Sent: Thursday, March 21, 2019 2:32:44 PM To: pylerSM/YouTubeBackgroundPlayback Cc: Untzo; Mention Subject: Re: [pylerSM/YouTubeBackgroundPlayback] VERY experimental support for YTM app (#362)

Like i was saying before - I was trying to add audio only option but I failed - I think I found the class with that but when I added it into hooks, the module all of the sudden stopped working... Nothing worked, not even background playback so I left it as it is now...

It's just modified normal YTBP module with changed hooks and YTM package name - the rest is exactly as it was before...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/pylerSM/YouTubeBackgroundPlayback/issues/362#issuecomment-475229698, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AtwXTrsJGqBG0K5HjO8lgCc6JUSJ67q3ks5vY4n8gaJpZM4UyAlc.

SammyTRK commented 5 years ago

Is it just me or is this not working on Pie with EdXposed?

Edit I can't get it to work at all now, I had an Oreo backup that I thought had it working... I spent hours trying everything I could think of, tried older versions that I know used to work. Please tell me its not just me.

Untzo commented 5 years ago

Im on nougat (lg g5) and it's fully working

th3an7 commented 5 years ago

@SammyTRK can you check logcat and xposed logs? I didn't know there is something like EdXposed... looking at their readme on github, I can see Known Issues - especially

If that's the case, I don't think it will work - try using official Xposed for Pie (if there is one... I haven't been watching for updates since I didn't use Xposed Framework for a while now)

SammyTRK commented 5 years ago

I have a Note5(Android 6.0.1) and a Note9(Oreo8.1 or Pie9.0). I have tried every version of this module I still have with the matching version of YTmusic on every system and nothing works for me anymore. I even restored and old backup on my note5 it has version 2.61.50 on it which I know was working back then and it doesn't work now. I have no idea what is going on. I can give logs for official Xposed for Oreo and then for EdXposed on Pie. It might be late tonight or tommorrow.

If someone would send me a known working version of this module that would cut out a variable. I would think that if the build is successful in AS it should be a working module right? Up until now every version I have built has worked in the past. Now none of them work.

Also, I wanted to ask about the latest update. There is an extra bracket on line 163 of hooks-music.json, I removed it in AS before building. Should I keep it looking like this?

            ] }
        ]],
        "30754": [
th3an7 commented 5 years ago

@SammyTRK good catch - it shouldn't be there... Also if you're building it yourself and you're using your own hooks, you need to change direct url in:

private static final String HOOKS_DOWNLOAD_URL = "https://raw.githubusercontent.com/pylerSM/YouTubeBackgroundPlayback/yt-music/assets/hooks-music.json";

But if you're just building .apk and not updating hooks yourself - it should be ok... I've also just remembered, pre-built module .apk has different URL which directs to hooks in my fork - if you've built module from this source - it should work again as I've deleted the extra ]

Try restarting your device or force close YTM app and post the result

SammyTRK commented 5 years ago

OMG it is working again. Version 3.07.54 on Note9 Oreo 8.1. I'll install Pie again later and edit this post to let you know if its working with EdXposed. Thanks man!

Edit Yep, it's working on Pie with EdXposed :)

th3an7 commented 5 years ago

@SammyTRK it should work if it works for Oreo - I've fixed the hooks by deleting the extra ']' as you pointed out :D Sorry I didn't noticed it while I was updating them :P

Untzo commented 5 years ago

Ytbmusic got an update and the module is not working can you fix?

th3an7 commented 5 years ago

@Untzo there is no new YTM app on apkmirror - can you upload it somewhere so I can quickly update hooks?

Also which version number it is...

Nevermind - it just got uploaded to apkmirror - hooks updated 😃

Untzo commented 5 years ago

nice bro thx so much

wokawoka commented 5 years ago

are there any benefits in uptdating the ytm app each time they release a new version? (and therefore having to request each time to th3an7 an updateof the hooks?)

I'm personally listening to music on an old version of a couple of months ago and it works perfectly. did they add new functions in the newer versions? Maybe the possibility to select and use the "music only" switch would possibly may be a good reason to switch for me. But for now, it if it works, I'll not change it thank you th3an7

th3an7 commented 5 years ago

Taking about "music only" option - does someone have latest apk of YTM (v3.09.57) but for x86 CPU arch? Can't find that anywhere and I'd like to do some tests on emulator to check if I am actually retarded and can't find correct hooks, or if it's not possible at all...

SammyTRK commented 5 years ago

Will this work? First one I found It may be modded. It says Cpu: x86 http://youtube-music.apk.black/

wokawoka commented 5 years ago

If that apk doesn't work I have an android x86 tablet at home so I can eventually install it and extract the apk when needed. Just let me know

th3an7 commented 5 years ago

Nah, it works... I couldn't set up VPN on that so the app would launch so I am doing tests now on my own personal device

Thanks :D

On Thu, Apr 4, 2019, 17:08 wokawoka notifications@github.com wrote:

If that apk doesn't work I have an android x86 tablet at home so I can eventually install it and extract the apk when needed. Just let me know

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pylerSM/YouTubeBackgroundPlayback/issues/362#issuecomment-479937368, or mute the thread https://github.com/notifications/unsubscribe-auth/AMxxbJv9iRrIG60hXEReHwQvz2opBTRBks5vdhVtgaJpZM4UyAlc .

wokawoka commented 5 years ago

alright, great, happy tests then

Untzo commented 5 years ago

Hey yt muwic got and update