Handmade Hero is an excellent resource for learning game development. Even though I don’t do gaming development, I find the videos enjoyable to watch. The following script down a specific episode from the command line.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Nightmare = require('nightmare')
nightmare = Nightmare(show: false)

args = process.argv.slice(2);

p = console.log

return unless args.length is 1

day = args[0]
url = 'https://hero.handmade.network/episode/code/day' + day

nightmare
.goto(url)
.wait(300)
.evaluate(-> document.querySelector('#player').getAttribute('src'))
.end()
.then (src) -> p src.split('?')[0].replace 'embed/', 'watch?v='

Download the video on day 100 using youtube-dl -f 'bestvideo+bestaudio' "$(xvfb-run coffee main.coffee 100)"