A CLI to download music independently and from your exported Apple Music library.
- To download your entire Apple Music Library and store it locally in one go
- To search and download individual songs from YouTube
- To keep track of your ever growing music collection
Install it as a PyPI package:
pip install amusing-app
You will also need FFmpeg installed, which is required to embed song metadata (title, artist, album, cover art, ...) in the audio file.
There are three things to know before moving on to the next section:
-
The CLI takes in a
appconfig.yaml
file similar to what's indicated inappconfig.example.yaml
. You can simply rename it.The file looks like this:
root_download_path: "..." db_name: "..."
The file can be placed in two locations:
~/Downloads/Amusing/appconfig.yaml
: default one. If the file is not found anywhere it will be created here.~/.config/amusing/appconfig.yaml
: only if the default one does not exist.
-
A dedicated sqlite database called
db_name
will be created inroot_download_path/db_name.db
to store two tablesSong
andAlbum
as defined inamusing/db/models.py
. All songs downloaded locally will be getting a row in theSong
table and a row for their corresponding album in theAlbum
table. -
The songs are downloaded in
root_download_path/songs
directory. -
That's it. You're done. Let's look at the commands available next.
There are currently 7 commands available, excluding the amusing --version
.
The first time you run a command (eg. --help
), an Amusing
directory will be created in the ~/Downloads
folder.
For eg., on MacOS, it's in /Users/Username/Downloads
.
$ amusing --help
Usage: amusing [OPTIONS] COMMAND [ARGS]...
CLI to download music independently and from your exported Apple Music library.
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --version -v โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ download Download the entire DB library. โ
โ parse Parse the entire Apple Music library and make/update the โ
โ DB as needed. โ
โ showsimilar Look up the db and show if similar/exact song(s) are โ
โ found. โ
โ showsimilaralbum Look up the db and show albums similar to the album โ
โ searched. โ
โ showsimilarartist Look up the db and show songs for similar/exact artist โ
โ searched. โ
โ song Search and download the song and add it to the db. Creates โ
โ a new album if not already present. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
You can also use a previously parsed Library.csv
, that already contains mappings with YouTube video IDs and possible URLs to download custom album artworks.
$ amusing parse --help
Usage: amusing parse [OPTIONS] LIBRARY_PATH
Parse the entire Apple Music library and make/update the DB as needed.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ * library_path TEXT The path to the 'Library.xml' or 'Library.csv' โ
โ exported from Apple Music. โ
โ [default: None] โ
โ [required] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# Example
$ amusing parse 'your/path/to/Library.xml'
You can also pass a Library.xml
or Library.csv
file to parse before downloading the songs.
$ amusing download --help
Usage: amusing download [OPTIONS] [LIBRARY_PATH]
Download the entire DB library.
If passed, parse the library and update the DB before download.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ library_path [LIBRARY_PATH] The path to the 'Library.xml' or โ
โ 'Library.csv' exported from Apple Music. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# Example
$ amusing download 'your/path/to/Library.xml'
# Is equivalent to run
$ amusing parse 'your/path/to/Library.xml'
$ amusing download
$ amusing song --help
Usage: amusing song [OPTIONS] NAME ARTIST ALBUM
Search and download the song and add it to the db. Creates a new album if not
already present.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ * name TEXT Name of the song. [default: None] [required] โ
โ * artist TEXT Aritst of the song. [default: None] [required] โ
โ * album TEXT Album the song belongs to. [default: None] [required] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --force --no-force Overwrite the song if present. [default: no-force] โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# Example, the search keywords need not be exact of course:
$ amusing song "Run" "One Republic" "Human"
$ amusing showsimilar "Someday"
Song to look up: someday
โโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Song โ Artist โ Album โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Someday โ OneRepublic โ Human (Deluxe) โ
โ Someday At Christmas โ Justin Bieber โ Under the Mistletoe (Deluxe Edition) โ
โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
$ amusing showsimilarartist "OneRepublic"
Artist to look up: OneRepublic
โโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Song โ Artist โ Album โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Run โ OneRepublic โ Human (Deluxe) โ
โ Someday โ OneRepublic โ Human (Deluxe) โ
โ No Vacancy โ OneRepublic โ No Vacancy - Single โ
โ RUNAWAY โ OneRepublic โ RUNAWAY - Single โ
โ Sunshine โ OneRepublic โ Sunshine - Single โ
โ I Ain't Worried โ OneRepublic โ Top Gun: Maverick (Music from the Motion Picture) โ
โ West Coast โ OneRepublic โ West Coast - Single โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
$ amusing showsimilaralbum "Human"
Album to look up: Human
โโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโ
โ Album โ Number of songs โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Human (Deluxe) โ 2 โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
The resulting Library.csv
file will be automatically updated by Amusing at every DB change.
You can manually modify it to change which YouTube video to download for a specific song. You can also add a custom URL to download a specific album artwork.
Here are some great tools you can use to find album artworks:
Copy the image link into your CSV file and Amusing will download it and embed it into your song the next time you run amusing download '/path/to/Library.csv'
!
- Provide an option to choose which searched result is downloaded.
- Provide a command to show all songs in an album
- Provide a command to download a song from youtube link
- Better metadata availability (Musicbrainz, Discog etc)
- Coverarts (Musicbrainz, somewhere else?)
- Lyrics!
- Export playlists from Apple Music
- Look at which music player to integrate with, make changes to architecture of the library accordingly. The Music player needs to have:
- Aesthetic UI, intuitive UX similar to Apple Music or Spotify
- Play count, gapless playback, fade-in-out playback
- Docker compose support