Youtube Extractor

Download and extract data from youtube videos.

Install Utilities (linux).
curl http://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
chmod +x /usr/local/bin/youtube-dl
apt install lame libav-tools

Windows requires manual installation of the binary and libav tools:

Copy all .dll and .exe from libav-tools/win64/usr/bin to the location of youtube-dl.exe.

Snippets

Extract 320kbps MP3 Audio From Video.
youtube-dl --extract-audio --audio-format mp3 --audio-quality 320K --keep-video --add-metadata {URL}
Extract FLAC Audio From Video.
youtube-dl --extract-audio --audio-format flac --audio-quality 0 --add-metadata {URL}
List all formats for a video and select the best ones.
youtube-dl -F {URL}
youtube-dl -f ###+### {URL}
Download only the 1080p video/audio stream from a video.
youtube-dl -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" {URL}
Download a playlist.
youtube-dl https://youtube.com/playlist?list={PLAYLIST ID} --yes-playlist
Track Downloaded Videos for Archiving.
youtube-dl --download-archive {FILE}

Note

Download only videos not listed in file and adds any downloaded videos to the given file.

Azure Media Services

These can be downloaded by forcing a m3u8 stream and downloading. This works for MS streaming vieos and other services using Azure Media Service backends.

  1. ctrl + shift + i › network › all

  2. Load the video/stream page

  3. Locate the manifest(format=…) URI in Chrome Dev Tools

  4. {RMB} › copy › copy linke address

  5. Use with youtube-dl, changing manifest portion of the URI to manifest(format=m3u8-aapl-v3)

References

  1. youtube-dl Source download (latest)

  2. youtube-dl github repo

  3. Using youtube-dl

  4. Using youtube-dl with LAME

  5. Convert webm format

  6. Download any Azure Media Service