--- title: Downloading courses from Linux Academy subtitle: youtube-dl is a phenomenal tool author: Amolith description: Using youtube-dl to pull Linux Academy courses for offline viewing date: 2019-10-19T01:35:00-0400 cover: /assets/pngs/youtube-dl.png categories: - Technology tags: - youtube-dl - Linux Academy - Training toc: true --- ## Forward Every month, Linux Academy releases courses for free. I'm a very busy college student and don't have time to whirl through everything I want to before it goes behind their paywall again so I figured out how to download a course or two every month using [`youtube-dl`.](https://github.com/ytdl-org/youtube-dl/) ## Setup * Install [`youtube-dl`](https://ytdl-org.github.io/youtube-dl/download.html) * Make sure you have a browser handy * Create a community account on [Linux Academy](https://linuxacademy.com/join/community) * Get some food * Maybe a drink * Sit back down in your chair * Spin around a bit * Read on ## Downloading * Log into your account * Pick the course you want * Open the developer console and go to `Network` (Ctrl+Shift+E in Firefox) * You'll want to select `Media` as shown in the screenshot below *In moving my posts around, this screenshot has disappeared* :shrug: * Click the video you want to start with * Watch the network logs * You'll see an entry that starts with `playlist` (screenshot below) *In moving my posts around, this screenshot has disappeared* :shrug: * Right click it * Copy the URL * Paste it after `youtube-dl` in a terminal: ``` bash amolith@poseidon:~ $ youtube-dl https://video-cdn.linuxacademy.com/vods3/_definst_/smil:box/cdnstore/modules/lots-of-stuff-in-here ``` * Press enter * Watch the magic unfold At a high level, `youtube-dl` is acting like your browser and following the `m3u` playlist to download chunks of the file. After it fetches them all, it runs them through `ffmpeg` to stitch them together into a single video! I found it useful to open a text editor and script downloading a whole course at a time. All you have to do is type `youtube-dl -o` and copy/paste it however many times there are videos. Then, copy and paste the video title in quotes after `-o` and add `.mp4` to the end (command example below). After that, paste the URL. Do that with every video in the series, save the script, run `chmod +x