Skip to content

Commit

Permalink
[vortexscan] directly fetch content with regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronny committed Jan 11, 2025
1 parent e363dd0 commit 7afe6bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions web/src/engine/websites/VortexScans.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Tags } from '../Tags';
import { FetchHTML } from '../platform/FetchProvider';
import { Page, type Chapter } from '../providers/MangaPlugin';
import icon from './VortexScans.webp';
import { FetchRegex } from '../platform/FetchProvider';
import { Page, type Chapter } from '../providers/MangaPlugin';
import { VTheme } from './templates/VTheme';

type JSONImage = {
Expand All @@ -19,8 +19,8 @@ export default class extends VTheme {
}

public override async FetchPages(chapter: Chapter): Promise<Page[]> {
const doc = await FetchHTML(new Request(new URL(chapter.Identifier, this.URI)));
const images: JSONImage[] = JSON.parse(doc.documentElement.innerHTML.match(/\\"images\\":(\[.*]),\\"nextChapter/)[1].replaceAll('\\', ''));
const [ data ] = await FetchRegex(new Request(new URL(chapter.Identifier, this.URI)), /\\"images\\":(\[.*]),\\"nextChapter/g);
const images: JSONImage[] = JSON.parse(data.replaceAll('\\', ''));
return images.map(image => new Page(this, chapter, new URL(image.url), { Referer: this.URI.href }));
}
}
}
2 changes: 1 addition & 1 deletion web/src/engine/websites/templates/VTheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//VTheme theme by V DEV : https://discord.com/invite/yz3UN72qPd
// VTheme theme by V DEV : https://discord.com/invite/yz3UN72qPd

import { FetchJSON } from '../../platform/FetchProvider';
import { Chapter, DecoratableMangaScraper, type MangaPlugin, Manga } from '../../providers/MangaPlugin';
Expand Down

0 comments on commit 7afe6bf

Please sign in to comment.