Skip to content

Instantly share code, notes, and snippets.

@gil0mendes
Created September 8, 2021 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gil0mendes/398550cba7c96cb291b76cc416b32504 to your computer and use it in GitHub Desktop.
Save gil0mendes/398550cba7c96cb291b76cc416b32504 to your computer and use it in GitHub Desktop.
Matrix 4 video URL generator
/**
* Matrix 4 video URL generator
* by: gil0mendes <gil00mendes@gmail.com>
*
* [ALERT]
* Please keep in mind that this code can stop working due to website changes. I really don't know if they will keep
* the files after announcing the trailer or film release.
*
* [CONTEXT]
* Matrix 4 teaser was announced with a interactive website that allows you to chose between the red and blue pill. It
* leads us to a specific video that at the middle says the current hours. It seems like they implemented this by
* generating a unique video for each day minute.
*
* [GOAL]
* After some reverse-engineering I discovered how they generate the URLs for each minute and pill choice. This code,
* generates an URL for the given hour and pill choice the user gives to the console.
*
* [USAGE]
* node index.js <time> <red|blue>
* example: node index.js 1045 red
*/
const crypto = require('crypto');
const generateURL = fileHash => `https://thechoiceisyours.whatisthematrix.com/generated/v7/high/${fileHash}.mp4`;
const helper = () => console.log(`example usage: node index.js 1520 red`);
// get arguments
const targetTime = process.argv[2];
const targetPill = process.argv[3];
if (!targetTime) {
console.error("Invalid usage.");
helper();
process.exit(1);
}
if (!targetPill) {
console.error("Invalid pill value. Expect: 'red' or 'blue'");
helper();
process.exit(1);
}
// generate deobfuscated magic unique video key
const prefix = targetPill === "red" ? "17red" : "17blue";
const key = `${prefix}-a-b2-c${targetTime}-d-e2-f-g1-h1-i`;
// generate md5 for the the filename and show it
const fileHash = crypto.createHash('md5').update(key).digest('hex');
console.log("[URL] =>", generateURL(fileHash));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment