Last active
January 9, 2017 22:43
-
-
Save slawekzachcial/73b45c9d624fb5b6cdd07e187553d565 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration based on | |
# http://www.andrews-corner.org/linux/abcde/index.html and | |
# http://www.andrews-corner.org/linux/abcde/getalbumart.html | |
LOWDISK=n | |
CDDBMETHOD=musicbrainz | |
ACTIONS=cddb,read,getalbumart,encode,tag,move,playlist,clean | |
OUTPUTTYPE="flac,mp3" | |
LAMEOPTS='-V 2' | |
FLACOPTS='-s -e -V -8' | |
OUTPUTDIR=/tmp/music | |
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM} ${TRACKFILE}' | |
VAOUTPUTFORMAT='${OUTPUT}/Various Artists/${ALBUMFILE}/${TRACKNUM} ${ARTISTFILE} - ${TRACKFILE}' | |
ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${ALBUMFILE}' | |
VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various Artists/${ALBUMFILE}/${ALBUMFILE}' | |
PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${ALBUMFILE}.m3u' | |
VAPLAYLISTFORMAT='${OUTPUT}/Various Artists/${ALBUMFILE}/${ALBUMFILE}.m3u' | |
mungefilename () | |
{ | |
echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]" | |
} | |
post_encode () | |
{ | |
ARTISTFILE="$(mungefilename "$TRACKARTIST")" | |
ALBUMFILE="$(mungefilename "$DALBUM")" | |
YEAR=${CDYEAR:-$CDYEAR} | |
#------ Find multiple output formats -----# | |
for OUTPUT in $(echo $OUTPUTTYPE | tr , \ ) | |
do | |
#-------- Find the output directory ------# | |
if [ "$VARIOUSARTISTS" = "y" ] ; then | |
FINDPATH="$(eval echo "$VAOUTPUTFORMAT")" | |
else | |
FINDPATH="$(eval echo "$OUTPUTFORMAT")" | |
fi | |
FINALDIR="$(dirname "$OUTPUTDIR/$FINDPATH")" | |
cd "$FINALDIR" | |
#----- Instructions for each format ------# | |
if [ -e "cover.jpg" ] ; then | |
case "$OUTPUT" in | |
mp3) | |
for i in *.mp3 | |
do | |
eyeD3 --add-image cover.jpg:FRONT_COVER "$i" | |
done | |
;; | |
flac) | |
for i in *.flac | |
do | |
metaflac --import-picture-from=cover.jpg "$i" | |
done | |
;; | |
*) vecho "Sorry, no matching output formats here..." >&2 | |
return 1 | |
esac | |
else | |
vecho "Cover image not found..." >&2 | |
return 1 | |
fi | |
vecho "Your "$OUTPUT" files have had the album art embedded..." >&2 | |
#------ Complete the initial loop -----# | |
done | |
} | |
MAXPROCS=2 # Run a few encoders simultaneously | |
PADTRACKS=y # Makes tracks 01 02 not 1 2 | |
COMMENT='abcde version 2.7.2' # Place a comment... | |
EJECTCD=y # Please eject cd when finished :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# connect to network | |
#ip link set dev wlo1 up | |
#wpa_supplicant -B -i wlo1 -c <(wpa_passphrase "${SSID}" "${WIFI_KEY}") | |
#dhcpcd wlo1 | |
# install CD rip tools | |
pacman -Sy --noconfirm archlinux-keyring | |
pacman -Sy --noconfirm --cachedir /tmp/pacman abcde lame cdparanoia glyr imagemagick xfce4 | |
# mount MyBookLive | |
echo -n "MyBookLive Password: " | |
read MYBOOKLIVE_PASSWORD | |
mount -t cifs -o "username=admin,password="${MYBOOKLIVE_PASSWORD}" //192.168.1.56/public /mnt | |
echo "exec startxfce4" > ~/.xinitrc | |
startx | |
cd "/mnt/Shared Music" | |
# rip CD | |
abcde -o mp3:-V2 -a default,getalbumart -x | |
# embed album art | |
cd ALBUM_DIR | |
for i in *.mp3; do eyeD3 --add-image cover.jpg:FRONT_COVER "$i"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment