Skip to content

Commit

Permalink
BatoTo | 3.0.3 - Fix script regex for image key (#23)
Browse files Browse the repository at this point in the history
Discovered all that yapping was actually an issue.
BatoTo replaced variable names in their decoder script.
  • Loading branch information
niclimcy authored Jan 7, 2024
1 parent e183f27 commit ab0f4b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/BatoTo/BatoTo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {

Check failure on line 1 in src/BatoTo/BatoTo.ts

View workflow job for this annotation

GitHub Actions / Bundle and Publish Sources (14.x)

Cannot find name 'CheerioAPI'.

Check failure on line 1 in src/BatoTo/BatoTo.ts

View workflow job for this annotation

GitHub Actions / Bundle and Publish Sources (14.x)

Parameter 'cheerio' of constructor from exported class has or is using private name 'CheerioAPI'.
BadgeColor,
Chapter,
ChapterDetails,
ChapterProviding,
Expand Down Expand Up @@ -34,7 +33,7 @@ import {
const BATO_DOMAIN = 'https://bato.to'

export const BatoToInfo: SourceInfo = {
version: '3.0.2',
version: '3.0.3',
name: 'BatoTo',
icon: 'icon.png',
author: 'Nicholas',
Expand Down
2 changes: 1 addition & 1 deletion src/BatoTo/BatoToParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const parseChapterDetails = ($: CheerioStatic, mangaId: string, chapterId

const batoPass = eval(script.match(/const\s+batoPass\s*=\s*(.*?);/)?.[1] ?? '').toString()
const batoWord = (script.match(/const\s+batoWord\s*=\s*"(.*)";/)?.[1] ?? '')
const imgList = JSON.parse(script.match(/const\s+imgHttpLis\s*=\s*(.*?);/)?.[1] ?? '')
const imgList = JSON.parse(script.match(/const\s+imgHttps\s*=\s*(.*?);/)?.[1] ?? '')
const tknList = JSON.parse(CryptoJS.AES.decrypt(batoWord, batoPass).toString(CryptoJS.enc.Utf8))

for (let i = 0; i < Math.min(imgList.length, tknList.length); i++) {
Expand Down

0 comments on commit ab0f4b8

Please sign in to comment.