Novel Updates: raeitranslations (#868)
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.5.1';
|
version = '0.5.2';
|
||||||
icon = 'src/en/novelupdates/icon.png';
|
icon = 'src/en/novelupdates/icon.png';
|
||||||
site = 'https://www.novelupdates.com/';
|
site = 'https://www.novelupdates.com/';
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
const result = await fetchApi(this.site + chapterPath);
|
const result = await fetchApi(this.site + chapterPath);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
|
|
||||||
// console.log(result.chapterUrl);
|
// console.log(result.url);
|
||||||
|
|
||||||
// console.log('Redirected URL: ', result.chapterUrl);
|
// console.log('Redirected URL: ', result.chapterUrl);
|
||||||
|
|
||||||
@@ -205,6 +205,9 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes('travistranslations');
|
.includes('travistranslations');
|
||||||
|
|
||||||
|
let isRaeiTranslation = result.url
|
||||||
|
.toLowerCase()
|
||||||
|
.includes('raeitranslations');
|
||||||
/**
|
/**
|
||||||
* Checks if its a wordpress site
|
* Checks if its a wordpress site
|
||||||
*/
|
*/
|
||||||
@@ -254,6 +257,17 @@ class NovelUpdates implements Plugin.PluginBase {
|
|||||||
chapterText = loadedCheerio('.manga-child-content').html()!;
|
chapterText = loadedCheerio('.manga-child-content').html()!;
|
||||||
} else if (isAnomalously) {
|
} else if (isAnomalously) {
|
||||||
chapterText = loadedCheerio('#comic').html()!;
|
chapterText = loadedCheerio('#comic').html()!;
|
||||||
|
} else if (isRaeiTranslation) {
|
||||||
|
const parts = result.url.split('/');
|
||||||
|
const link = `${parts[0]}//api.${parts[2]}/api/chapters/?id=${parts[3]}&num=${parts[4]}`;
|
||||||
|
const json = await fetchApi(link).then(r => r.json());
|
||||||
|
chapterText =
|
||||||
|
json.currentChapter.head +
|
||||||
|
`<br><hr><br>` +
|
||||||
|
json.currentChapter.body +
|
||||||
|
`<br><hr><br>Translator's Note:<br>` +
|
||||||
|
json.currentChapter.note;
|
||||||
|
chapterText = chapterText.replace(/\n/g, '<br>');
|
||||||
} else if (kofi) {
|
} else if (kofi) {
|
||||||
chapterText = loadedCheerio('script:contains("shadowDom.innerHTML")')
|
chapterText = loadedCheerio('script:contains("shadowDom.innerHTML")')
|
||||||
.html()
|
.html()
|
||||||
|
|||||||
Reference in New Issue
Block a user