Removed illustration pre-processing(#1144)
This commit is contained in:
@@ -152,8 +152,7 @@ class IfreedomPlugin implements Plugin.PluginBase {
|
|||||||
.pop();
|
.pop();
|
||||||
|
|
||||||
if (bestlink) {
|
if (bestlink) {
|
||||||
if (bestlink.startsWith('http')) return `src="${bestlink}"`;
|
return `src="${bestlink}"`;
|
||||||
return `src="${this.site}${bestlink}"`;
|
|
||||||
}
|
}
|
||||||
return match;
|
return match;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -192,13 +192,6 @@ class RulatePlugin implements Plugin.PluginBase {
|
|||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
const loadedCheerio = parseHTML(body);
|
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();
|
const chapterText = loadedCheerio('.content-text').html();
|
||||||
return chapterText || '';
|
return chapterText || '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,15 +135,6 @@ class AuthorToday implements Plugin.PluginBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const chapterText = decrypt(result.text, result.key, this.user?.userId);
|
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;
|
return chapterText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,20 +178,6 @@ class TL implements Plugin.PluginBase {
|
|||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
|
|
||||||
const chapterText = data.chapter?.text?.text || '';
|
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;
|
return chapterText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,10 +131,7 @@ class RNBH implements Plugin.PluginBase {
|
|||||||
|
|
||||||
const chapterText = body
|
const chapterText = body
|
||||||
.substring(indexA, indexB)
|
.substring(indexA, indexB)
|
||||||
.replace(
|
.replace(/<img data-media-id="(.*?)".*?>/g, '<img src="/api/media/$1">');
|
||||||
/<img data-media-id="(.*?)".*?>/g,
|
|
||||||
`<img src="${this.site}/api/media/$1">`,
|
|
||||||
);
|
|
||||||
|
|
||||||
return chapterText;
|
return chapterText;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,14 +100,6 @@ class RNRF implements Plugin.PluginBase {
|
|||||||
const chapter: string =
|
const chapter: string =
|
||||||
JSON.parse(jsonRaw[1])?.props?.pageProps?.chapter?.content?.text || '';
|
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;
|
return chapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ class TopLiba implements Plugin.PluginBase {
|
|||||||
site = 'https://topliba.com';
|
site = 'https://topliba.com';
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
icon = 'src/ru/topliba/icon.png';
|
icon = 'src/ru/topliba/icon.png';
|
||||||
_token = ''; //I think it's permanent?
|
_token = '';
|
||||||
//PgRebp4cULzQKfJBjsEPeECcDQyrVfP5DvcxIxRo
|
|
||||||
|
|
||||||
async fetchNovels(
|
async fetchNovels(
|
||||||
page: number,
|
page: number,
|
||||||
|
|||||||
Reference in New Issue
Block a user