From d6d487101b03ee726e65fe85e4c13fc8ce56ce37 Mon Sep 17 00:00:00 2001 From: Rajarshee Chatterjee Date: Sun, 28 Aug 2022 11:49:05 +0530 Subject: [PATCH] feat(source): Add Madara Sources Closes LNReader/lnreader-sources#365 Closes LNReader/lnreader-sources#363 --- .../multisrc/madara/MadaraGenerator.ts | 25 ++++++++++++++++--- .../multisrc/madara/MadaraSources.json | 24 +++++++++++++++++- src/sources/sourceManager.ts | 8 ++++-- src/sources/sources.json | 14 +++++++++++ 4 files changed, 65 insertions(+), 6 deletions(-) diff --git a/src/sources/multisrc/madara/MadaraGenerator.ts b/src/sources/multisrc/madara/MadaraGenerator.ts index 3e8a8a36..32e0af15 100644 --- a/src/sources/multisrc/madara/MadaraGenerator.ts +++ b/src/sources/multisrc/madara/MadaraGenerator.ts @@ -335,7 +335,7 @@ export const ZetroTranslationScraper = new MadaraScraper( { 'totalPages': 1, 'lang': 'English' }, ); -export const NocturneScraper = new MadaraScraper( +export const NocturneTranslationsScraper = new MadaraScraper( 136, 'https://nocturnetls.net/', 'Nocturne Translations', @@ -357,9 +357,28 @@ export const SugarBabiesScraper = new MadaraScraper( 138, 'https://sugarbbscan.com/', 'Sugar Babies', + { 'totalPages': 3, 'lang': 'English' }, +); + +export const NovelroomDotnetScraper = new MadaraScraper( + 140, + 'https://novelroom.net/', + 'Novelroom.net', { - 'totalPages': 3, + 'totalPages': 125, 'lang': 'English', - 'path': { 'novels': 'series', 'novel': 'series', 'chapter': 'series' }, + 'path': { 'novels': 'manga', 'novel': 'manga', 'chapter': 'manga' }, + }, +); + +export const NovelR18Scraper = new MadaraScraper( + 141, + 'https://novelr18.com/', + 'NovelR18 ', + { + 'totalPages': 10, + 'lang': 'English', + 'path': { 'novels': 'novel', 'novel': 'manga', 'chapter': 'manga' }, + 'useNewChapterEndpoint': true, }, ); diff --git a/src/sources/multisrc/madara/MadaraSources.json b/src/sources/multisrc/madara/MadaraSources.json index 14124d69..2dbff6e8 100644 --- a/src/sources/multisrc/madara/MadaraSources.json +++ b/src/sources/multisrc/madara/MadaraSources.json @@ -372,7 +372,8 @@ "sourceName": "Nocturne Translations", "options": { "totalPages": 9, - "lang": "English" + "lang": "English", + "path": { "novels": "novels", "novel": "novels", "chapter": "novels" } } }, { @@ -392,5 +393,26 @@ "totalPages": 3, "lang": "English" } + }, + { + "sourceId": 140, + "baseUrl": "https://novelroom.net/", + "sourceName": "Novelroom.net", + "options": { + "totalPages": 125, + "lang": "English", + "path": { "novels": "manga", "novel": "manga", "chapter": "manga" } + } + }, + { + "sourceId": 141, + "baseUrl": "https://novelr18.com/", + "sourceName": "NovelR18 ", + "options": { + "totalPages": 10, + "lang": "English", + "path": { "novels": "novel", "novel": "manga", "chapter": "manga" }, + "useNewChapterEndpoint": true + } } ] diff --git a/src/sources/sourceManager.ts b/src/sources/sourceManager.ts index 5a6fbb1f..2b088ea0 100644 --- a/src/sources/sourceManager.ts +++ b/src/sources/sourceManager.ts @@ -77,9 +77,11 @@ import { NeoSekaiTranslationsScraper, MTLDashNovelScraper, ZetroTranslationScraper, - NocturneScraper, AsadaTranslationScraper, SugarBabiesScraper, + NocturneTranslationsScraper, + NovelroomDotnetScraper, + NovelR18Scraper, } from './multisrc/madara/MadaraGenerator'; import WuxiaBlogScraper from './en/wuxiablog'; import WuxiaCityScraper from './en/wuxiacity'; @@ -296,10 +298,12 @@ export const sourceManager = (sourceId: number): Scraper => { 133: NeoSekaiTranslationsScraper, 134: MTLDashNovelScraper, 135: ZetroTranslationScraper, - 136: NocturneScraper, + 136: NocturneTranslationsScraper, 137: AsadaTranslationScraper, 138: SugarBabiesScraper, 139: FicbookScraper, + 140: NovelroomDotnetScraper, + 141: NovelR18Scraper, }; return scrapers[sourceId]; diff --git a/src/sources/sources.json b/src/sources/sources.json index 9d8d15ee..577dfb78 100644 --- a/src/sources/sources.json +++ b/src/sources/sources.json @@ -929,5 +929,19 @@ "url": "https://ficbook.net/", "lang": "Russian", "icon": "https://ficbook.net/android-chrome-512x512.png" + }, + { + "sourceId": 140, + "sourceName": "Novelroom.net", + "icon": "https://novelroom.net/wp-content/uploads/2022/03/full_crop.jpg", + "url": "https://novelroom.net/", + "lang": "English" + }, + { + "sourceId": 141, + "sourceName": "NovelR18 ", + "icon": "https://novelr18.com/wp-content/uploads/2017/10/logo_.png", + "url": "https://novelr18.com/", + "lang": "English" } ]