feat: [Novel Updates]: Add Daoist Quest (#1178)
* novel-updates: add Daoist Quest * novel-updates: fix
This commit is contained in:
@@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin';
|
|||||||
class NovelUpdates implements Plugin.PluginBase {
|
class NovelUpdates implements Plugin.PluginBase {
|
||||||
id = 'novelupdates';
|
id = 'novelupdates';
|
||||||
name = 'Novel Updates';
|
name = 'Novel Updates';
|
||||||
version = '0.7.5';
|
version = '0.7.6';
|
||||||
icon = 'src/en/novelupdates/icon.png';
|
icon = 'src/en/novelupdates/icon.png';
|
||||||
customCSS = 'src/en/novelupdates/customCSS.css';
|
customCSS = 'src/en/novelupdates/customCSS.css';
|
||||||
site = 'https://www.novelupdates.com/';
|
site = 'https://www.novelupdates.com/';
|
||||||
@@ -208,16 +208,20 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
case 'anotivereads':
|
case 'anotivereads':
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('#comic-nav-name').first().text() || 'Title not found';
|
loadedCheerio('#comic-nav-name').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('#spliced-comic').html()!;
|
||||||
loadedCheerio('#spliced-comic').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'asuratls':
|
case 'asuratls':
|
||||||
const titleElement_asura = loadedCheerio('.post-body div b').first();
|
const titleElement_asura = loadedCheerio('.post-body div b').first();
|
||||||
chapterTitle = titleElement_asura.text() || 'Title not found';
|
chapterTitle = titleElement_asura.text() || 'Title not found';
|
||||||
titleElement_asura.remove();
|
titleElement_asura.remove();
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.post-body').html()!;
|
||||||
loadedCheerio('.post-body').html() || 'Content not found';
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
|
break;
|
||||||
|
case 'daoist':
|
||||||
|
chapterTitle =
|
||||||
|
loadedCheerio('.chapter__title').first().text() || 'Title not found';
|
||||||
|
chapterContent = loadedCheerio('.chapter__content').html()!;
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'fictionread':
|
case 'fictionread':
|
||||||
@@ -239,8 +243,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.content').html()!;
|
||||||
loadedCheerio('.content').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'genesistudio':
|
case 'genesistudio':
|
||||||
@@ -269,22 +272,19 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('#readerarea.rdminimal').html()!;
|
||||||
loadedCheerio('#readerarea.rdminimal').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'hiraethtranslation':
|
case 'hiraethtranslation':
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('li.active').first().text() || 'Title not found';
|
loadedCheerio('li.active').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.text-left').html()!;
|
||||||
loadedCheerio('.text-left').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'hostednovel':
|
case 'hostednovel':
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('#chapter-title').first().text() || 'Title not found';
|
loadedCheerio('#chapter-title').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('#chapter-content').html()!;
|
||||||
loadedCheerio('#chapter-content').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'infinitenoveltranslations':
|
case 'infinitenoveltranslations':
|
||||||
@@ -299,8 +299,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
const body_infinite = await result_infinite.text();
|
const body_infinite = await result_infinite.text();
|
||||||
loadedCheerio = parseHTML(body_infinite);
|
loadedCheerio = parseHTML(body_infinite);
|
||||||
}
|
}
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.cm-entry-summary').html()!;
|
||||||
loadedCheerio('.cm-entry-summary').html() || 'Content not found';
|
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.cm-entry-title').text() || 'Title not found';
|
loadedCheerio('.cm-entry-title').text() || 'Title not found';
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
@@ -330,8 +329,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('head title').first().text() || 'Title not found';
|
loadedCheerio('head title').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('main article').html()!;
|
||||||
loadedCheerio('main article').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'ko-fi':
|
case 'ko-fi':
|
||||||
@@ -354,8 +352,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
).first();
|
).first();
|
||||||
chapterTitle = titleElement_mirilu.text() || 'Title not found';
|
chapterTitle = titleElement_mirilu.text() || 'Title not found';
|
||||||
titleElement_mirilu.remove();
|
titleElement_mirilu.remove();
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.entry-content').html()!;
|
||||||
loadedCheerio('.entry-content').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'novelplex':
|
case 'novelplex':
|
||||||
@@ -363,8 +360,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.halChap--jud').first().text() || 'Title not found';
|
loadedCheerio('.halChap--jud').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.halChap--kontenInner ').html()!;
|
||||||
loadedCheerio('.halChap--kontenInner ').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'novelworldtranslations':
|
case 'novelworldtranslations':
|
||||||
@@ -384,9 +380,10 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
});
|
});
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.entry-title').first().text() || 'Title not found';
|
loadedCheerio('.entry-title').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.entry-content')
|
||||||
loadedCheerio('.entry-content').html() ||
|
.html()!
|
||||||
'Content not found'.replace(/ /g, '').replace(/\n/g, '<br>');
|
.replace(/ /g, '')
|
||||||
|
.replace(/\n/g, '<br>');
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'raeitranslations':
|
case 'raeitranslations':
|
||||||
@@ -418,14 +415,12 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
'.zoomdesc-cont p noscript',
|
'.zoomdesc-cont p noscript',
|
||||||
];
|
];
|
||||||
bloatClasses.map(tag => loadedCheerioSnow(tag).remove());
|
bloatClasses.map(tag => loadedCheerioSnow(tag).remove());
|
||||||
chapterContent =
|
chapterContent = loadedCheerioSnow('.zoomdesc-cont').html()!;
|
||||||
loadedCheerioSnow('.zoomdesc-cont').html() || 'Content not found';
|
|
||||||
const titleElement_snow = loadedCheerioSnow('.scroller h2').first();
|
const titleElement_snow = loadedCheerioSnow('.scroller h2').first();
|
||||||
if (titleElement_snow.length) {
|
if (titleElement_snow.length) {
|
||||||
chapterTitle = titleElement_snow.text() || 'Title not found';
|
chapterTitle = titleElement_snow.text() || 'Title not found';
|
||||||
titleElement_snow.remove();
|
titleElement_snow.remove();
|
||||||
chapterContent =
|
chapterContent = loadedCheerioSnow('.zoomdesc-cont').html()!;
|
||||||
loadedCheerioSnow('.zoomdesc-cont').html() || 'Content not found';
|
|
||||||
if (chapterTitle && chapterContent) {
|
if (chapterTitle && chapterContent) {
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
}
|
}
|
||||||
@@ -478,8 +473,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.entry-title').first().text() || 'Title not found';
|
loadedCheerio('.entry-title').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.entry-content').html()!;
|
||||||
loadedCheerio('.entry-content').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'scribblehub':
|
case 'scribblehub':
|
||||||
@@ -487,8 +481,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.chapter-title').first().text() || 'Title not found';
|
loadedCheerio('.chapter-title').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.chp_raw').html()!;
|
||||||
loadedCheerio('.chp_raw').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'skydemonorder':
|
case 'skydemonorder':
|
||||||
@@ -502,11 +495,11 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
throw new Error('Age verification required, please open in webview.');
|
throw new Error('Age verification required, please open in webview.');
|
||||||
}
|
}
|
||||||
chapterTitle = `${loadedCheerio('.pl-4 h1').first().text() || 'Title not found'} | ${loadedCheerio('.pl-4 div').first().text() || 'Title not found'}`;
|
chapterTitle = `${loadedCheerio('.pl-4 h1').first().text() || 'Title not found'} | ${loadedCheerio('.pl-4 div').first().text() || 'Title not found'}`;
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('#startContainer + * > *')
|
||||||
loadedCheerio('#startContainer + * > *').first().html() ||
|
.first()
|
||||||
'Content not found';
|
.html()!;
|
||||||
if (!chapterContent) {
|
if (!chapterContent) {
|
||||||
chapterContent = `${loadedCheerio('#chapter-body').html() || 'Content not found'}<hr><br>There could be missing content, please check in webview.`;
|
chapterContent = `${loadedCheerio('#chapter-body').html()!}<hr><br>There could be missing content, please check in webview.`;
|
||||||
}
|
}
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
@@ -527,14 +520,12 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
'#jp-post-flair',
|
'#jp-post-flair',
|
||||||
];
|
];
|
||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.entry-content').html()!;
|
||||||
loadedCheerio('.entry-content').html() || 'Content not found';
|
|
||||||
const titleElement_syringe = loadedCheerio('.entry-content h3').first();
|
const titleElement_syringe = loadedCheerio('.entry-content h3').first();
|
||||||
if (titleElement_syringe.length) {
|
if (titleElement_syringe.length) {
|
||||||
chapterTitle = titleElement_syringe.text();
|
chapterTitle = titleElement_syringe.text();
|
||||||
titleElement_syringe.remove();
|
titleElement_syringe.remove();
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.entry-content').html()!;
|
||||||
loadedCheerio('.entry-content').html() || 'Content not found';
|
|
||||||
} else {
|
} else {
|
||||||
chapterTitle = 'Title not found';
|
chapterTitle = 'Title not found';
|
||||||
}
|
}
|
||||||
@@ -552,8 +543,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.title-content').first().text() || 'Title not found';
|
loadedCheerio('.title-content').first().text() || 'Title not found';
|
||||||
loadedCheerio('.title-content').first().remove();
|
loadedCheerio('.title-content').first().remove();
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.content').html()!;
|
||||||
loadedCheerio('.content').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'tumblr':
|
case 'tumblr':
|
||||||
@@ -561,19 +551,16 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
break;
|
break;
|
||||||
case 'wattpad':
|
case 'wattpad':
|
||||||
chapterTitle = loadedCheerio('.h2').first().text() || 'Title not found';
|
chapterTitle = loadedCheerio('.h2').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.part-content pre').html()!;
|
||||||
loadedCheerio('.part-content pre').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'webnovel':
|
case 'webnovel':
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('.cha-tit .pr .dib').first().text() ||
|
loadedCheerio('.cha-tit .pr .dib').first().text() ||
|
||||||
'Title not found';
|
'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.cha-words').html()!;
|
||||||
loadedCheerio('.cha-words').html() || 'Content not found';
|
|
||||||
if (!chapterContent) {
|
if (!chapterContent) {
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('._content').html()!;
|
||||||
loadedCheerio('._content').html() || 'Content not found';
|
|
||||||
}
|
}
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
@@ -594,8 +581,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
loadedCheerio('h4 span').first().text() || 'Title not found';
|
loadedCheerio('h4 span').first().text() || 'Title not found';
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.chapter-content').html()!;
|
||||||
loadedCheerio('.chapter-content').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
break;
|
break;
|
||||||
case 'yoru':
|
case 'yoru':
|
||||||
@@ -607,14 +593,12 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
case 'zetrotranslation':
|
case 'zetrotranslation':
|
||||||
bloatClasses = ['hr', 'p:contains("\u00a0")'];
|
bloatClasses = ['hr', 'p:contains("\u00a0")'];
|
||||||
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
bloatClasses.map(tag => loadedCheerio(tag).remove());
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.text-left').html()!;
|
||||||
loadedCheerio('.text-left').html() || 'Content not found';
|
|
||||||
const titleElement_zetro = loadedCheerio('.text-left h2').first();
|
const titleElement_zetro = loadedCheerio('.text-left h2').first();
|
||||||
if (titleElement_zetro.length) {
|
if (titleElement_zetro.length) {
|
||||||
chapterTitle = titleElement_zetro.text() || 'Title not found';
|
chapterTitle = titleElement_zetro.text() || 'Title not found';
|
||||||
titleElement_zetro.remove();
|
titleElement_zetro.remove();
|
||||||
chapterContent =
|
chapterContent = loadedCheerio('.text-left').html()!;
|
||||||
loadedCheerio('.text-left').html() || 'Content not found';
|
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
} else if (chapterContent) {
|
} else if (chapterContent) {
|
||||||
chapterTitle =
|
chapterTitle =
|
||||||
@@ -770,8 +754,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
chapterContent =
|
chapterContent =
|
||||||
loadedCheerio('.content-post').html() ||
|
loadedCheerio('.content-post').html() ||
|
||||||
loadedCheerio('.entry-content').html() ||
|
loadedCheerio('.entry-content').html() ||
|
||||||
loadedCheerio('.post-body').html() ||
|
loadedCheerio('.post-body').html()!;
|
||||||
'Content not found';
|
|
||||||
if (chapterTitle && chapterContent) {
|
if (chapterTitle && chapterContent) {
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
}
|
}
|
||||||
@@ -830,8 +813,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
loadedCheerio('.page-body').html() ||
|
loadedCheerio('.page-body').html() ||
|
||||||
loadedCheerio('.td-page-content').html() ||
|
loadedCheerio('.td-page-content').html() ||
|
||||||
loadedCheerio('#content').html() ||
|
loadedCheerio('#content').html() ||
|
||||||
loadedCheerio('article.post').html() ||
|
loadedCheerio('article.post').html()!;
|
||||||
'Content not found';
|
|
||||||
if (chapterTitle && chapterContent) {
|
if (chapterTitle && chapterContent) {
|
||||||
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
chapterText = `<h2>${chapterTitle}</h2><hr><br>${chapterContent}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user