Removed illustration pre-processing(#1144)

This commit is contained in:
Rider21
2024-08-18 13:52:14 +03:00
committed by GitHub
parent 7e98a91ef6
commit eb5522b066
7 changed files with 3 additions and 46 deletions
-9
View File
@@ -135,15 +135,6 @@ class AuthorToday implements Plugin.PluginBase {
}
const chapterText = decrypt(result.text, result.key, this.user?.userId);
if (chapterText.includes('<img')) {
return chapterText.replace(/src="(.*?)"/g, (match, url) => {
if (!url.startsWith('http')) {
return `src="${this.site}${url}"`;
}
return `src="${url}"`;
});
}
return chapterText;
}
-14
View File
@@ -178,20 +178,6 @@ class TL implements Plugin.PluginBase {
}).then(res => res.json());
const chapterText = data.chapter?.text?.text || '';
if (chapterText.includes('<img')) {
return chapterText.replace(
/src="(.*?)"|href="(.*?)"/g,
(match: string, src: string, href: string) => {
if (src && !src.startsWith('http')) {
return `src="${this.site + src}"`;
} else if (href && !href.startsWith('http')) {
return `href="${this.site + href}"`;
}
return match;
},
);
}
return chapterText;
}
+1 -4
View File
@@ -131,10 +131,7 @@ class RNBH implements Plugin.PluginBase {
const chapterText = body
.substring(indexA, indexB)
.replace(
/<img data-media-id="(.*?)".*?>/g,
`<img src="${this.site}/api/media/$1">`,
);
.replace(/<img data-media-id="(.*?)".*?>/g, '<img src="/api/media/$1">');
return chapterText;
}
-8
View File
@@ -100,14 +100,6 @@ class RNRF implements Plugin.PluginBase {
const chapter: string =
JSON.parse(jsonRaw[1])?.props?.pageProps?.chapter?.content?.text || '';
if (chapter.includes('<img')) {
return chapter.replace(/src="(.*?)"/g, (match, url) => {
if (!url.startsWith('http')) {
return `src="${this.site}${url}"`;
}
return `src="${url}"`;
});
}
return chapter;
}
+1 -2
View File
@@ -9,8 +9,7 @@ class TopLiba implements Plugin.PluginBase {
site = 'https://topliba.com';
version = '1.0.0';
icon = 'src/ru/topliba/icon.png';
_token = ''; //I think it's permanent?
//PgRebp4cULzQKfJBjsEPeECcDQyrVfP5DvcxIxRo
_token = '';
async fetchNovels(
page: number,