Removed illustration pre-processing(#1144)
This commit is contained in:
@@ -152,8 +152,7 @@ class IfreedomPlugin implements Plugin.PluginBase {
|
||||
.pop();
|
||||
|
||||
if (bestlink) {
|
||||
if (bestlink.startsWith('http')) return `src="${bestlink}"`;
|
||||
return `src="${this.site}${bestlink}"`;
|
||||
return `src="${bestlink}"`;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
@@ -192,13 +192,6 @@ class RulatePlugin implements Plugin.PluginBase {
|
||||
const body = await result.text();
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
loadedCheerio('.content-text img').each((index, element) => {
|
||||
if (!loadedCheerio(element).attr('src')?.startsWith('http')) {
|
||||
const src = loadedCheerio(element).attr('src');
|
||||
loadedCheerio(element).attr('src', this.site + src);
|
||||
}
|
||||
});
|
||||
|
||||
const chapterText = loadedCheerio('.content-text').html();
|
||||
return chapterText || '';
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user