Apple Music Metadata Grabber (ammg)
ammg is a tool for appending metadata to music files from Apple Music. Mainly files downloaded from Youtube Music (not youtube), because Youtube Music (albums/singles/ep) and Apple Music (albums) holds the same song info...
With ammg you choose your youtube music songs, and you choose which metadata.
Note: Supported file types are m4a and opus. Using opus is better than m4a because the best quality available on youtube is opus.
However m4a is used if you want to open the files in iTunes and sync them to your iPhone/iPad.
Installation
You can download ammg using pip:
pip install --upgrade ammg
Usage
- First: Choose your song, album, or single.
- Second: Download the album playlist from Youtube Music.
- Third: Copy the album ID from the search bar from Apple Music.
Example: We will be downloading Scary Pockets, Elise Trouw - Careless Whisper (feat. Dave Koz).
- Apple Music link: https://music.apple.com/us/album/careless-whisper-feat-dave-koz-single/1681177202
- Album ID: 1681177202
- Youtube Music link: https://music.youtube.com/playlist?list=OLAK5uy_kVIMiCrxX4gmnZI-IufqRvJte6Hk3NTbY
Notice: the Youtube Music link is a playlist. By downloading using the playlist (album link), you will be able to add metadata without manual intervetion.
Command Process: Download the music using yt-dlp (make sure you download yt-dlp first).
- Downloading
.opusfile usingyt-dlp:
yt-dlp -cw -o "music/%(title)s.%(ext)s" -x --audio-quality "0" "https://music.youtube.com/playlist?list=OLAK5uy_kVIMiCrxX4gmnZI-IufqRvJte6Hk3NTbY"
- Downloading
.m4afile usingyt-dlp:
yt-dlp -cw -o "music/%(title)s.%(ext)s" -x --audio-format m4a --audio-quality "0" "https://music.youtube.com/playlist?list=OLAK5uy_kVIMiCrxX4gmnZI-IufqRvJte6Hk3NTbY"
This will download Careless Whisper in the
music folder. So the path of the downloaded
song will be music/Careless Whisper (feat. Dave Koz).opus.
Adding the metadata using ammg:
Required arguments:
-i: Apple album id.-o: Output directory.- The directory where the file will be once it is saved.
positional argument: heremusicwhere the downloaded song is.
ammg get -i 1681177202 -o Ordered_Music music
If you are querying a lot of songs in one session,
it is adviced to use --do-not-check-token.
ammg get --do-not-check-token -i 1681177202 -o Ordered_Music music
After embedding metadata, the file will be
moved to Ordered_Music/S/Scary Pockets & Elise Trouw/Careless Whisper (feat. Dave Koz) - Single/. That way we will have an ordered music
library.
Simplifying our work
We can using bash scripting on Linux, to created
alias or functions that simplify our work, and
make the process faster.
Alias domus to download music:
alias domus='yt-dlp -cw -o "music/%(title)s.%(ext)s" -x --audio-quality "0"'
A shell function that accepts a link and album id:
domuspp() {
domus "$1";
ammg get --do-not-check-token -i "$2" -o Ordered_Music music;
}
Release files for ammg 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ammg-0.2.2.tar.gz | 36.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ammg-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.6 kB
Release files / ammg-0.2.2.tar.gz
| Download URL | ammg-0.2.2.tar.gz |
|---|---|
| Size | 36.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec83a4c811ec4fa731506b06b07cc95815cd750ada22fbe4255c2f53096a6d49
|
|
BLAKE2b-256 checksum How to use checksums |
133dfa13bc6f9f2b434861d07b31c29cfc59b2b5619f490decdd026b228114f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / ammg-0.2.2-py3-none-any.whl
| Download URL | ammg-0.2.2-py3-none-any.whl |
|---|---|
| Size | 37.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d49874b1ffa3f29fe2f235e9624c3a2e77b08f62caee8e59cd5cce8eaf501abc
|
|
BLAKE2b-256 checksum How to use checksums |
8e28a84b518b7a23612ed4f6a366ebe1e274fac09c2c2e809bc273b532fab7ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|