Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Smart Automatic Cover Art Downloader

Just as the name says, here is where you can post tips and tricks to share with other users of MEPIS.
Post Reply
Message
Author
sunrat
Forum Regular
Forum Regular
Posts: 145
Joined: Mon Mar 28, 2016 9:54 pm

Smart Automatic Cover Art Downloader

#1 Post by sunrat » Fri Jun 01, 2018 10:36 am

It's not often a program blows me away by doing something that I have spent many hours on in the past with a single command. This is such a program.
Smart Automatic Cover Art Downloader is a Python3 program which will search and download album covers for music. It can do a single album at a time or your whole collection at once! It saves the covers in the album directory or can optionally embed them in the music files. CLI only but don't let that put you off, it's as easy as py. :)
You need Python >= 3.5
Install pip:

Code: Select all

apt install python3-pip
Install SACD:

Code: Select all

pip3 install sacad
Here's one I tried:

Code: Select all

$ sacad "Cary Brothers" "Under Control" 500 cover.png
Main: jpegoptim could not be found, JPEG crunching will be disabled
Main: optipng could not be found, PNG crunching will be disabled
LastFmCoverSource: Got 0 relevant (5 excluded) results from source 'LastFmCoverSource'
AmazonCdCoverSource: Got 2 relevant (0 excluded) results from source 'AmazonCdCoverSource'
AmazonDigitalCoverSource: Got 1 relevant (0 excluded) results from source 'AmazonDigitalCoverSource'
GoogleImagesWebScrapeCoverSource: Got 15 relevant (5 excluded) results from source 'GoogleImagesWebScrapeCoverSource'
Cover: Reference is: LastFmCoverSourceResult 'https://lastfm-img2.akamaized.net/i/u/300x300/273d2c3921bf4f8990b5d7b3c27b68f9.png'
Cover: Downloading cover 'https://images-na.ssl-images-amazon.com/images/I/51wO11jhSML.jpg' (part 1/1)...
Cover: Converting to PNG...
Install jpegoptim and optipng if you want to crunch the images.

It will also download covers for every album in a specified directory with sacad_r . I tried it on a directory with 17 albums and the only one it didn't find was a bootleg Grateful Dead album. Magic!

Github page - https://github.com/desbma/sacad

User avatar
rich
Forum Regular
Forum Regular
Posts: 287
Joined: Sat Mar 31, 2018 6:39 pm

Re: Smart Automatic Cover Art Downloader

#2 Post by rich » Fri Jun 01, 2018 12:03 pm

sunrat wrote:
Fri Jun 01, 2018 10:36 am
it's as easy as py. :)
XD nice

This is wicked cool! Just wanted to throw it out there, for python3-pip to work, it needs its recommended packages, I don't know if it's packaged wrong or what but if you just grab it without them, it gives gnarly errors like

Code: Select all

$ pip3 install sacad
Collecting sacad
  Downloading https://files.pythonhosted.org/packages/bb/45/07acb06012e241fa2cc1b18f7ae789e55f01ecf94db67ddbb39b80772480/sacad-2.1.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'setuptools'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0__hymde/sacad/
So unless you've already adjusted your system, make sure to use

Code: Select all

apt --install-recommends python3-pip
MX 17.1 Dell Inspiron N5110

sunrat
Forum Regular
Forum Regular
Posts: 145
Joined: Mon Mar 28, 2016 9:54 pm

Re: Smart Automatic Cover Art Downloader

#3 Post by sunrat » Fri Jun 01, 2018 9:28 pm

I tested this in siduction which has decided that recommends should be installed by default now as they are more sensible than they used to be. Only checked to make sure MX has the correct version of Python. I mainly posted this after searching and finding it when motivated by a post here in the Spanish subforum.
There is an AUR package, maybe one could be built for MX/Debian.

It certainly is wicked cool! Will save many hours.

User avatar
KoO
Forum Regular
Forum Regular
Posts: 225
Joined: Fri Feb 10, 2017 1:21 am

Re: Smart Automatic Cover Art Downloader

#4 Post by KoO » Fri Jun 01, 2018 11:36 pm

pip3 install -U setuptools = do this if you get and egg error.. [sudo] ?
or
pip install -U setuptools
Da Main Box .. Antix 17.1 i3 Intel Xeon E3-1241 v3 , 16gb HyperX , Samsung EVO M2 250 GB , Samsung EVO SSD 500 GB , GTX 970 , Tascam US 2x2
Lappy .. Lenovo T430 AntiX17.1 i3 ,blowdozs8.1 , i5 +4000 , 12gb , Samsung EVO 860 250 GB , 1TB HGST , 1600x900

Post Reply

Return to “Tips&Tricks”