update electron & remote & user agents #515

Merged
Araxeus merged 13 commits from fix-useragents into master 2021-12-30 13:57:36 +00:00
Araxeus commented 2021-12-12 22:12:18 +00:00 (Migrated from github.com)

fix #507, fix #526, fix #17, fix #8, fix #327

* 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
WhiteHusky commented 2021-12-13 20:02:55 +00:00 (Migrated from github.com)

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.

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.
WhiteHusky commented 2021-12-13 20:03:36 +00:00 (Migrated from github.com)

Correction, now it shows my front page after navigating around.

Correction, _now_ it shows my front page after navigating around.
WhiteHusky commented 2021-12-13 20:04:47 +00:00 (Migrated from github.com)

And now opening and closing it breaks it again. Google really doesn't want us embedding YTM huh?

And now opening and closing it breaks it again. Google really doesn't want us embedding YTM huh?
Araxeus commented 2021-12-13 20:07:29 +00:00 (Migrated from github.com)

@WhiteHusky It really should work now, did you update dependencies using yarn? did you try building and installing?

@WhiteHusky It really should work now, did you update dependencies using `yarn`? did you try building and installing?
keliel commented 2021-12-13 22:37:46 +00:00 (Migrated from github.com)

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?

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?
keliel commented 2021-12-14 08:18:08 +00:00 (Migrated from github.com)

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 :)

image

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 :) ![image](https://user-images.githubusercontent.com/5556710/145959571-0f30be95-49c8-4ddc-84ed-87720b976252.png)
keliel commented 2021-12-14 08:39:36 +00:00 (Migrated from github.com)

Okay nvm. They are having the same issue now. Seems like this is a common problem suddenly appearing with Electron apps, maybe?

Okay nvm. They are having the same issue now. Seems like this is a common problem suddenly appearing with Electron apps, maybe?
keliel commented 2021-12-14 08:57:10 +00:00 (Migrated from github.com)

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 :)

image

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 :) ![image](https://user-images.githubusercontent.com/5556710/145965941-2485f400-9d3f-45d4-9ec5-8e5d367a8acd.png)
Araxeus commented 2021-12-14 16:00:22 +00:00 (Migrated from github.com)

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)

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)
keliel commented 2021-12-14 17:12:43 +00:00 (Migrated from github.com)

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)

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: a273f6f73c057453e88a72825cb133a4bcdfebd8 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)
Araxeus commented 2021-12-14 17:31:46 +00:00 (Migrated from github.com)

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.

Latest version actually works good for me when built and installed (still buggy in dev mode)


a273f6f is out of scope in my opinion.

Well yes but its just that suddenly with the new electron version player.videoMode_ sometimes doesn't reflect the real value when videoStarted() is called, so I just switched to the old way of checking


update to electron was needed for the remote package to work?

More like the update to the remote package was needed because of the electron update.
That update is for mainly for the 2 following reasons:

  • Electron 12 is deprecated since 16/11/2021 (and with it the remote module)
  • Update to electron 16 since there shouldn't be any breaking changes affecting this project except the remote module and that way we get the latest chromium which performs better & more secure & less bugs
> 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. Latest version actually works good for me when built and installed (still buggy in dev mode) ---- > a273f6f is out of scope in my opinion. Well yes but its just that suddenly with the new electron version `player.videoMode_` sometimes doesn't reflect the real value when `videoStarted()` is called, so I just switched to the old way of checking ----- > update to electron was needed for the remote package to work? More like the update to the remote package was needed because of the electron update. That update is for mainly for the 2 following reasons: * Electron 12 is deprecated since 16/11/2021 (and with it the remote module) * Update to electron 16 since there shouldn't be any breaking changes affecting this project except the remote module and that way we get the latest chromium which performs better & more secure & less bugs
Araxeus commented 2021-12-14 17:41:48 +00:00 (Migrated from github.com)

@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

@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
keliel commented 2021-12-14 20:45:59 +00:00 (Migrated from github.com)

@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 😞

@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 😞
keliel commented 2021-12-14 20:53:43 +00:00 (Migrated from github.com)

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 🤨

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 🤨
th-ch (Migrated from github.com) reviewed 2021-12-14 20:59:08 +00:00
th-ch (Migrated from github.com) left a comment

Thanks for the fix, tested on MacOS, looks promising! But I would separate the electron upgrade which might require more work

Thanks for the fix, tested on MacOS, looks promising! But I would separate the electron upgrade which might require more work
th-ch (Migrated from github.com) commented 2021-12-14 20:56:51 +00:00

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

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`
th-ch (Migrated from github.com) commented 2021-12-14 20:46:08 +00:00

This seems to break the downloader:

Error: unrecognized flag --experimental-wasm-bulk-memory
Try --help for options
[74932:1214/212918.545255:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

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?

This seems to break the downloader: ``` Error: unrecognized flag --experimental-wasm-bulk-memory Try --help for options [74932:1214/212918.545255:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details. ``` 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?
keliel (Migrated from github.com) reviewed 2021-12-14 21:13:05 +00:00
keliel (Migrated from github.com) commented 2021-12-14 21:13:05 +00:00

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.

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.
th-ch (Migrated from github.com) reviewed 2021-12-14 22:33:05 +00:00
th-ch (Migrated from github.com) commented 2021-12-14 22:32:58 +00:00

It might also be worth allowing an override in config for more flexibility :)

It might also be worth allowing an override in config for more flexibility :)
Araxeus commented 2021-12-15 17:31:36 +00:00 (Migrated from github.com)

@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

disable-autoplay plugin seems to be broken now. Stops each time I try to press play

@KimBum I actually can't replicate anything? could you check again maybe>

  • downloader plugins (unrecognized flag --experimental-wasm-bulk-memory + SharedArrayBuffer is not defined are fixed with baeebd1

allow override of useragent in config for more flexibility

@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)

@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 > disable-autoplay plugin seems to be broken now. Stops each time I try to press play @KimBum I actually can't replicate anything? could you check again maybe> * downloader plugins (`unrecognized flag --experimental-wasm-bulk-memory` +` SharedArrayBuffer is not defined` are fixed with baeebd1 > allow override of useragent in config for more flexibility @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 https://github.com/th-ch/youtube-music/blob/8f2ed3039a5f30eeaf372afc4bcb1105b080bee9/index.js#L185-L191
Araxeus (Migrated from github.com) reviewed 2021-12-16 17:17:36 +00:00
Araxeus (Migrated from github.com) commented 2021-12-16 17:17:36 +00:00

baeebd1 Fixed both of those issues and 1 more :)

baeebd1 Fixed both of those issues and 1 more :)
Araxeus (Migrated from github.com) reviewed 2021-12-16 17:21:52 +00:00
Araxeus (Migrated from github.com) commented 2021-12-16 17:21:52 +00:00

see my comment below

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)

see my comment below > 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 https://github.com/th-ch/youtube-music/blob/8f2ed3039a5f30eeaf372afc4bcb1105b080bee9/index.js#L185-L191
Araxeus commented 2021-12-16 17:23:59 +00:00 (Migrated from github.com)
  • 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:

  • logged in failed, retried with alternate useragent and succedeed
  • Launched the app (sometimes, about 1/5 times for me)

in which all navbar items disappear except the search button:

image

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)

* 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: * logged in failed, retried with alternate useragent and succedeed * Launched the app (sometimes, about 1/5 times for me) in which all navbar items disappear except the search button: ![image](https://user-images.githubusercontent.com/78568641/146420441-8eec2365-976b-4249-bd8c-c2a5a84d2195.png) 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)
Araxeus (Migrated from github.com) reviewed 2021-12-16 17:51:28 +00:00
Araxeus (Migrated from github.com) commented 2021-12-16 17:51:28 +00:00

@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)

@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)
th-ch (Migrated from github.com) approved these changes 2021-12-30 13:57:29 +00:00
th-ch (Migrated from github.com) left a comment

Looks good, thanks for the fix and the upgrade! Merging, will release a new version with all the recent changes

Looks good, thanks for the fix and the upgrade! Merging, will release a new version with all the recent changes
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#515
No description provided.