daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Apr 13th, 2017 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # 20170413 Roey Katz - throwaway script to convert .webm files to .mp3
  4. # these .webm files I got after downloading music tracks from Youtube with
  5. # the command:
  6. #
  7. #   youtube-dl --verbose -x --audio-format mp3 -o "$TRACKNAME".mp3 "$URL"
  8. #
  9. # Turns out the file written was in .webm format... so I'm fixing that
  10. # in the New Israeli Music 3 pt. 4 directory.  It has .mp3s in it as
  11. # well as subfolders with more .mp3s.
  12.  
  13. # for all .mp3s in this directory or first-level subdirectories...
  14. for n in *.mp3 */*.mp3; do
  15.  
  16.   # test to see if the mp3 file is actually a webm file
  17.   file "$n" | grep -i WebM;
  18.  
  19.   # if it was, a .webm after all, convert it to mp3
  20.   if [ $# -eq 0 ];
  21.     then echo "converting: $n";
  22.  
  23.   # else, just leave it alone
  24.   else echo "no";
  25.  
  26.     # done with if block
  27.     fi;
  28.  
  29.   # done
  30.   done
RAW Paste Data
Top