Userscripts icon indicating copy to clipboard operation
Userscripts copied to clipboard

iTunes importer script no longer works

Open mhendu opened this issue 4 years ago • 21 comments

I've checked a few releases and am no longer seeing the button appear on any Apple Music release page.

mhendu avatar Apr 10 '20 19:04 mhendu

I hope this script is not dead.

al1ydn avatar Apr 12 '20 16:04 al1ydn

Yes, i have the same problem It would be great to fix that, i still use it everyday and i'm lost without it!

phokonte avatar Apr 14 '20 09:04 phokonte

The problem is that I don't really use it now. If someone is willing to step up, I'll be more than happy to help them with code, and give them merge rights.

dufferzafar avatar Apr 14 '20 16:04 dufferzafar

I have limited experience as a developer and I don't know JavaScript at all so not sure if I can really help with this - but I did note that in looking at the Chrome console the script was getting hung up on the 'slice' call in the addArtworkLink function. If you replace line 125 with this it appears to work correctly now:

var src = srcset.split(',')[1].slice(0, -3);

mhendu avatar Apr 14 '20 19:04 mhendu

Where does the musicbrainz button appear when it's working? I've never used it until now. I tried the line 125 replacement in Tampermonkey in Chrome for Windows but I don't see a musicbrainz button. Trying on this page: https://music.apple.com/ca/album/simple-symphony-for-string-orchestra-op-4-iii-sentimental/418806461

chuckkahn avatar Apr 15 '20 23:04 chuckkahn

Yes, after replacing line 125 it works for me on that page. The button appears below the artwork on the left. If it doesn't appear after the page finishes loading try reloading the page. I find if you don't directly navigate to the page the button tends not to appear, unless you refresh the page.

mhendu avatar Apr 16 '20 00:04 mhendu

Okay I made that line 125 change and also replaced two instances of GM.xmlHttpRequest with GM_xmlhttpRequest.

https://github.com/dufferzafar/Userscripts/compare/master...chuckkahn:patch-1

chuckkahn avatar Apr 16 '20 00:04 chuckkahn

itunes.apple.com album pages don't exist anymore. Script doesn't work anymore, I'll try to fix it.

EDIT : fix here #25

damienmauchamp avatar Apr 17 '20 12:04 damienmauchamp

The script seems once again not to work due to a new change on apple's website, anybody to fix it ? thank you very much

phokonte avatar Dec 14 '20 15:12 phokonte

The script seems once again not to work due to a new change on apple's website, anybody to fix it ? thank you very much

Mine is working fine, here's the link of the gist.

damienmauchamp avatar Dec 14 '20 19:12 damienmauchamp

Thank you very much, it works perfectly! The buttons to add the album to MusicBrainz and to access the cover have changed position (and colors to better adapt to the apple site), that's great but I didn't see them at first and I thought it didn't work. So if there are others in my case, the buttons are below the tracklist

And last thing: if anyone has time, it could be useful to have the label automatically entered each time, I don't know if it's possible but it could save some time. (I know very little about it so I'm not able to do it myself)

phokonte avatar Dec 18 '20 14:12 phokonte

Thank you very much, it works perfectly! The buttons to add the album to MusicBrainz and to access the cover have changed position (and colors to better adapt to the apple site), that's great but I didn't see them at first and I thought it didn't work. So if there are others in my case, the buttons are below the tracklist

And last thing: if anyone has time, it could be useful to have the label automatically entered each time, I don't know if it's possible but it could save some time. (I know very little about it so I'm not able to do it myself)

I've just updated my gist and added label names.

damienmauchamp avatar Dec 18 '20 15:12 damienmauchamp

@damienmauchamp Would you consider sending a pull request with your fix?

augustjanse avatar Dec 19 '20 07:12 augustjanse

I've added the updated gist but I do not see any button yet. Is this gist still working? If yes, can you please post a screenshot of a page with the button so I know what to expect? Thanks!

Update: It works fine with Tampermonkey and in Chrome, but not in Firefox.

neo-apz avatar Feb 20 '21 20:02 neo-apz

I've added the updated gist but I do not see any button yet. Is this gist still working? If yes, can you please post a screenshot of a page with the button so I know what to expect? Thanks!

Update:

It works fine with Tampermonkey and on Chrome, but not on Firefox.

The button should be at the bottom of the tracklist.

damienmauchamp avatar Feb 20 '21 21:02 damienmauchamp

@damienmauchamp - It doesn't work in Firefox with Greasemonkey, the error is: GM_xmlhttpRequest is not defined

Changing GM_xmlhttpRequest to GM.xmlHttpRequest fixes the issue with Greasemonkey 4.11 and looks to work in Tampermonkey as well.

Would you fix that and open a PR for this repo, or would you mind if I did with your gist and this change?

mtrolley avatar Feb 26 '21 01:02 mtrolley

I've changed GM_xmlhttpRequest to GM.xmlHttpRequest but I don't see any button on this page:

https://music.apple.com/ca/album/opus-bach-orgelwerke-organ-works-vol-1/1482497370?l=th

Where do I check for errors?

chuckkahn avatar Mar 08 '21 22:03 chuckkahn

I've changed GM_xmlhttpRequest to GM.xmlHttpRequest but I don't see any button on this page:

https://music.apple.com/ca/album/opus-bach-orgelwerke-organ-works-vol-1/1482497370?l=th

Where do I check for errors?

Did you change it in both places? It needs to be changed in two.

Look in the Web Console for errors: Menu >> Web Developer >> Web Console

I tried your link and have the "Add to MusicBrainz" button at the bottom, just above "More by Peter Kofler."

mtrolley avatar Mar 09 '21 00:03 mtrolley

Ah the web console reported:

userscript.html?name=MusicBrainz%3A%20Import%20from%20iTunes.user.js&id=0c797dab-be46-4fb2-98d2-be439803bba5:1 ERROR: Execution of script 'MusicBrainz: Import from iTunes' failed! GM_xmlHttpRequest is not defined"

So I changed the second GM_xmlHttpRequest

Now that error is gone. But I don't see the button.

image

chuckkahn avatar Mar 09 '21 22:03 chuckkahn

This works for me on that page: https://gist.github.com/trolley/1c8519d2df617c7951a8246859139104

mtrolley avatar Mar 10 '21 02:03 mtrolley

Yes it does. Thanks! (Doesn't bring in Johan Sebastien Bach as artist though.)

chuckkahn avatar Mar 10 '21 21:03 chuckkahn