gpm-to-itunes#
Adds your GPM library to iTunes.
Your tracks' date added and play counts will be kept, as well as last played date, year, album artist, composer, comment, track number, track count, genre, disc number and disc count is kept as well.
If you have any tracks already in iTunes, they will be matched with GPM tracks so that you don't end up with duplicates. If this happens:
- The iTunes file and "date added" will be kept
- The play counts will be combined
- The most recent "played date" will be used
- The GPM track's year, album artist, composer, comment, track number, track count, genre, disc number, disc count, title, artist and album will be used.
In iTunes, a playlist folder named "GPM PLAYLISTS" will be created. GPM user playlists will be added into it.
GPM tracks will not keep their thumbs up or thumbs down ratings when they're added to iTunes. Instead, they will be added to two playlists that will be created, named "GPM Thumbs Up" and "GPM Thumbs Down". They will be put inside the "GPM PLAYLISTS" playlist folder.
Guide#
- Setup
- Use macOS.
- Install Python 3 from python.org.
- CREATE A BACKUP OF YOUR ITUNES FOLDER (~/Music/iTunes) in case something goes wrong.
- Run
python3 -m pip install gmusicapi appscript mp3_tagger tqdmto install some stuff gpm-to-itunes needs. - Create the
options.pyfile. Follow the example shown below.
- Download
- Run
python3 main.py loginto log in to GPM. Instructions will be shown. - Run
python3 main.py fetch. This downloads metadata from GPM and restructures it. - Download your GPM library's songs to a folder using Music Manager. This can take hours. Don't move this folder anywhere before you're done with gpm-to-itunes.
- Run
- Preparations
- Run
python3 main.py match_files <songs_path>. Replacesongs_pathwith the path of the folder you downloaded your GPM library's song files into. This command will connect the files to the metadata. - If you have tracks that exist in both iTunes and GPM, but have different titles, artists and/or albums, you can create an
md_map.jsonfile, which will make gpm-to-itunes match those songs together, so you won't end up with duplicates. If you think you may have made some mistakes, runningpython3 check_md_map.pycan help spot some of them. - If you have tracks in iTunes, run
python3 main.py scan_itunes(Optional but recommended). It will tell you:- When it finds tracks that already exist in your GPM library.
- When it finds duplicate tracks in iTunes (tracks with equal titles, artists and albums). If there are, a GPM track would match one of them randomly.
- When tracks in iTunes don't match up with any GPM track. To make these easier to add to
md_map.json, they are logged in the format the file uses.
- Run
- Importing to iTunes
- Disconnect from internet. We'll be changing the system's date and time to preserve the "date added", and this causes iTunes to show popups that pause gpm-to-itunes.
- Run
python3 add_to_itunesto add the tracks to iTunes. It will set the system's date and time to preserve the "date added", then adds it to iTunes and updates it's metadata. - Reconnect to the internet.
- Open "Date & Time" in the System Preferences app, and make sure the date and time is right, and that the "Set date and time automatically" option is what you prefer (It's usually on).
- Done!
Running main.py#
Run gpm-to-itunes using python3 main.py [action] [songs_path].
This is gpm-to-itunes itself. Run it using python3 main.py [action] [songs_path].
actionspecifies what gpm-to-itunes will do. It be any of the following:download: This will download and save your GPM library's metadata tolibrary_downloaded.json.restructure: This just does some changes tolibrary_downloaded.jsonand saves the new version aslibrary_restructured.json.match_filesscan_itunesadd_to_itunes
songs_pathis only needed with thematch_filesaction. It specifies wheresongs_pathis the path to the folder with your GPM songs, and you only need it when running with thematch_filesaction. If you don't provide anactionorsongs_path, then theactionandsongs_pathfields from theoptions.pyfile will be used. This is especially useful if you want to use nodemon
user_files/md_map.json#
A file that you can use to map GPM tracks to it's iTunes equivalents. Use this if you have a GPM track that already exists in iTunes, but with a different title, artist or album. Example:
{
"gpm_title - gpm_artist - gpm_album": {
"title": "itunes_title",
"artist": "itunes_artist",
"album": "itunes_album"
},
"Surface - Aero Chord - ": {
"title": "Surface",
"artist": "Aero Chord",
"album": "Monstercat: 017 - Ascension"
},
}