Created
April 8, 2018 17:17
-
-
Save RomaniukVadim/b19b35729eb4917cb6b417a4802f00d0 to your computer and use it in GitHub Desktop.
Script to beautify mp3 files downloaded with youtube-dl
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
#!/bin/sh | |
IFS=' ' | |
for file in *.mp3; do | |
if [ ! -d "$file" ]; then | |
newfilename=`echo "$file" | sed -e "s/ /_/g"`; | |
new_name=`echo $newfilename |awk '{print substr($0,1,length-16)}'| xargs -I{} echo "{}.mp3"`; | |
mv "$file" "$new_name" 2>/dev/null; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment