fixes: bandcamp (sacar codigo horrible). correo (formato de notificacion)
This commit is contained in:
parent
794bf1b2d8
commit
33b76034a2
|
@ -2,9 +2,10 @@
|
|||
set -euf -o pipefail
|
||||
|
||||
youtube-dl --add-metadata -icx --no-cache-dir --no-call-home --audio-format mp3 --audio-quality 0 --prefer-ffmpeg --no-post-overwrites --geo-bypass -o "$HOME/Music/Albums/%(artist)s/%(album)s/%(artist)s - %(album)s - %(track_number)d %(track)s.%(ext)s" "$1"
|
||||
curl -s "$1" > /tmp/pagina
|
||||
# este cat es una mierda. tendria que reescribir esto para no usarlo asi y cambiar los pipes y toda la pindonga
|
||||
titulo=$(cat /tmp/pagina | grep -Po "<title>.*</title>" | sed 's/<[^>]*>//g')
|
||||
|
||||
HTML_TEMP=$(mktemp)
|
||||
curl -s "$1" > "$HTML_TEMP"
|
||||
titulo=$(grep -Po "<title>.*</title>" "$HTML_TEMP" | sed 's/<[^>]*>//g')
|
||||
disco=${titulo% | *}
|
||||
grupo=${titulo#* | }
|
||||
sed -n '/image_/s/.*rel="image_src"\s\+href="\([^"]\+\).*/\1/p' /tmp/pagina | xargs -r curl -s --create-dirs -o "$HOME"/Music/Albums/"$grupo"/"$disco"/cover.jpg
|
||||
sed -n '/image_/s/.*rel="image_src"\s\+href="\([^"]\+\).*/\1/p' "$HTML_TEMP" | xargs -r curl -s --create-dirs -o "$HOME/Music/Albums/${grupo}/${disco}/cover.jpg"
|
||||
|
|
|
@ -6,7 +6,7 @@ pgrep -x mbsync >/dev/null && echo "mbsync already running." && exit
|
|||
|
||||
export DISPLAY=:0.0
|
||||
|
||||
notify() { notify-send " $2 new mail(s) in \`$1\` " ;}
|
||||
notify() { notify-send "You've got mail" " $2 new message(s) in \`$1\` " ;}
|
||||
|
||||
# Run mbsync. You can feed this script different settings.
|
||||
mbsync -a "$@"
|
||||
|
|
Reference in New Issue