-
-
Save mgaspari/bccbf650bf03faa6d5ba3460fa1d8165 to your computer and use it in GitHub Desktop.
Revisions
-
Stefan Leszkiewicz revised this gist
Jun 13, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ #usage: youtube-to-mp3 <youtube-url> #example: youtube-to-mp3 http://www.youtube.com/playlist?list=PL398CE05652474A1E #desc: downloads a single youtube vid or a playlist, then converts to mp3. # Requires youtube-dl and ffmpeg url = ARGV[0] system("youtube-dl -citA #{url}") -
Stefan Leszkiewicz renamed this gist
Jun 13, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Stefan Leszkiewicz created this gist
Jun 13, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/ruby #usage: youtube-to-mp3 <youtube-url> #example: youtube-to-mp3 http://www.youtube.com/playlist?list=PL398CE05652474A1E #desc: downloads a single youtube vid or a playlist, then converts to mp3. # Quality is not that great. Requires youtube-dl and ffmpeg url = ARGV[0] system("youtube-dl -citA #{url}") Dir.foreach(".") do |file| filename = file[/(^\d{5}.*)[\-].*/,1] if filename != nil mp3_file = filename + ".mp3" system("ffmpeg -i \"#{file}\" -vn -acodec libmp3lame -ar 44100 -ac 2 -ab 128000 \"#{mp3_file}\"") end end