update electron & remote & user agents #515
No reviewers
Labels
No labels
awaiting-reply
breaking changes
bug
cannot-reproduce
dependencies
documentation
duplicate
electron-issue
enhancement
fix-available
good first issue
help wanted
invalid
javascript
need more information
need rebase
official-youtube-music-issue
plugin request
question
release
security
stale
Status: blocked
typo
wontfix
ytmd-issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: YTMD/youtube-music#515
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-useragents"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Update electron https://www.electronjs.org/blog/electron-16-0#end-of-support-for-12xy
which requires updating the remote package in this app as well as in custom-electron-prompt and custom-electron-titlebar
which caused some downloader bugs that needed fixing in commit
baeebd1
Fix for logging in when account is "shadowbanned" (browser not secure error)
fix #507, fix #526, fix #17, fix #8, fix #327
Logging in is still pretty jank. I had to clear my data (or as much as I could), then try to sign in, then switch into my own account, then hard refresh. The home page is, for some reason, still showing the generic home page but now I get access to my library.
I swore there was Chromecast support but I guess I might've dreamt it up.
Correction, now it shows my front page after navigating around.
And now opening and closing it breaks it again. Google really doesn't want us embedding YTM huh?
@WhiteHusky It really should work now, did you update dependencies using
yarn
? did you try building and installing?Login worked for me instantly. Although there were no navigation items except for search, after returning back to home page.
Also login screens looked a bit different (old?) compared to what I am currently used to with Google/Youtube.
The package versions you updated here, are the newest ones, right? Or are there any other parameters that might've been missed?
For reference, this is what it would look like in the competing YTM app. I noticed that here is says "sign in to continue to Youtube Music", but in case of this PR it shows the "sign into all of google" page and mentions "sign in to continue to Youtube", which might be a hint :)
Okay nvm. They are having the same issue now. Seems like this is a common problem suddenly appearing with Electron apps, maybe?
Over there the fix also included opening their "guest" login separately without actually using it. That one does in fact look like the one that comes out after this PR here :)
It is indeed an electron problem that has nothing to do with the app. see https://github.com/electron/electron/issues/22346#issuecomment-590413621
this PR kinda works for some reason - it will try the first time with the normal mode, then if it fails it switches to the "One account. All of Google" mode, which works but if used then for unknown reasons it breaks the navigation until the app is restarted (but it stays logged in so the only problem is the navigation bug after log in)
Is it possible to force a restart after successful login in the second case? If so, I would say that it is an acceptable workaround.
On another note regarding this PR:
a273f6f73c
is out of scope in my opinion. Or does it have anything to do with the initial problem or resulting issues? I am guessing the simultaneous update to electron was needed for the remote package to work? (4 major versions is pretty big)Latest version actually works good for me when built and installed (still buggy in dev mode)
Well yes but its just that suddenly with the new electron version
player.videoMode_
sometimes doesn't reflect the real value whenvideoStarted()
is called, so I just switched to the old way of checkingMore like the update to the remote package was needed because of the electron update.
That update is for mainly for the 2 following reasons:
@KimBum here are windows binaries with the latest changes
https://www.mediafire.com/folder/fvjiihmu3ka2z/Youtube-Music+useragents-patch+v3
try installing via the setup this time
@Araxeus works like you said. First time failed, but second time works fine. Navigation also showed up for me, since reload seemed to happen automatically.
I did notice however, that the disable-autoplay plugin seems to be broken now. Stops each time I try to press play 😞
Seems to work some of the time when the tooltip for "press to play" appears, but even though I just reinstalled it, the tooltip is not shown for the first startup 🤨
Thanks for the fix, tested on MacOS, looks promising! But I would separate the electron upgrade which might require more work
Login seems to work fine on Mac with the fix and this user-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36
This seems to break the downloader:
And
SharedArrayBuffer is not defined
when converting - it should be fixable but might need additional work, maybe we can split the PR between fixing the user agents and the electron update?Would be willing to test a version with the electron upgrade reverted on Windows. As far as I understood that would also revert the remote package setup, right? So would like to re-check it once.
It might also be worth allowing an override in config for more flexibility :)
@th-ch Sorry but I really can't separate it now since remote doesn't work for me anymore no matter what I do
-which means I can't even test another PR without the updated electron version
@KimBum I actually can't replicate anything? could you check again maybe>
unrecognized flag --experimental-wasm-bulk-memory
+SharedArrayBuffer is not defined
are fixed withbaeebd1
@th-ch this useragent isn't really doing much, the actual fix is that when it fails (some accounts are shadowbanned) - it tries again with the original useragent which does work currently if login initially fail
8f2ed3039a/index.js (L185-L191)
baeebd1
Fixed both of those issues and 1 more :)see my comment below
Downloader issues are fixed
I've also fixed and updated both custom-electron-prompt&titlebar packages
All thats left is that disable-autoplay bug that I can't personally replicate. can anyone look into it?
windows setup 16/12/2021: https://www.mediafire.com/folder/fvjiihmu3ka2z/Youtube-Music+useragents-patch+v4
Its also worth noting that the portable version of the app / dev version has a bug in those 2 scenarios:
in which all navbar items disappear except the search button:
No idea why would it ever happen, but it never happens if the app is installed - so maybe whenever you release a new version you should consider not including the portable version or add a warning?
(According to my testing, this bug has no relation to the useragent, which makes sense since installing gets rid of it)
@th-ch You can't really test this useragent fix unless you are shadowbanned
(which means you will see a message saying the login failed due to unsecure browser, then press retry and it will redirect to a different login page which should work)
Looks good, thanks for the fix and the upgrade! Merging, will release a new version with all the recent changes