Feat(plugin)Add Foxteller (#984)

* test

* optimization

* terser@5.31.0 => terser@5.31.1
This commit is contained in:
Rider21
2024-06-12 15:12:52 +03:00
committed by GitHub
parent 265e20fc3c
commit c6c5c99c1c
7 changed files with 325 additions and 19 deletions
+3 -6
View File
@@ -77,8 +77,8 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
const articles = html.match(/<article([\s\S]*?)<\/article>/g) || [];
articles.forEach(article => {
const novelName = article.match(/<a.*title="(.*?)"/)?.[1];
const novelUrl = article.match(/<a href="(.*?)"/)?.[1];
const [, novelUrl, novelName] =
article.match(/<a href="(.*?)".*title="(.*?)"/) || [];
if (novelName && novelUrl) {
const novelCover =
@@ -148,10 +148,7 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
const parser = new Parser({
onopentag(name, attribs) {
// name and cover
if (
!novel.cover &&
attribs['class']?.includes('ts-post-image' || 'wp-post-image')
) {
if (!novel.cover && attribs['class']?.includes('ts-post-image')) {
novel.name = attribs['title'];
novel.cover = attribs['data-src'] || attribs['src'] || defaultCover;
} // genres
-3
View File
@@ -4,13 +4,10 @@ import * as fs from 'fs';
const config = {
compress: {
arrows: false,
booleans_as_integers: true,
},
mangle: {},
ecma: 5, // specify one of: 5, 2015, 2016, etc.
enclose: false, // or specify true, or "args:values"
keep_classnames: false,
keep_fnames: false,
module: true,
toplevel: true,
};