dgy
/
hexagons
Archived
1
0
Fork 0

fixes: bandcamp (sacar codigo horrible). correo (formato de notificacion)

This commit is contained in:
deadguy 2019-04-29 19:20:27 -03:00
parent 794bf1b2d8
commit 33b76034a2
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
2 changed files with 6 additions and 5 deletions

View File

@ -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"

View File

@ -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 "$@"