TheBrenny / sans-video-ripper

Hey @sans-blue-team, let me download the videos please.
Other
3 stars 1 forks source link

Hangs at "Getting course name..." #1

Closed ghost closed 21 hours ago

ghost commented 1 month ago

Script is at "Getting course name..." sitting in the course on the browser, and has created the course folder within the path provided for output.

TheBrenny commented 1 month ago

Probably line 161 being if(req.url().includes("main.c41543fd.js")) {. It should realistically be something like if(req.url().regexIncludes("main.[0-9a-z]{8}.js")) {.

herootx commented 1 month ago

C:\Users\RootX\node_modules\sans-video-ripper\index.js:161 if(req.url().regexIncludes("main.[0-9a-z]{8}.js")) { ^

TypeError: req.url(...).regexIncludes is not a function at C:\Users\RootX\node_modules\sans-video-ripper\index.js:161:16 at C:\Users\RootX\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:238:32 at async CdpHTTPRequest.finalizeInterceptions (C:\Users\RootX\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\HTTPRequest.js:86:9)

Node.js v22.2.0

TheBrenny commented 1 month ago

Yeah I'm tracking it's not a real function. It needs to change to something like that, so a custom function needs to be made.

herootx commented 1 month ago

@TheBrenny you found the root cause, thank you very much!

Add : const regexPattern = /main.[0-9a-z]{8}.js/; Replace: if(req.url().includes("main.c41543fd.js")) { with if (regexPattern.test(req.url())) {

TheBrenny commented 22 hours ago

I'm doing a bit of a review, and it's not as easy as that... The reason the version hash was updated by SANS isn't a mistake (either it's a per course thing or they've made changes), so there's a little bit of hackery that needs to happen...