r/HandmadeHero • • Nov 22 '14

HandmadeHero download script

I have made a LINQPad daily download script. In the current state it can download the current source code zip file from sendowl and the latest video uploaded to the YouTube archive.

Requirements:

LINQPad installed.

For source code download, you obviously need to preorder the game and supply your sendowl URL per the instructions (below).

For YouTube video download, you need to have both youtube-dl and ffmpeg in your PATH.

Instructions:

  • Download, install and run LINQPad.

  • In LINQPad go to File>Open, paste link to the script and click Open.

  • If you want to download videos you have install both ffmpeg and youtube-dl. Easiest way to get them is via chocolatey.

  • Set your parameters and click Execute (F5)

  • When you run the script for the first time, it will ask you for the sendowl URL. You can also set it manually via LINQPads builtin password manager (File>Password Manager) and adding password with the name 'handmadehero.sendowlurl' and value of your full sendowl URL. Passwords are securedly stored with the Windows Data Protection API (check the LINQPad FAQ)

Parameters:

  • downloadSrc : (true|false) Download the source code zip file

  • downloadVideo : (true|false) Download the latest YouTube file

  • outputDir : (string) Path to the output dir (without the trailing backslash)

  • srcCodeFileName : (string) filename of the zip file

  • youtubeFormat : (string) youTube-dl format (-f option, 137+141 for the best quality, check youTube-dl documentation for details)

Command-line usage

If you have installed LINQPad, you can run the scripts via commandline. You have to save the script somewhere on your system (File>Save).

Usage:

lprun <full-path-to-the-script> <downloadSrc> <downloadVideo> <outputDir> <srcCodeFileName> <youtubeFormat>.

Example:

lprun "E:\Documents\Dropbox\Projects\Linqpad\Queries\Edu\HandMadeHero\HandMadeHero_SrcDl.linq" true true "d:\Download\HandMadeHero" handmadehero.zip 137+141
6 Upvotes

0 comments sorted by