tiliado / nuvola-app-groove

RIP 2017. Discontinued & archived Microsoft Groove script for Nuvola Apps Runtime
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Doesn't seem to work any more. #6

Closed jonseppanen closed 7 years ago

jonseppanen commented 7 years ago

Cannot find 'playerInterface' object in the injection script.

Also, if I modify the script to simply wait for the 'player' id element instead, I keep getting a page that says "Your browser needs an update." and goes no further.

Console says:XMLHttpRequest cannot load https://music.microsoft.com/Api/Data/unauth due to access control checks And also 'Error: authClient has not been defined'

Using the 'free' version of the player.

jrosco commented 7 years ago

Cannot find 'playerInterface' object in the injection script.

relates to issue #5

jrosco commented 7 years ago

Have tried adding a supported user agent string and coding this manually (see below). And I've had no luck at this stage.

//Set Useragent 
var useragent = navigator; navigator = new Object();
navigator.__proto__ = useragent
navigator.__defineGetter__('userAgent', function () {
  return 'user agent string ot return'
});

Need to figure out how MS are checking for supported user agents and try and override this

jiri-janousek commented 7 years ago

For Nuvola 4.4+, you can use user_agent property of metadata.in.json.

jrosco commented 7 years ago

I'll have some time this week to look into this issue. Will look at the user agent strings mentioned here

jrosco commented 7 years ago

I've tried setting the user agent string property as detailed here

I have tried all predefined agents and also tried adding custom ones but seems to not work for what is needed here. Checking navigator.userAgent is showing the correct user agent that is configured in metadata.in.json

I'm seeing Error: authClient has not been defined in the logs. I'm thinking this is set somehow by Microsoft to determine if the browser is supported. Need further investigate into this error

jiri-janousek commented 7 years ago

Thanks @jrosco for working on this issue. Could you post a complete debugging output? Reporter mentioned XMLHttpRequest cannot load https://music.microsoft.com/Api/Data/unauth due to access control checks which could be the real issue.

jrosco commented 7 years ago

I'm seeing this debug output for Nuvola 3 @fenryxo

Nuvola Player 3 3.0.8 Revision 683fc7254443f13a35e4ba33d948ca6e382e690f WebKitGTK 2.10.9 libsoup 2.52.2

➜ nuvola-app-groove git:(master) ✗ nuvolaplayer3 -D -A ../ Master: [DEBUG Nuvola] master.vala:111: Compositing mode disabled because of WebKitGTK < 2.13.4 Master: [DEBUG Gtk] Connecting to session manager Master: [DEBUG DioriteGtk] DesktopShell.vala:96: Shell: compiz (null), CSD 0, appmenu 1, menubar 1 Master: [DEBUG Nuvola] WebAppRegistry.vala:128: Found web app Groove at /home/joelc/tmp/nuvola-app-groove, version 1.4 Master: [DEBUG DioriteGtk] application.vala:219: XFCE session vanished: org.xfce.SessionManager Master: [DEBUG DioriteGtk] actionsregistry.vala:325: Action activated: main/win.start-app(null) Master: [DEBUG Nuvola] WebAppRegistry.vala:128: Found web app Groove at /home/joelc/tmp/nuvola-app-groove, version 1.4 Master: [INFO Nuvola] WebAppRegistry.vala:89: Using web app Groove, version 1.4, data dir /home/joelc/tmp/nuvola-app-groove Master: [DEBUG Nuvola] MasterController.vala:378: Launch app runner for 'groove': /usr/lib/nuvolaplayer3/apprunner -D -a /home/joelc/tmp/nuvola-app-groove Runner: [WARNING Nuvola] The Groove script doesn't provide a desktop file. It might not function properly. Ask the maintainer to switch to the Nuvola SDK <https://github.com/tiliado/nuvolasdk> and build it with./configure --with-desktop-launcher. Runner: [DEBUG Gtk] Connecting to session manager Runner: [DEBUG DioriteGtk] DesktopShell.vala:96: Shell: compiz (null), CSD 0, appmenu 1, menubar 1 Runner: [DEBUG DioriteGtk] application.vala:219: XFCE session vanished: org.xfce.SessionManager Master: [DEBUG Nuvola] MasterController.vala:284: Connected to runner server for 'groove'. Runner: [DEBUG Nuvola] Connection.vala:132: Network Proxy: system settings Runner: [DEBUG Nuvola] WebEngine.vala:73: Nuvola WebKit Extension directory: /usr/lib/nuvolaplayer3 Runner: [WARNING DioriteGtk] actionsregistry.vala:170: Action 'donate' not found in registry. Runner: [DEBUG Nuvola] Notifications.vala:175: Notifications: persistence false, actions false, icons false Master: [DEBUG Nuvola] MediaKeys.vala:101: GNOME settings daemon appeared: org.gnome.SettingsDaemon, :1.16 Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component tray_icon (Tray Icon) not enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component unity_launcher (Unity Laucher) enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component notifications (Notifications) enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component mediakeys (Media keys) enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component scrobbler (Audio Scrobbler Services) enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component mpris (MPRIS 2) enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component lyrics (Lyrics) enabled Runner: [DEBUG Nuvola] AppRunnerController.vala:416: Component developer (Developer's tools) enabled Runner: [DEBUG Nuvola] MPRISProvider.vala:73: Bus acquired: org.mpris.MediaPlayer2.NuvolaAppGroove, registering objects Runner: [DEBUG Nuvola] MPRISProvider.vala:90: Bus name acquired: org.mpris.MediaPlayer2.NuvolaAppGroove Worker: [DEBUG Nuvola] WebExtension.vala:203: Page 1 created for (null) Worker: [DEBUG Nuvola] WebExtension.vala:212: Document loaded about:loading Runner: [DEBUG Nuvola] WebEngine.vala:496: Navigation, current window: uri = https://music.microsoft.com/UnsupportedBrowser, result = true, frame = (null), type = WEBKIT_NAVIGATION_TYPE_OTHER Runner: [DEBUG Nuvola] FormatSupport.vala:110: Trying to play /usr/share/nuvolaplayer3/audio/audiotest.mp3. Runner: [DEBUG Nuvola] FormatSupport.vala:110: Pipeline state changed from NULL to READY. Runner: [DEBUG Nuvola] FormatSupport.vala:110: Pipeline state changed from READY to PAUSED. Runner: [DEBUG Nuvola] FormatSupport.vala:110: Pipeline state changed from PAUSED to PLAYING. Runner: [DEBUG Nuvola] FormatSupport.vala:110: End of stream for file /usr/share/nuvolaplayer3/audio/audiotest.mp3. Runner: [DEBUG Nuvola] FormatSupportCheck.vala:145: Nuvola.WebPlugin: Shockwave Flash (enabled, flash) at /usr/lib/mozilla/plugins/flashplugin-alternative.so: Shockwave Flash 25.0 r0 Runner: [DEBUG Nuvola] WebAppWindow.vala:170: Sidebar position: 951 Worker: [DEBUG Nuvola] WebExtension.vala:113: Window object cleared for 'https://music.microsoft.com/UnsupportedBrowser' Worker: [DEBUG Nuvola] WebExtension.vala:123: Init frame: https://music.microsoft.com/UnsupportedBrowser, 0x55f34b706f00, 0x55f34c068020, 0x7f485ac87740 Runner: https://m.s-microsoft.com/music/4.7.17180.1/js/rejected.min-v4.7.17180.1.js:1:1706: CONSOLE ERROR Error: authClient has not been defined Runner: [DEBUG Nuvola] WebEngine.vala:496: Navigation, current window: uri = https://c1.microsoft.com/c.gif?DI=4050&did=1&t=, result = true, frame = (null), type = WEBKIT_NAVIGATION_TYPE_OTHER Worker: [DEBUG Nuvola] WebExtension.vala:212: Document loaded https://music.microsoft.com/UnsupportedBrowser Runner: [DEBUG Nuvola] DeveloperSidebar.vala:158: Media player notify: artwork-location

jrosco commented 7 years ago

I've also tried Nuvolaplayer 4 and seeing this `groove flatpak run eu.tiliado.NuvolaAppGroove Gtk-Message: Failed to load module "unity-gtk-module" Runner: [WARNING Δ415611us Nuvola] Traits.vala:123: No longer supported identifier in a format support expression: 'FlashAudioRequired'. Gtk-Message: Failed to load module "unity-gtk-module" Runner: [WARNING Δ175114us Nuvola] Traits.vala:123: No longer supported identifier in a format support expression: 'FlashAudioRequired'. Worker: [DEBUG Δ015339us Nuvola] WebExtension.vala:272: Page 1 created for (null) Worker: [DEBUG Δ010937us Nuvola] WebExtension.vala:282: Document loaded about:loading

(eu.tiliado.NuvolaAppGroove:2): Gtk-WARNING **: Allocating size to NuvolaSidebar 0x1bc1c60 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? Worker: [DEBUG Δ07s156224us Nuvola] WebExtension.vala:129: Window object cleared for 'https://music.microsoft.com/UnsupportedBrowser' Worker: [DEBUG Δ000048us Nuvola] WebExtension.vala:140: Init frame: https://music.microsoft.com/UnsupportedBrowser, 0x18ce360, 0x167e020, 0x7f72b69c00e8 Worker: [DEBUG Δ045037us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix: webkitIndexedDB -> IndexedDB | [object IDBFactory]' Worker: [DEBUG Δ000219us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix: webkitConvertPointFromPageToNode -> ConvertPointFromPageToNode | function webkitConvertPointFromPageToNode() {\n [native code]\n}' Worker: [DEBUG Δ000072us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix: webkitConvertPointFromNodeToPage -> ConvertPointFromNodeToPage | function webkitConvertPointFromNodeToPage() {\n [native code]\n}' Worker: [DEBUG Δ000075us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix: webkitRequestAnimationFrame -> RequestAnimationFrame | function webkitRequestAnimationFrame() {\n [native code]\n}' Worker: [DEBUG Δ000062us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix: webkitCancelAnimationFrame -> CancelAnimationFrame | function webkitCancelAnimationFrame() {\n [native code]\n}' Worker: [DEBUG Δ000060us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix: webkitCancelRequestAnimationFrame -> CancelRequestAnimationFrame | function webkitCancelRequestAnimationFrame() {\n [native code]\n}' Worker: [DEBUG Δ000081us Nuvola] jsapi.vala:579: Nuvola.log: 'Missing hidden: webkitMediaSource -> MediaSource | undefined' Worker: [DEBUG Δ000104us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix hidden: webkitAudioContext -> AudioContext | function webkitAudioContext() {\n [native code]\n}' Worker: [DEBUG Δ000091us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix hidden: webkitAudioPannerNode -> AudioPannerNode | function webkitAudioPannerNode() {\n [native code]\n}' Worker: [DEBUG Δ000071us Nuvola] jsapi.vala:579: Nuvola.log: 'Unprefix hidden: webkitOfflineAudioContext -> OfflineAudioContext | function webkitOfflineAudioContext() {\n [native code]\n}' https://m.s-microsoft.com/music/4.7.17180.1/js/rejected.min-v4.7.17180.1.js:1:1706: CONSOLE ERROR Error: authClient has not been defined Worker: [DEBUG Δ228327us Nuvola] WebExtension.vala:282: Document loaded https://music.microsoft.com/UnsupportedBrowser Gtk-Message: Failed to load module "unity-gtk-module"

(eu.tiliado.NuvolaAppGroove:2): Gtk-WARNING **: Allocating size to WebKitWebViewBase 0x2126320 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? `

jiri-janousek commented 7 years ago

Is the https://music.microsoft.com/UnsupportedBrowser page loaded also after you press Home button with all user agent strings you have tried? Could you run flatpak run eu.tiliado.NuvolaAppGroove -D to get more info?

jrosco commented 7 years ago

@fenryxo I'm doing some test and I'll report back with the outputs. I have tried all user agents and I also tried to add a custom agent strings. Normally when hitting the home button it loads the player interface correctly but, if you try and play a song we get the https://music.microsoft.com/UnsupportedBrowser message. I'm not sure how groove is determining which user agent is being used.

jiri-janousek commented 7 years ago

It may also detect that a particular functionality is missing instead of parsing user agent string. You can try the devel branch of Nuvola CDK and enable Media Source Extension (MSE) with Feature[MSE] in metadata.in.json - requirements field.

jiri-janousek commented 7 years ago

@jrosco I've just tested your script with "requirements": "Codec[MP3] Feature[MSE]" and it works with Nuvola 4.6 (released today and includes MSE in stable builds).

Tasks for @jrosco:

Tasks for @fenryxo:

jrosco commented 7 years ago

@fenryxo To test do I only need to install the CDK and verify updates for this script work correctly?

Following these instructions https://github.com/tiliado/nuvolaruntime/wiki/Nuvola-Core-Developer-Kit

jiri-janousek commented 7 years ago

Sorry, I misled you. You should use Nuvola ADK to verify the changes.

jrosco commented 7 years ago

Hi @fenryxo I've installed the Nuvola ADK and getting the following error

bash-4.3$ nuvola -D -A ~/projects/nuvola-apps/ Gtk-Message: Failed to load module "unity-gtk-module" Master: [DEBUG Δ105304us Nuvola] XKeyGrabber.vala:190: Obtained a X11 Window for the display ':99.0'. Master: [DEBUG Δ003799us DioriteGtk] DesktopShell.vala:150: Shell: compiz (null), CSD 0, appmenu 1, menubar 1 Master: [WARNING Δ087395us Nuvola] WebAppRegistry.vala:122: Unable to load app from /home/joelc/projects/nuvola-apps/nuvola-app-groove: Web apps without a desktop launcher are no longer supported. Upgrade Nuvola SDK. Gtk-Message: Failed to load module "unity-gtk-module" Master: [DEBUG Δ232818us DioriteGtk] Application.vala:262: XFCE session vanished: org.xfce.SessionManager

I have added the following to my metadata.in.json "api_major": 4, "api_minor": 6 "requirements": "Codec[MP3] Feature[MSE]"

Although it did complain about metadata.json not existing so I copied my metadata.in.json to metadata.json and it runs but got the first error shown above. Any ideas? I'm sure I'm missing something simple :)

jiri-janousek commented 7 years ago

Although it did complain about metadata.json not existing so I copied my metadata.in.json to metadata.json

The metadata.json file must be generated with Nuvola SDK by running ./configure; make all. See Build a Project Using Nuvola SDK.

jrosco commented 7 years ago

@fenryxo Thanks. I have verified that the script now loads the web interface without any browser agent issues. Although I have come across some other issues in regards to getting music info and play/pause elements. I will create a separate issue for this.

jrosco commented 7 years ago

@fenryxo I've verified and committed my changes. Did you need me to do anything else? Shall I keep this issue open?

jiri-janousek commented 7 years ago

I've verified and committed my changes.

I cannot see the changes from https://github.com/tiliado/nuvola-app-groove/issues/6#issuecomment-318845409 anywhere.

Although I have come across some other issues in regards to getting music info and play/pause elements. I will create a separate issue for this.

Has this been addressed?

jrosco commented 7 years ago

ok, I'll make the changes for https://github.com/tiliado/nuvola-app-groove/issues/6#issuecomment-318845409 and commit.

Although I have come across some other issues in regards to getting music info and play/pause elements. I will create a separate issue for this.

Has this been addressed?

Yes, this has been addressed in commit https://github.com/tiliado/nuvola-app-groove/commit/ba45149501fad863e2cbd287a6faa29aecc1dbad

jiri-janousek commented 7 years ago

Great :-) Unless there is anything else to include in the next release, I'll release 2.0 as soon as your changes land. Could you also review a draft of the announcement?

jrosco commented 7 years ago

I've updated and commit changes for Nuvola 4.6 and MSE support 5fca4b2f01f63101ce3df74c21663bbe5720ff90

I reviewed the announcement and it looks good. Thanks

jiri-janousek commented 7 years ago

2.0 released. I'll close this issue once I rebuild packages.