Skip to content

Instantly share code, notes, and snippets.

@Yanpas
Created August 31, 2015 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yanpas/f6c0f873867f4c697d60 to your computer and use it in GitHub Desktop.
Save Yanpas/f6c0f873867f4c697d60 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# Needed apps
# mp3val eyed3 id3v2 python-mutagen zsh
cd /home/$USER/Загрузки/
rename s/_\\\(zvukoff\.ru\\\)//g *.mp3
rename s/_\\\(zv\.fm\\\)//g *.mp3
rename s/_/\ /g *.mp3
for file in *.mp3
do
mp3val -f $file
rm -f $file.bak
mid3iconv -eCP1251 $file
criteria=$(id3v2 --list $file|egrep "zvukoff|zv.fm"|tr "\n" " ")
if [[ $criteria != "" ]]
#newname=$file
then
eyeD3 --remove-images --remove-comments --album="" $file
#id3v2 -A "" $file
#newname=$(echo $file|sed -e 's/ [a-z]/\U&/g'|sed -e 's/^[a-z]/\U&/g')
fi
newname=$(echo $file|sed -e 's/ [a-z]/\U&/g'|sed -e 's/^[a-z]/\U&/g')
mv $file ../Музыка/$newname
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment