CLI to download music independently and from your exported Apple Music library.
Project description
๐ง Amusing ๐ธ
A CLI to download music independently and from your exported Apple Music library.
Why should you use Amusing?
- 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!
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.
โจ Getting set up
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.
๐ฌ Available commands
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. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Parse an exported Library.xml
file from your Apple Music account
Library.xml
file from your Apple Music accountYou 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'
Download the entire exported Apple Music library
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
Download an individual song
$ 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"
Search for a similar song, album or artist in your DB/downloads
$ 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 โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
๐ ๏ธ Library customization
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'
!
๐ TODO
- 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file amusing_app-0.2.1.tar.gz
.
File metadata
- Download URL: amusing_app-0.2.1.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.2 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7a2aac97736ef40881facc45e57227ce9830a6787f629bcd26424dd8acc40db |
|
MD5 | 91a3ef7d6886fbf2ee2cb57544613583 |
|
BLAKE2b-256 | 79ace1b1a23698ec41406d00a23a54b39b2d0f43257b4634f818b2fec720a4b2 |
File details
Details for the file amusing_app-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: amusing_app-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.2 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c6601edbffee5e94eb7deef1254962d24075828fe14b2c0f847eb6aee8124dd |
|
MD5 | fe77cdb5a4a60dc4611bf7c787df75cb |
|
BLAKE2b-256 | 7f688d92d701e971b3a2c6fdcedeca52b38e1c65d076f8fc6c125c0a5fb5b8d4 |