SHARE
TWEET

Untitled

a guest Jan 14th, 2020 68 in 7 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. OPTION=0
  3. HEADER=""
  4. TITLE=""
  5. ARTIST=""
  6. ALBUM=""
  7. YEAR=""
  8. GENRE=""
  9.  
  10.  
  11. echo "Hello, it’s an mp3 tag editor."
  12. echo "You can edit here all the names of mp3 files of the chosen directory."
  13.  
  14. read  DIRECTORY
  15. cd $DIRECTORY
  16. echo "Here are all files with mp3 extension from your directory:"
  17. echo
  18. mkdir -v -m777 allfiles
  19. find $DIRECTORY name -type f "*.mp3" > allfiles
  20. NUMBEROFFILES=$(ls -l | wc -l)
  21.  
  22.  
  23. echo "What tags do you need in your file name?"
  24. option(){ //all the possible tags
  25. echo "1 - Header" $HEADER
  26. echo "2 - Title" $TITLE
  27. echo "3 - Artist" $ARTIST
  28. echo "4 - Album" $ALBUM
  29. echo "5 - Year of release" $YEAR
  30. echo "6 - Genre" $GENRE
  31. echo "7 - End - create names"
  32. }
  33.  
  34. sudo apt-get install lltag
  35.  
  36.  
  37. while [ $OPTION -ne 7 ]
  38. do
  39.    option
  40.    read OPTION
  41.    case $OPTION in
  42.        1) HEADER=$(lltag --show-tags header somefile.mp3);;
  43.        2) TITLE=$(lltag --show-tags title somefile.mp3);;
  44.        3) ARTIST=$(lltag --show-tags artist somefile.mp3);;
  45.        4) ALBUM=$(lltag --show-tags album somefile.mp3);;
  46.        5) YEAR=$(lltag --show-tags year somefile.mp3);;
  47.        6) GENRE=$(lltag --show-tags genre somefile.mp3);;
  48.    esac
  49. if [ $OPTION -eq 7 ];
  50.    then
  51.    for filename in $DIRECTORY; do
  52.  
  53. NEWNAME=$($TITLE $ARTIST $ALBUM $YEAR $GENRE)
  54. echo "Here are the files:"
  55. echo
  56. rename 's/filename/$NEWNAME/'
  57. fi
  58. done
  59. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top