文件备份

master
刘东琪 9 months ago
parent 7c8d1ad4ff
commit 484c40a7ff
  1. 4
      routes/index.js

@ -21,6 +21,7 @@ router.post('/rsCookie', async (req, res) => {
let cookie = req.body['cookieBase64']; let cookie = req.body['cookieBase64'];
let userAgent = req.body['userAgentBase64']; let userAgent = req.body['userAgentBase64'];
console.log(`${uuid};接收到 ${areaName} 请求:${url}`) console.log(`${uuid};接收到 ${areaName} 请求:${url}`)
fs.writeFileSync(`./back/${uuid}.url`, `${url}\n ${userAgent}\n ${cookie} \n`);
if (url == null || url === '') { if (url == null || url === '') {
return res.status(500).send('error url') return res.status(500).send('error url')
} }
@ -104,6 +105,7 @@ async function handle(url, htmlStr, jsText, cookie, userAgent, uuid, loadHtmlJs)
if (cookie != null) { if (cookie != null) {
let cookieList = CookieStr2List(cookie); let cookieList = CookieStr2List(cookie);
console.log(`${uuid};cookie 加载长度--->`, cookieList, baseUrl) console.log(`${uuid};cookie 加载长度--->`, cookieList, baseUrl)
fs.writeFileSync(`./back/${uuid}.cookie`, cookie)
for (let i = 0; i < cookieList.length; i++) { for (let i = 0; i < cookieList.length; i++) {
cookieJar.setCookieSync(cookieList[i], baseUrl); cookieJar.setCookieSync(cookieList[i], baseUrl);
} }
@ -112,6 +114,7 @@ async function handle(url, htmlStr, jsText, cookie, userAgent, uuid, loadHtmlJs)
let dom = await jsDom(htmlStr); let dom = await jsDom(htmlStr);
// console.log('html 加载长度--->', dom.serialize()) // console.log('html 加载长度--->', dom.serialize())
console.log(`${uuid};html 加载长度--->`, dom.serialize().length) console.log(`${uuid};html 加载长度--->`, dom.serialize().length)
fs.writeFileSync(`./back/${uuid}.html`, dom.serialize())
window = dom.window window = dom.window
// js执行成功后的瑞树会跳转页面 会触发onbeforeunload钩子 // js执行成功后的瑞树会跳转页面 会触发onbeforeunload钩子
@ -131,6 +134,7 @@ async function handle(url, htmlStr, jsText, cookie, userAgent, uuid, loadHtmlJs)
js = jsText; js = jsText;
} }
console.log(`${uuid};js 加载长度--->`, js.length) console.log(`${uuid};js 加载长度--->`, js.length)
fs.writeFileSync(`./back/${uuid}.js`, cookie)
// 执行 js // 执行 js
let script = new Script(js); let script = new Script(js);

Loading…
Cancel
Save