forked from lightpohl/gb-dl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mass-alex.js
32 lines (28 loc) · 1.08 KB
/
mass-alex.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
mass-alex.js
Description: The script below will download all the current episodes in the Mass Alex show.
Required: Node
How to Run: `node mass-alex.js`
*/
let execSync = require("child_process").execSync;
// Replace `YOUR_API_KEY` with the key from https://www.giantbomb.com/api
let apiKey = "YOUR_API_KEY";
/*
Finding the `endingEpisode` is a little tricky if there are multiple seasons
of a show, but you can add the `--info` command with different `--video-number` numbers
to find it before running the script.
*/
let showName = "Mass Alex";
let startingEpisodeNumber = 0; // Mass Alex: Mass Effect - Part 01
let endingEpisode = 42; // Mass Alex: Mass Effect 2 - Part 24
for (let i = startingEpisodeNumber; i <= endingEpisode; i++) {
try {
execSync(
`npx gb-dl --api-key ${apiKey} --show-name "${showName}" --video-number ${i} --video-number-reverse`,
{ stdio: "inherit" } // this will allow us to see the console output as it downloads
);
} catch (error) {
console.error(error);
console.log("Something happened! Moving onto the next video.");
}
}