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

Commit 2217de4

Browse files
committed
Fix page algo
1 parent 1445fee commit 2217de4

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
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.4.0",
18+
version: "1.4.1",
1919
name: "VoidScans",
2020
author: "PythonCoderAS",
2121
authorWebsite: "https://github.com/PythonCoderAS",

‎src/VoidScans/VoidScansParser.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
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-
74
parseMangaList($: CheerioStatic, base: string) {
85
const mangaTiles: MangaTile[] = [];
96
$("div.col").map((index, element) => {
@@ -62,13 +59,12 @@ export class VoidScansParser {
6259

6360
parsePages($: CheerioStatic): string[] {
6461
const pages: string[] = [];
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])
62+
63+
$("#slideshow-container img").map((index, element) => {
64+
if (element.attribs["src"]){
65+
pages.push(element.attribs["src"])
7066
}
71-
}
67+
})
7268
return pages;
7369
}
7470

‎src/tests/VoidScans.test.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe("VoidScans Tests", function () {
1010
let chaiAsPromised = require("chai-as-promised");
1111
chai.use(chaiAsPromised);
1212

13-
let mangaId = "2";
13+
let mangaId = "6";
1414

1515
it("Retrieve Manga Details", async () => {
1616
let details = await wrapper.getMangaDetails(source, mangaId);
@@ -77,11 +77,4 @@ describe("VoidScans Tests", function () {
7777
expect(subitem.image, "No Image found for homepage item").to.not.be.empty;
7878
}
7979
})
80-
81-
it("Testing Notifications", async () => {
82-
let updates = await wrapper.filterUpdatedManga(source, new Date("2021-1-27"), [mangaId])
83-
expect(updates, "No server response").to.exist
84-
expect(updates, "Empty server response").to.not.be.empty
85-
expect(updates[0], "No updates").to.not.be.empty;
86-
})
8780
});

0 commit comments

Comments
 (0)