Skip to main content

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

  1. 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.

  2. 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)

Requirements

  • Python 3.5 or greater
  • Python packages: mutagen

Usage

From the Command Line

python get_cover_art.py --path=<path_to_audio_library> [--test] [--other options]

  --path PATH           folder to recursively scan for music
  --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 music files
  --verbose             print verbose logging
  --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 LibraryScanner

scanner = LibraryScanner(options={})
(processed, skipped, failed) = scanner.scan_folder(PATH_TO_AUDIO_LIBRARY=".")

where options is a dict of the same options listed for the commandline, e.g. --verbose -> {'verbose': True}

How it works

  1. First, it scans your audio library for supported files.
  2. For each file without embedded artwork, looks for a local cover image based on the artist and album metadata.
  3. If the cover image doesn't exist locally, attempts to download from Apple Music.
  4. Maintains a cache file (i.e. skip_artwork option) to skip repeated attempts to download the same artwork.
  5. If artwork is found, it's embedded into the audio file.

Why do you download from Apple Music and not Google image search?

  1. Google's Image Search API requires a dev token (so does Apple Music's API, but not its public web query URL).
  2. Google search queries are heavily throttled.
  3. 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:

  1. File->Library->Export Library... and name your exported library file.
  2. Visit Music->Preferences...->Files and screenshot your options. You'll need to restore them later.
  3. Quit the app and relaunch while holding down the Option key.
  4. Choose "Create Library..." and pick a new location.
  5. Visit Music->Preferences...->Files and restore your desired options.
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

get_cover_art-1.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

get_cover_art-1.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file get_cover_art-1.1.0.tar.gz.

File metadata

  • Download URL: get_cover_art-1.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for get_cover_art-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d65074b8af9527f31f1f3d89e8a1196302a77be2803307324b446026bdc794a6
MD5 0f8c89fa7a2e00cb166aeba3479d8d22
BLAKE2b-256 1a0e719f2b5f3714a78e35456dd7e7e4e064a08d84e9d83580b84a2253d06f34

See more details on using hashes here.

File details

Details for the file get_cover_art-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: get_cover_art-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for get_cover_art-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 585f7fadb67f7534812602a91b040ebd04af4bbd21958b83361cea4493a0fcac
MD5 b54a33fcbfcecad3c68f140927bb1246
BLAKE2b-256 02acad6b4e2afe16a06ba01d820b158716cdcdb8af35cf77e58b50b1471c1c2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page