[bglug] Cover art downloader

Joe Galaxy joegalaxy@gmail.com
Gio 1 Dic 2011 11:42:54 CET


Io so che lo volevate.
XD
Senza installare pytonesse et similia, ecco quello che fa per voi.
Digitate nome dell'artista e titolo dell'album e vi scaricherà quante
cover e in che grandezza volete in una dir con lo stesso nome.
Poi, con calma, sceglierete quella che più vi aggrada.
Versione 0.1, volante (è più lungo il disclaimer del prog).

----8<---- CUT HERE ----8<---- 
#!/bin/bash
# Time-stamp: <coverdl, 1/12/2011 11:34:59 joe Exp>
# Copyright (c) 2011, Joe Galaxy <joegalaxy[at]gmail[dot]com>
# All rights reserved.

# REDISTRIBUTION and  use in  source and binary  forms, with  or without
# modification, are permitted provided that the following conditions are
# met:

#     * Redistributions of  source code must retain  the above copyright
#       notice, this list of conditions and the following disclaimer.
    
#     * Redistributions  in   binary  form  must   reproduce  the  above
#       copyright  notice, this  list  of conditions  and the  following
#       disclaimer in the  documentation and/or other materials provided
#       with the distribution.
    
#     * Neither the name of Joe Galaxy nor the names of its contributors
#       may be  used to  endorse or promote  products derived  from this
#       software without specific prior written permission.

# THIS SOFTWARE  IS PROVIDED BY  THE COPYRIGHT HOLDERS  AND CONTRIBUTORS
# "AS  IS" AND  ANY EXPRESS  OR IMPLIED  WARRANTIES, INCLUDING,  BUT NOT
# LIMITED TO, THE IMPLIED  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE  ARE DISCLAIMED. IN NO EVENT  SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES (INCLUDING,  BUT  NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE  GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS  INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF  LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY,  OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING  IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Usage: coverdl <artist> <album>

## quante ne vuoi?
hmany="5"
## small, medium, large
size="medium"
#######################
query=`echo "$*" | sed -e 's/+/%2b/g;s/"/%22/g;y/ /+/'`
outdir=`echo $query | sed 's/+/_/g'`
get=`links -dump "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=$query&as_filetype=jpg&imgsz=$size&rsz=$hmany" | awk -F"\"unescapedUrl\":" '{print $2}' | awk -F"," '{print $1}' | sed -e '/^$/d' -e 's/\"//g'`
mkdir -p "$outdir"
cd "$outdir"
wget $get
----8<---- CUT HERE ----8<----

Occhio a non tagliare le righe.

-- 
$(echo 502625742692402704447754P|dc)@gmail.com


Maggiori informazioni sulla lista bglug