Skip to content

Commit

Permalink
Fix watch: bato.to
Browse files Browse the repository at this point in the history
  • Loading branch information
OshekharO authored Jan 30, 2024
1 parent 90548a9 commit 497aa35
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions repo/bato.to.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,19 @@ export default class extends Extension {
}

async watch(url) {
let watchResponse = await this.req(url);
const urlPattern = /https:\/\/xfs[^\s'"]+/g;
let urls = watchResponse.match(urlPattern);
return {urls};
let res = await this.req(url);
const batoPass = eval(res.match(/const\s+batoPass\s*=\s*(.*?);/)?.[1] ?? '').toString()
const batoWord = (res.match(/const\s+batoWord\s*=\s*"(.*)";/)?.[1] ?? '')
const imgList = JSON.parse(res.match(/const\s+imgHttps\s*=\s*(.*?);/)?.[1] ?? '')
const tknList = JSON.parse(CryptoJS.AES.decrypt(batoWord, batoPass).toString(CryptoJS.enc.Utf8))

let pages = [];
for (let i = 0; i < Math.min(imgList.length, tknList.length); i++) {
pages.push(`${imgList[i]}?${tknList[i]}`)
}
return {
urls: pages,
};
}

}

0 comments on commit 497aa35

Please sign in to comment.