Batch cover art downloader and embedder for audio files
Project description
get_cover_art
THE PROBLEM
Missing cover art for large imported music libraries.
EXISTING SOLUTIONS
-
Apple's Music App (and its predecessor iTunes) has a "Get Album Artwork" feature, but it isn't reliable and doesn't actually embed cover art into your audio files. That means if you move your music library elsewhere, you'll be missing all your album artwork.
-
Metadata utilities like Metadatics are great (and cheap if not free), but they can require a lot of manual interaction to go through each album and select artwork from search results. This can be forbidding for large libraries of thousands of albums.
THIS SOLUTION
This Python package will batch-update your entire library without manual interaction for each album.
It uses Apple Music's artwork, which is already standardized and high-quality. It also embeds the artwork directly into your audio files, so that it's independent of your player.
Supported formats (so far)
- MP3
- MP4 (.m4a)
- FLAC
Requirements
- Python 3.5 or greater
- Python packages: mutagen
Usage
From the Command Line
python -m get_cover_art [--path=<path_to_audio_file_or_folder>] [--test] [--other options]
--path PATH audio file, or folder of audio files (recursive)
--dest DEST destination of artwork
--test, --no_embed scan and download only, don't embed artwork
--no_download embed only previously-downloaded artwork
--inline put artwork in same folders as audio files
--force overwrite existing artwork
--verbose print verbose logging
--throttle wait X seconds between downloads
--skip_artists SKIP_ARTISTS
file containing artists to skip
--skip_albums SKIP_ALBUMS
file containing albums to skip
--skip_artwork SKIP_ARTWORK
file containing destination art files to skip
if you omit path
, it will scan the current working directory
Pro Tip: You can run with --test
first, then browse/prune the downloaded artwork, then run again with --no_download
to embed only the artwork you didn't prune.
From the Python Environment
from get_cover_art import CoverFinder
finder = CoverFinder(OPTIONS)
# then you can run either of these:
finder.scan_folder(PATH_TO_AUDIO_LIBRARY)
finder.scan_file(PATH_TO_AUDIO_FILE)
OPTIONS
is a dict of the same options listed for the commandline, e.g.--verbose
->{'verbose': True}
- you can omit
PATH_TO_AUDIO_LIBRARY
to default to your current directory - your
CoverFinder
object keeps a list of files_processed, files_skipped, files_failed, files_invalid
How it works
- First, it recursively scans your provided folder for supported files.
- Step 1 is skipped if you specified a single file instead of a folder.
- For each file without embedded artwork (or all files if
--force
is used), attempts to download from Apple Music based on artist and album metadata.
- Step 2 is skipped if it had already downloaded (or attempted to download) the image file.
- Step 2 is also skipped based on
--no_download
or--skip_*
options.
- If artwork is found, it's embedded into the audio file.
Why do you download from Apple Music and not Google image search?
- Google's Image Search API requires a dev token (so does Apple Music's API, but not its public web query URL).
- Google search queries are heavily throttled.
- Apple Music's cover sizes are standardized and sufficiently large.
Troubleshooting
The artwork is embedded now, but Apple's Music App still won't show it.
Try re-importing one of your embedded files. If the re-imported version shows artwork, you need to reimport your music library. You can do this without losing your playlists as follows:
- File->Library->Export Library... and name your exported library file.
- Visit Music->Preferences...->Files and screenshot your options. You'll need to restore them later.
- Quit the app and relaunch while holding down the Option key.
- Choose "Create Library..." and pick a new location.
- Visit Music->Preferences...->Files and restore your desired options.
- File->Library->Import Playlist... and choose your library file from step 1. (Yes, it's called "Import Playlist..." but you actually use this to import your library.)
Step 6 will take a while.
The artwork appears in Apple's Music App but not my iOS device.
You'll have to unsync all your music and re-sync it again. Try it with a single file first.
Project details
Release history Release notifications | RSS feed
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
Hashes for get_cover_art-1.3.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dd22fcc4494bf8198f8bb6c85de3e296d5a93f8a8e073b7744dcb608fcba7b8 |
|
MD5 | 802d640004e98e23453f6a6c5481270a |
|
BLAKE2b-256 | 44bd7870ae34e078485858b07e4a46a539f9dbf1dbc02d448e4612bbe0d02eee |