Advertisement
Guest User

youtube-dl + ffmpeg

a guest
Apr 14th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. ID="$1"
  4.  
  5. if [ -z "$ID" ]; then
  6. echo "$0 <YouTube video ID>"
  7. echo "\tExample: $0 5V5V5V-4V"
  8.  
  9. exit 1
  10. fi
  11.  
  12. YT="http://www.youtube.com/watch?v=$ID"
  13.  
  14. MP4=`youtube-dl -f 22 -t $YT | grep "Destination:" | awk '{print $3}'`
  15. #MP3=`echo "$MP4" | sed 's/.{$ID}//g'`
  16.  
  17. ffmpeg -i "$MP4" -f mp3 -ab 192000 -vn "$MP4.mp3"
  18.  
  19. echo "YouTube Link: $YT"
  20. echo "Downloaded video to file: $MP4"
  21. #echo "MP3 file: $MP3"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement