Skip to content

Instantly share code, notes, and snippets.

@millisami
Forked from igrigorik/gist:3148848
Created July 20, 2012 05:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save millisami/3148874 to your computer and use it in GitHub Desktop.
Save millisami/3148874 to your computer and use it in GitHub Desktop.
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > brew install ffprobe
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
[youtube] Setting language
[youtube] vT1KmTQ-1Os: Downloading video webpage
[youtube] vT1KmTQ-1Os: Downloading video info webpage
[youtube] vT1KmTQ-1Os: Extracting video information
Available formats:
22 : mp4 [720x1280]
45 : webm [720x1280]
35 : flv [480x854]
44 : webm [480x854]
34 : flv [360x640]
18 : mp4 [360x640]
43 : webm [360x640]
5 : flv [240x400]
17 : mp4 [144x176]
# Extract audio track from video
{ ~ } > ./youtube-dl -f 5 --extract-audio http://www.youtube.com/watch?v=vT1KmTQ-1Os
[youtube] Setting language
[youtube] vT1KmTQ-1Os: Downloading video webpage
[youtube] vT1KmTQ-1Os: Downloading video info webpage
[youtube] vT1KmTQ-1Os: Extracting video information
[download] Destination: vT1KmTQ-1Os.flv
[download] 100.0% of 74.36M at 43.23k/s ETA 00:00
[ffmpeg] Destination: vT1KmTQ-1Os.mp3
{ ~ } > open vT1KmTQ-1Os.mp3
# woot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment