Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you want to export you whole Spotify library, simply create a new playlist ca
In order to add songs to our Apple Music library, we need their Apple Music identifier. Running `python3 retrieve-identifiers.py` will use the *spotify.csv* file to create a new file *itunes.csv* with each line consisting of the Apple Music identifier of a song in your Spotify library.

### 3. Use an intercepting proxy to retrieve the Apple Music request headers
Start iTunes and [Charles](http://www.charlesproxy.com) (or another intercepting proxy you like). Make sure SSL Proxying is enabled and working correctly. Next, select a random song on Apple Music you don't have in your library yet, right click and choose 'Add to library'. If everything went well, you're now able to view all the request headers in Charles of a request to `https://ld-4.itunes.apple.com/WebObjects/MZDaap.woa/daap/databases/1/cloud-add`. We're only interested in `Cookie`, `X-Dsid` and `X-Guid`. Copy the value of these header and paste them in the appropriate place in `insert-songs.py` (line 29 and further).
Start iTunes and [Charles](http://www.charlesproxy.com) (or another intercepting proxy you like). Make sure SSL Proxying is enabled and working correctly. Next, select a random song on Apple Music you don't have in your library yet, right click and choose 'Add to library'. If everything went well, you're now able to view all the request headers in Charles of a request to `https://ld-4.itunes.apple.com/WebObjects/MZDaap.woa/daap/databases/1/cloud-add`. ~~We're only interested in `Cookie`, `X-Dsid` and `X-Guid`.~~ From the issue reposts, we now recommend you to change the value of `Cookie`, `X-Dsid`, `X-Guid`, `User-Agent` and `X-Apple-Store-Front`. Copy the value of these header and paste them in the appropriate place in `insert-songs.py` (line 29 and further).
Next, run `python3 insert-songs.py` and go grab a coffee. You're songs are now being imported into Apple Music.


Expand Down
4 changes: 2 additions & 2 deletions insert-songs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ def add_song(itunes_identifier):
data = construct_request_body(int(time.time()), itunes_identifier)

headers = {
"X-Apple-Store-Front" : "143446-10,32 ab:rSwnYxS0",
"Client-iTunes-Sharing-Version" : "3.12",
"Accept-Language" : "nl-nl, nl;q=0.83, fr-fr;q=0.67, fr;q=0.50, en-us;q=0.33, en;q=0.17",
"Client-Cloud-DAAP-Version" : "1.0/iTunes-12.2.0.145",
"Accept-Encoding" : "gzip",
"X-Apple-itre" : "0",
"Client-DAAP-Version" : "3.13",
"User-Agent" : "iTunes/12.2 (Macintosh; OS X 10.10.4) AppleWebKit/0600.7.12",
"Connection" : "keep-alive",
"Content-Type" : "application/x-dmap-tagged",
# Replace the values of the next three headers with the values you intercepted
"User-Agent" : "**REPLACE THIS**",
"X-Apple-Store-Front" : "**REPLACE THIS**",
"X-Dsid" : "**REPLACE THIS**",
"Cookie" : "**REPLACE THIS**",
"X-Guid" : "**REPLACE THIS**",
Expand Down