Skip to content
This repository was archived by the owner on Nov 20, 2021. It is now read-only.

Commit 1b86ac2

Browse files
committed
Fix VoidScans
1 parent affd324 commit 1b86ac2

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

‎src/VoidScans/VoidScans.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BASE = "https://voidscans.net"
1515

1616
export const VoidScansInfo: SourceInfo = {
1717
icon: "icon.svg",
18-
version: "1.3.0",
18+
version: "1.3.1",
1919
name: "VoidScans",
2020
author: "PythonCoderAS",
2121
authorWebsite: "https://github.com/PythonCoderAS",

‎src/VoidScans/VoidScansParser.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {Chapter, LanguageCode, Manga, MangaStatus, MangaTile} from "paperback-extensions-common";
22

33
export class VoidScansParser {
4+
5+
pageRegex = /src:"(https:\/\/beta\.voidscans\.net\/[^\s"']+)"/g
6+
47
parseMangaList($: CheerioStatic, base: string) {
58
const mangaTiles: MangaTile[] = [];
69
$("div.col").map((index, element) => {
@@ -59,12 +62,13 @@ export class VoidScansParser {
5962

6063
parsePages($: CheerioStatic): string[] {
6164
const pages: string[] = [];
62-
$("div[data-image]").map((index, element) => {
63-
const url = element.attribs["data-image"];
64-
if (url){
65-
pages.push(url);
65+
const data = $("script:not([src])[type]").html();
66+
if (data){
67+
const matches = [...data.matchAll(this.pageRegex)];
68+
for (let i = 0; i < matches.length; i++) {
69+
pages.push(matches[i][1])
6670
}
67-
})
71+
}
6872
return pages;
6973
}
7074

0 commit comments

Comments
 (0)