Skip to content

Instantly share code, notes, and snippets.

@kiding
Last active September 9, 2021 05:21
Show Gist options
  • Save kiding/4a7bf8f4d2afe805bb4833c2ecb678df to your computer and use it in GitHub Desktop.
Save kiding/4a7bf8f4d2afe805bb4833c2ecb678df to your computer and use it in GitHub Desktop.
thechoiceis466560 - All the Matrix 4 Teasers
/*
This script checks ALL the possible Matrix 4 teaser URLs for their existence using HTTP HEAD.
Although the PR statement says the number of combinations is "more than 180,000,"
the actual app.js indicates there are actually 466,560 mp4 files generated and uploaded to S3.
It's possible some footages were recycled; maybe b = 1 and b = 3 are the same, etc.
*/
const { createHash } = require('crypto');
const https = require('https');
async function head(url) {
return new Promise((resolve) => {
const req = https.request(url, { method: 'HEAD' }, (res) => {
const { statusCode } = res;
resolve(statusCode);
});
req.end();
});
}
async function main() {
for (const quality of ['high', 'low']) {
for (const pill of ['red', 'blue']) {
for (let hh = 0; hh <= 24; hh++) {
for (let mm = 0; mm <= 60; mm++) {
for (let b = 1; b <= 3; b++) {
for (let e = 1; e <= 3; e++) {
for (let g = 1; g <= 3; g++) {
for (let r = 1; r <= 3; r++) {
const time = `${`${hh}`.padStart(2, '0')}${`${mm}`.padStart(2, '0')}`;
const key = `17${pill}-a-b${b}-c${time}-d-e${e}-f-g${g}-h${r}-i`;
const hash = createHash('md5').update(key).digest('hex');
const url = `https://thechoiceisyours.whatisthematrix.com/generated/v7/${quality}/${hash}.mp4`;
const statusCode = await head(url);
console.log(`${key},${url},${statusCode}`);
}
}
}
}
}
}
}
}
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment