Full TS for Plugins (#538)
* remove lang, descrription in plugin script * remove languages import * Update README.md * fix: missing lang * clean: remove description * feat(Add Sources) (#15) * add many sources * add showToast * feat(Add Source): (#16) * add source * remove descriptions * Early Novel & Fast Novel (#1) * some more plugin * plugin * try something new * yes * try yes * genres is plural * fastnovel full fix * testings * early check * earlynovel fixed * showToast check * earlynovel done * fastnovel fixe * again * showToasts again * fix for fastnovel * done * for pr * Update freenovelupdates.js * MTL Reader and MTL Novel (#2) * first * test * wops * mtlreaders * ok * for PR * Nitro Scans and Novel Hold (#3) * start feature * more feature * something * eslint * yes * maybe * wa * asdasd * amazing * change it up * for pr * WPmangastream and Novelfull (#4) (#17) * source generation * fix json parse error * update plguins * delete fetchApi, nobleMTL (.js) * delete showToast.js * Typescript Support (#18) * Initial TS Config * Initial TS Config * Fix most errors * Fix test webserver * Fix webserver isPlugin not working * Fix typos * Add check if plugins have all the fields * Move exports.protected to the bottom of the plugin * Change username, reponame and branchname * Fix no exports error * Fix type * Fix typo in tsc_fix * Remove const from exports to not re-define consts * Readd const becuause exports may not exist. * Fix plugins to work in-app * Fix NobleMTL * Remove fix_ts.ts * Change template.ts * delete cheerio_space * move api into ./testweb * remove js dir * remove js dir (again) * remove ./js (again) * init multisrc generator (test) * remove module.exports in libs * madara generator * update template * rename generator, TS for hako * fix icon url for madara * fix icon for madara (again) * update Readme, nodemon * export default for all libs * fix madara novelurl * update: pluginId, name, filename for madara * feat: check same id error * update: precommit, fix: require.default * Revert "update: precommit, fix: require.default" This reverts commit c642c5c72241f13eccfe417210c22272c4739ffa. * Port all plugins to ts (#19) - fix cheerio - remove export default - fix spelling * update template * add multisrc noveltl, update generator param, fix web search * fix undefined id for Snailulitka * add rulate multisrc, fix max length textarea * add readwn multisrc * delete: erolate and rulate are in multisrc * Change broken extension and show error on commit for those files (#20) * Change to .broken.ts and show error on commit for those files * remove novelStatus * fix: wrong id in github action * remove mangastream multisrc * update icon for readwn multisrc --------- Co-authored-by: K1ngfish3r <trulyihu@gmail.com> Co-authored-by: Marcin Majewski <skilletssgames@gmail.com>
This commit is contained in:
@@ -1,57 +1,56 @@
|
|||||||
name: Update json files
|
name: Update json files
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- plugins
|
- plugins
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
updatejson:
|
updatejson:
|
||||||
if: github.repository == 'LNReader/lnreader-sources'
|
if: github.repository == 'LNReader/lnreader-sources'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: "16"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Clean up current dist
|
- name: Clean up current dist
|
||||||
run: |
|
run: |
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
mkdir dist
|
mkdir dist
|
||||||
cat > config.json << EOF
|
cat > config.json << EOF
|
||||||
{
|
{
|
||||||
"githubUsername": "LNReader",
|
"githubUsername": "LNReader",
|
||||||
"githubRepository": "lnreader-sources",
|
"githubRepository": "lnreader-sources",
|
||||||
"githubBranch": "plugins"
|
"githubBranch": "plugins"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
- name: Update json files
|
||||||
|
id: json
|
||||||
|
run: |
|
||||||
|
npm run json
|
||||||
|
changes="$(git diff)"
|
||||||
|
if [ "$changes" ]
|
||||||
|
then
|
||||||
|
changes=1
|
||||||
|
else
|
||||||
|
changes=""
|
||||||
|
fi
|
||||||
|
echo "json-diff=$changes" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Update json files
|
- name: Create pull request
|
||||||
id: json
|
if: ${{ steps.json.outputs.json-diff }}
|
||||||
run: |
|
uses: peter-evans/create-pull-request@v4
|
||||||
node scripts/json_plugins.js
|
with:
|
||||||
changes="$(git diff)"
|
token: ${{ secrets.REPO_SCOPED_TOKEN }}
|
||||||
if [ "$changes" ]
|
author: rajarsheechatterjee <rajarshee.adm@gmail.com>
|
||||||
then
|
committer: rajarsheechatterjee <rajarshee.adm@gmail.com>
|
||||||
changes=1
|
commit-message: "plugins: update json files for new plugins"
|
||||||
else
|
title: Update json files
|
||||||
changes=""
|
labels: enhancement
|
||||||
fi
|
body: Auto-generated PR for updating json files
|
||||||
echo "json-diff=$changes" >> $GITHUB_OUTPUT
|
branch: update-json
|
||||||
|
delete-branch: true
|
||||||
- name: Create pull request
|
|
||||||
if: ${{ steps.json.outputs.json-diff }}
|
|
||||||
uses: peter-evans/create-pull-request@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.REPO_SCOPED_TOKEN }}
|
|
||||||
author: rajarsheechatterjee <rajarshee.adm@gmail.com>
|
|
||||||
committer: rajarsheechatterjee <rajarshee.adm@gmail.com>
|
|
||||||
commit-message: 'plugins: update json files for new plugins'
|
|
||||||
title: Update json files
|
|
||||||
labels: enhancement
|
|
||||||
body: Auto-generated PR for updating json files
|
|
||||||
branch: update-json
|
|
||||||
delete-branch: true
|
|
||||||
|
|||||||
@@ -2,3 +2,7 @@ node_modules/**/*
|
|||||||
.vscode
|
.vscode
|
||||||
.env
|
.env
|
||||||
config.json
|
config.json
|
||||||
|
|
||||||
|
# ignore TS translation folder but keep plugins folder
|
||||||
|
js/*
|
||||||
|
!js/plugins
|
||||||
|
|||||||
@@ -14,16 +14,17 @@ Repository to host plugins and related issues, and requests for [LNReader](https
|
|||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
1. Please use this [template](./template.js) or [template.min](./template.min.js)
|
1. Please use this [template](./template.ts) or [template.min](./template.min.ts)
|
||||||
|
|
||||||
2. Choose your language in [./plugins](./plugins)
|
2. Choose your language in [./plugins](./plugins)
|
||||||
|
|
||||||
+ If your language doenst exist, please request us. We will add it soon.
|
+ If your language doenst exist or you need some other packages, please request us. We will add it soon.
|
||||||
|
|
||||||
3. Write your scripts
|
3. Write your scripts
|
||||||
|
|
||||||
+ See example: [Hako](./plugins/vietnamese/LNHako.js)
|
+ See example: [Hako](./plugins/vietnamese/LNHako.ts)
|
||||||
|
|
||||||
|
Multisrc: [multisrc](./scripts/multisrc)
|
||||||
|
|
||||||
## Test your script
|
## Test your script
|
||||||
|
|
||||||
@@ -38,7 +39,11 @@ npm install
|
|||||||
2. Running
|
2. Running
|
||||||
|
|
||||||
```
|
```
|
||||||
nodemon index.js
|
npm start
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```
|
||||||
|
nodemon
|
||||||
```
|
```
|
||||||
|
|
||||||
+ Then open http://localhost:3000
|
+ Then open http://localhost:3000
|
||||||
@@ -51,13 +56,10 @@ nodemon index.js
|
|||||||
|
|
||||||
#### No need to reload webpage after changing your plugin script.
|
#### No need to reload webpage after changing your plugin script.
|
||||||
|
|
||||||
- One more thing: you can use [cheerio_space](./cheerio_space) to build functions without requesting to the site.
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
If you want to test plugin in app side, remember to config these things.
|
If you want to test plugin in app side, remember to config these things.
|
||||||
|
|
||||||
in [.env](./.env)
|
|
||||||
|
|
||||||
1. Create `config.json` file in root dir
|
1. Create `config.json` file in root dir
|
||||||
2. Add your github infomation. Here is an example.
|
2. Add your github infomation. Here is an example.
|
||||||
@@ -68,7 +70,7 @@ in [.env](./.env)
|
|||||||
"githubBranch": "plugins"
|
"githubBranch": "plugins"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
3. Just commit and push it. And you will see your own json files in github folk: dist/`username`/
|
3. Just commit and push it. And you will see your own json files in github fork: dist/`username`/
|
||||||
|
|
||||||
also in [pluginManager.ts](https://github.com/LNReader/lnreader/blob/plugins/src/plugins/pluginManager.ts) (app repo)
|
also in [pluginManager.ts](https://github.com/LNReader/lnreader/blob/plugins/src/plugins/pluginManager.ts) (app repo)
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
const languages = require('@libs/languages');
|
|
||||||
const path = require('path')
|
|
||||||
const root = path.dirname(require.main.filename);
|
|
||||||
|
|
||||||
const all_plugins = () => {
|
|
||||||
const res = {}
|
|
||||||
for (let language in languages) { //language with English name
|
|
||||||
const langPath = path.join(root, 'plugins', language.toLowerCase());
|
|
||||||
if (!fs.existsSync(langPath)) continue;
|
|
||||||
const plugins = fs.readdirSync(langPath);
|
|
||||||
res[languages[language]] = [];
|
|
||||||
plugins.forEach(plugin => {
|
|
||||||
if(plugin.startsWith('.')) return;
|
|
||||||
const requirePath = `@plugins/${language.toLowerCase()}/${plugin.split('.')[0]}`
|
|
||||||
const instance = require(requirePath);
|
|
||||||
const { id, name, lang, version, description } = instance;
|
|
||||||
const info = { id, name, lang, version, description } // lang: language with native name
|
|
||||||
info.requirePath = requirePath;
|
|
||||||
res[lang].push(info);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
const popularNovels = async (pluginRequirePath, {showLatestNovels, filters}) => {
|
|
||||||
return await require(pluginRequirePath).popularNovels(1, {showLatestNovels, filters});
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchNovels = async (pluginRequirePath, searchTerm) => {
|
|
||||||
return await require(pluginRequirePath).searchNovels(searchTerm);
|
|
||||||
}
|
|
||||||
|
|
||||||
const parseNovelAndChapters = async(pluginRequirePath, novelUrl) => {
|
|
||||||
return await require(pluginRequirePath).parseNovelAndChapters(novelUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
const parseChapter = async (pluginRequirePath, chapterUrl) => {
|
|
||||||
return await require(pluginRequirePath).parseChapter(chapterUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchImage = async (pluginRequirePath, url) => {
|
|
||||||
return await require(pluginRequirePath).fetchImage(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
all_plugins,
|
|
||||||
popularNovels,
|
|
||||||
searchNovels,
|
|
||||||
parseNovelAndChapters,
|
|
||||||
parseChapter,
|
|
||||||
fetchImage
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
Html source to test with cheerio.
|
|
||||||
Do not make too many requests, you could get banned from site.
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
const cheerio = require('cheerio');
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
const body = fs.readFileSync(path.join(__dirname, 'source.html')).toString();
|
|
||||||
const loadedCheerio = cheerio.load(body);
|
|
||||||
Vendored
+520
@@ -0,0 +1,520 @@
|
|||||||
|
{
|
||||||
|
"العربية": [
|
||||||
|
{
|
||||||
|
"id": "kolnovel",
|
||||||
|
"name": "KolNovel",
|
||||||
|
"site": "https://kolnovel.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/arabic/kolnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/multisrc/wpmangastream/icons/kolnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"中文, 汉语, 漢語": [],
|
||||||
|
"English": [
|
||||||
|
{
|
||||||
|
"id": "ANF.com",
|
||||||
|
"name": "AllNovelFull",
|
||||||
|
"site": "https://allnovelfull.com",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/allnovelfull.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/allnovelfull/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "BLN.com",
|
||||||
|
"name": "BestLightNovel",
|
||||||
|
"site": "https://bestlightnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/bestlightnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/bestlightnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "comrademao",
|
||||||
|
"name": "Comrade Mao",
|
||||||
|
"site": "https://comrademao.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/comrademao.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/comrademao/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "DDL.com",
|
||||||
|
"name": "Divine Dao Library",
|
||||||
|
"site": "https://www.divinedaolibrary.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/divinedaolibrary.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/divinedaolibrary/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "earlynovel",
|
||||||
|
"name": "Early Novel",
|
||||||
|
"site": "https://earlynovel.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/earlynovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/multisrc/madara/icons/latestnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fastnovel",
|
||||||
|
"name": "Fast Novel",
|
||||||
|
"site": "https://fastnovel.org/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/fastnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/fastnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "foxaholic",
|
||||||
|
"name": "Foxaholic",
|
||||||
|
"site": "https://www.foxaholic.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/foxaholic.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/foxaholic/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "freenovelupdates",
|
||||||
|
"name": "Free Novel Updates (Broken)",
|
||||||
|
"site": "https://www.freenovelupdates.com",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/freenovelupdates.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/freenovelupdates/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "FWN.com",
|
||||||
|
"name": "Web NOVEL",
|
||||||
|
"site": "https://freewebnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/freewebnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/freewebnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lightnovelpub",
|
||||||
|
"name": "LightNovelPub",
|
||||||
|
"site": "https://www.lightnovelpub.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/lightnovelpub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/lightnovelpub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "LightNovelUpdates",
|
||||||
|
"name": "Light Novel Updates",
|
||||||
|
"site": "https://www.lightnovelupdates.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/lightnovelupdates.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/lightnovelupdates/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lnmtl",
|
||||||
|
"name": "LNMTL",
|
||||||
|
"site": "https://lnmtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/lnmtl.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/lnmtl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "LNR.org",
|
||||||
|
"name": "LightNovelReader",
|
||||||
|
"site": "https://lightnovelreader.org",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/LightNovelReader.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/lightnovelreader/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtlnovel",
|
||||||
|
"name": "MTL Novel",
|
||||||
|
"site": "https://www.mtlnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/mtlnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/mtlnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtlreader",
|
||||||
|
"name": "MTL Reader",
|
||||||
|
"site": "https://mtlreader.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/mtlreader.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/mtlreader/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NF.me",
|
||||||
|
"name": "NovelFull.me",
|
||||||
|
"site": "https://novelfull.me/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/NovelFullMe.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/novelfullme/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nitroscans",
|
||||||
|
"name": "Nitroscans",
|
||||||
|
"site": "https://nitroscans.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/nitroscans.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/nitroscans/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NO.net",
|
||||||
|
"name": "novelsOnline",
|
||||||
|
"site": "https://novelsonline.net",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/NovelOnline.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/coverNotAvailable.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NobleMTL",
|
||||||
|
"name": "NobleMTL",
|
||||||
|
"site": "https://www.noblemtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/nobleMTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/noblemtl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelforest",
|
||||||
|
"name": "Novel Forest (Broken)",
|
||||||
|
"site": "https://novelforest.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/novelforest.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/novelforest/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelfull",
|
||||||
|
"name": "NovelFull",
|
||||||
|
"site": "https://novelfull.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/novelfull.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/novelfull/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelhold",
|
||||||
|
"name": "Novel Hold",
|
||||||
|
"site": "https://novelhold.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/novelhold.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/novelhold/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelpub.com",
|
||||||
|
"name": "NovelPub",
|
||||||
|
"site": "https://www.novelpub.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/novelpub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/novelpub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelupdates",
|
||||||
|
"name": "Novel Updates",
|
||||||
|
"site": "https://www.novelupdates.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "0.5.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/novelupdates.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/novelupdates/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "PandaMTL",
|
||||||
|
"name": "PandaMTL",
|
||||||
|
"site": "https://www.pandamtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/pandaMTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/wordpress/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wuxiaworld",
|
||||||
|
"name": "Wuxia World (WIP)",
|
||||||
|
"site": "https://www.wuxiaworld.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "0.5.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/english/wuxiaworld.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/en/wuxiaworld/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"français, française": [
|
||||||
|
{
|
||||||
|
"id": "chireads.com",
|
||||||
|
"name": "Chireads",
|
||||||
|
"site": "https://chireads.com/",
|
||||||
|
"lang": "français, française",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/french/chireads.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/fr/chireads/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NDG.com",
|
||||||
|
"name": "NovelDeGlace",
|
||||||
|
"site": "https://noveldeglace.com/",
|
||||||
|
"lang": "français, française",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/french/noveldeglace.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/fr/noveldeglace/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Bahasa Indonesia": [
|
||||||
|
{
|
||||||
|
"id": "IDWN.id",
|
||||||
|
"name": "IndoWebNovel",
|
||||||
|
"site": "https://indowebnovel.id/id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/indonesian/indowebnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/id/indowebnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelringan.com",
|
||||||
|
"name": "NovelRingan",
|
||||||
|
"site": "https://novelringan.com/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/indonesian/novelringan.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/id/novelringan/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sakura.id",
|
||||||
|
"name": "SakuraNovel",
|
||||||
|
"site": "https://sakuranovel.id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/indonesian/sakuranovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/id/sakuranovel/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"日本語": [
|
||||||
|
{
|
||||||
|
"id": "yomou.syosetu",
|
||||||
|
"name": "Syosetu",
|
||||||
|
"site": "https://yomou.syosetu.com/",
|
||||||
|
"lang": "日本語",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/japanese/Syosetu.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/jp/syosetu/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"한국어, 조선말": [
|
||||||
|
{
|
||||||
|
"id": "agit.xyz",
|
||||||
|
"name": "Agitoon",
|
||||||
|
"site": "https://agit501.xyz/",
|
||||||
|
"lang": "한국어, 조선말",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/korean/Agitoon.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/kr/agitoon/agit.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Português": [
|
||||||
|
{
|
||||||
|
"id": "lightnovelbrasil",
|
||||||
|
"name": "Light Novel Brasil",
|
||||||
|
"site": "https://lightnovelbrasil.com/",
|
||||||
|
"lang": "Português",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/portuguese/lightnovelbrasil.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/multisrc/wpmangastream/icons/lightnovelbrasil.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"русский язык": [
|
||||||
|
{
|
||||||
|
"id": "AT",
|
||||||
|
"name": "Автор Тудей",
|
||||||
|
"site": "https://author.today",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/authortoday.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/authortoday/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bookriver",
|
||||||
|
"name": "Bookriver",
|
||||||
|
"site": "https://bookriver.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/bookriver.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/bookriver/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "EROLATE",
|
||||||
|
"name": "Erolate",
|
||||||
|
"site": "https://erolate.com",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/erolate.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/erolate/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "jaomix.ru",
|
||||||
|
"name": "Jaomix",
|
||||||
|
"site": "https://jaomix.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/jaomix.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/jaomix/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ReN",
|
||||||
|
"name": "Renovels",
|
||||||
|
"site": "https://renovels.org",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/renovels.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/renovels/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "RLIB",
|
||||||
|
"name": "RanobeLib",
|
||||||
|
"site": "https://ranobelib.me",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/ranobelib.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/ranobelib/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "RNBH.org",
|
||||||
|
"name": "RanobeHub",
|
||||||
|
"site": "https://ranobehub.org/",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/ranobehub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/ranobehub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "RNRF",
|
||||||
|
"name": "РанобэРФ",
|
||||||
|
"site": "https://ранобэ.рф",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/ranoberf.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/ranoberf/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "RULATE",
|
||||||
|
"name": "Rulate",
|
||||||
|
"site": "https://tl.rulate.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/rulate.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/rulate/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "TL",
|
||||||
|
"name": "NovelTL",
|
||||||
|
"site": "https://novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/russian/novelTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/ru/noveltl/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"español, castellano": [
|
||||||
|
{
|
||||||
|
"id": "awuxia.com",
|
||||||
|
"name": "ReinoWuxia",
|
||||||
|
"site": "http://www.reinowuxia.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/novelawuxia.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/novelawuxia/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "HasuTL",
|
||||||
|
"name": "Hasu Translations",
|
||||||
|
"site": "https://hasutl.wordpress.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/hasutl.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/hasutl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ligera.com",
|
||||||
|
"name": "Novelas Ligera",
|
||||||
|
"site": "https://novelasligera.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/novelasligera.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/novelasligera/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "oasisTL.wp",
|
||||||
|
"name": "Oasis Translations",
|
||||||
|
"site": "https://oasistranslations.wordpress.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/oasistranslations.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/oasistranslations/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "skynovels.net",
|
||||||
|
"name": "SkyNovels",
|
||||||
|
"site": "https://www.skynovels.net/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/skynovels.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/skynovels/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "TNL.com",
|
||||||
|
"name": "TuNovelaLigera",
|
||||||
|
"site": "https://tunovelaligera.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/tunovelaligera.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/tunovelaligera/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "yuukitls.com",
|
||||||
|
"name": "Yuuki Tls",
|
||||||
|
"site": "https://yuukitls.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/spanish/yukitls.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/es/yuukitls/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Türkçe": [
|
||||||
|
{
|
||||||
|
"id": "epiknovel.com",
|
||||||
|
"name": "EpikNovel",
|
||||||
|
"site": "https://www.epiknovel.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/turkish/epiknovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/tr/epiknovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lshnovel",
|
||||||
|
"name": "Liebe Schnee Hiver Novel",
|
||||||
|
"site": "https://lshnovel.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/turkish/lshnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/multisrc/wpmangastream/icons/lshnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Tiếng Việt": [
|
||||||
|
{
|
||||||
|
"id": "ln.hako",
|
||||||
|
"name": "Hako",
|
||||||
|
"site": "https://ln.hako.vn",
|
||||||
|
"lang": "Tiếng Việt",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/plugins/vietnamese/LNHako.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/K1ngfish3r/plugins/reducing/icons/src/vi/hakolightnovel/icon.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+895
@@ -0,0 +1,895 @@
|
|||||||
|
{
|
||||||
|
"العربية": [
|
||||||
|
{
|
||||||
|
"id": "ar-mtl",
|
||||||
|
"name": "ArMTL [madara]",
|
||||||
|
"site": "https://ar-mtl.club/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/ArMTL[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/armtl.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "arnovel",
|
||||||
|
"name": "ArNovel [madara]",
|
||||||
|
"site": "https://arnovel.me/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/ArNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/arnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "hizomanga",
|
||||||
|
"name": "HizoManga [madara]",
|
||||||
|
"site": "https://hizomanga.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/HizoManga[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/hizomanga.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kolnovel",
|
||||||
|
"name": "KolNovel",
|
||||||
|
"site": "https://kolnovel.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/kolnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/wpmangastream/icons/kolnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novel4up",
|
||||||
|
"name": "Novel4Up [madara]",
|
||||||
|
"site": "https://novel4up.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/Novel4Up[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/novel4up.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "riwyat",
|
||||||
|
"name": "Riwyat [madara]",
|
||||||
|
"site": "https://riwyat.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/Riwyat[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/riwyat.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "teamxnovel",
|
||||||
|
"name": "TeamXNovel [madara]",
|
||||||
|
"site": "https://teamxnovel.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/arabic/TeamXNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/teamxnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"English": [
|
||||||
|
{
|
||||||
|
"id": "1stkissnovel",
|
||||||
|
"name": "FirstKissNovel [madara]",
|
||||||
|
"site": "https://1stkissnovel.org/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/FirstKissNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/firstkissnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ANF.com",
|
||||||
|
"name": "AllNovelFull",
|
||||||
|
"site": "https://allnovelfull.com",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/allnovelfull.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/allnovelfull/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "BLN.com",
|
||||||
|
"name": "BestLightNovel",
|
||||||
|
"site": "https://bestlightnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/bestlightnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/bestlightnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "boxnovel",
|
||||||
|
"name": "BoxNovel [madara]",
|
||||||
|
"site": "https://boxnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/BoxNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/boxnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "clicknovel",
|
||||||
|
"name": "ClickNovel [madara]",
|
||||||
|
"site": "https://clicknovel.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/ClickNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/clicknovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "comrademao",
|
||||||
|
"name": "Comrade Mao",
|
||||||
|
"site": "https://comrademao.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/comrademao.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/comrademao/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "cratenovel",
|
||||||
|
"name": "CrateNovel [madara]",
|
||||||
|
"site": "https://cratenovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/CrateNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/cratenovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "daonovel",
|
||||||
|
"name": "DaoNovel [madara]",
|
||||||
|
"site": "https://daonovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/DaoNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/daonovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "DDL.com",
|
||||||
|
"name": "Divine Dao Library",
|
||||||
|
"site": "https://www.divinedaolibrary.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/divinedaolibrary.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/`en/divinedaolibrary/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "earlynovel",
|
||||||
|
"name": "Early Novel",
|
||||||
|
"site": "https://earlynovel.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/earlynovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/latestnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fanTLS",
|
||||||
|
"name": "Fans Translations [madara]",
|
||||||
|
"site": "https://fanstranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/FansTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/fanstranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fastnovel",
|
||||||
|
"name": "Fast Novel",
|
||||||
|
"site": "https://fastnovel.org/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/fastnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/fastnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "foxaholic",
|
||||||
|
"name": "Foxaholic",
|
||||||
|
"site": "https://www.foxaholic.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/foxaholic.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/foxaholic/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "freenovel.me",
|
||||||
|
"name": "FreeNovelMe [madara]",
|
||||||
|
"site": "https://freenovel.me/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/FreeNovelMe[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/freenovelme.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "freenovelupdates",
|
||||||
|
"name": "Free Novel Updates (Broken)",
|
||||||
|
"site": "https://www.freenovelupdates.com",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/freenovelupdates.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/freenovelupdates/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "FWN.com",
|
||||||
|
"name": "Web NOVEL",
|
||||||
|
"site": "https://freewebnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/freewebnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/freewebnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "guavaread",
|
||||||
|
"name": "Guavaread [madara]",
|
||||||
|
"site": "https://guavaread.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/Guavaread[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/guavaread.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lightnovelpub",
|
||||||
|
"name": "LightNovelPub",
|
||||||
|
"site": "https://www.lightnovelpub.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/lightnovelpub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/lightnovelpub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lnheaven",
|
||||||
|
"name": "LightNovelHeaven [madara]",
|
||||||
|
"site": "https://lightnovelheaven.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/LightNovelHeaven[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/lightnovelheaven.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Ltnovel.com",
|
||||||
|
"name": "Ltnovel.com",
|
||||||
|
"site": "https://www.ltnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/Ltnovelcom[readwn].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lunarletters",
|
||||||
|
"name": "LunarLetters [madara]",
|
||||||
|
"site": "https://www.lunarletters.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/LunarLetters[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/lunarletters.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mostnovel",
|
||||||
|
"name": "MostNovel [madara]",
|
||||||
|
"site": "https://mostnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/MostNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/mostnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtl-novel",
|
||||||
|
"name": "MTL-Novel [madara]",
|
||||||
|
"site": "https://mtl-novel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/MTLNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/mtl-novel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtlnovel.club",
|
||||||
|
"name": "MTLNovel.Club [madara]",
|
||||||
|
"site": "https://mtlnovel.club/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/MTLNovelClub[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/mtlnovel.club.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtlreader",
|
||||||
|
"name": "MTL Reader",
|
||||||
|
"site": "https://mtlreader.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/mtlreader.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/mtlreader/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mysticalmerries",
|
||||||
|
"name": "MysticalSeries [madara]",
|
||||||
|
"site": "https://mysticalmerries.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/MysticalSeries[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/mysticalseries.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "neosekaiTLS",
|
||||||
|
"name": "NeoSekai Translations [madara]",
|
||||||
|
"site": "https://www.neosekaitranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NeoSekaiTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/neosekaitranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NF.me",
|
||||||
|
"name": "NovelFull.me",
|
||||||
|
"site": "https://novelfull.me/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NovelFullMe.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/novelfullme/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nitroscans",
|
||||||
|
"name": "Nitroscans",
|
||||||
|
"site": "https://nitroscans.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/nitroscans.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/nitroscans/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NO.net",
|
||||||
|
"name": "novelsOnline",
|
||||||
|
"site": "https://novelsonline.net",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NovelOnline.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/coverNotAvailable.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NobleMTL",
|
||||||
|
"name": "NobleMTL",
|
||||||
|
"site": "https://www.noblemtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/nobleMTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/noblemtl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nocturneTLS",
|
||||||
|
"name": "Nocturne Translations [madara]",
|
||||||
|
"site": "https://nocturnetls.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NocturneTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/nocturnetranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "noobchanTL",
|
||||||
|
"name": "Noobchan Translation [madara]",
|
||||||
|
"site": "https://noobchan.xyz/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NoobchanTranslation[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/noobchantranslation.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelforest",
|
||||||
|
"name": "Novel Forest (Broken)",
|
||||||
|
"site": "https://novelforest.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/novelforest.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/novelforest/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelfull",
|
||||||
|
"name": "NovelFull",
|
||||||
|
"site": "https://novelfull.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/novelfull.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/novelfull/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelhold",
|
||||||
|
"name": "Novel Hold",
|
||||||
|
"site": "https://novelhold.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/novelhold.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/novelhold/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Novelmt.com",
|
||||||
|
"name": "Novelmt.com",
|
||||||
|
"site": "https://www.novelmt.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/Novelmtcom[readwn].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelmultiverse",
|
||||||
|
"name": "NovelMultiverse [madara]",
|
||||||
|
"site": "https://www.novelmultiverse.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NovelMultiverse[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/novelmultiverse.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelpub.com",
|
||||||
|
"name": "NovelPub",
|
||||||
|
"site": "https://www.novelpub.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/novelpub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/novelpub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelr18",
|
||||||
|
"name": "NovelR18 [madara]",
|
||||||
|
"site": "https://novelr18.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NovelR18[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/novelr18.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelroom",
|
||||||
|
"name": "Novelroom.net [madara]",
|
||||||
|
"site": "https://novelroom.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/Novelroomnet[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/novelroom.net.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelstic",
|
||||||
|
"name": "Novelstic [madara]",
|
||||||
|
"site": "https://novelstic.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/Novelstic[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/novelstic.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelTL",
|
||||||
|
"name": "NovelTranslate [madara]",
|
||||||
|
"site": "https://noveltranslate.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/NovelTranslate[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/noveltranslate.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "onlymtl",
|
||||||
|
"name": "OnlyMTL [madara]",
|
||||||
|
"site": "https://www.onlymtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/OnlyMTL[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/onlymtl.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "PandaMTL",
|
||||||
|
"name": "PandaMTL",
|
||||||
|
"site": "https://www.pandamtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/pandaMTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/en/wordpress/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "readwebnovels",
|
||||||
|
"name": "ReadWebNovels [madara]",
|
||||||
|
"site": "https://readwebnovels.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/ReadWebNovels[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/readwebnovels.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Readwn.com",
|
||||||
|
"name": "Readwn.com",
|
||||||
|
"site": "https://www.readwn.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/Readwncom[readwn].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sleeptTLS",
|
||||||
|
"name": "SleepyTranslations [madara]",
|
||||||
|
"site": "https://sleepytranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/SleepyTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/sleepytranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sonicmtl",
|
||||||
|
"name": "SonicMTL [madara]",
|
||||||
|
"site": "https://www.sonicmtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/SonicMTL[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/sonicmtl.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sugarbbscan",
|
||||||
|
"name": "Sugar Babies [madara]",
|
||||||
|
"site": "https://sugarbbscan.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/SugarBabies[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/sugarbabies.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sweetEscapeTL",
|
||||||
|
"name": "Sweet Escape Translations [madara]",
|
||||||
|
"site": "https://sweetescapetranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/SweetEscapeTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/sweetescapetranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "webnovelover",
|
||||||
|
"name": "WebNovelLover [madara]",
|
||||||
|
"site": "https://www.webnovelover.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/WebNovelLover[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/webnovellover.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wuxiaworld.site",
|
||||||
|
"name": "WuxiaWorld.Site [madara]",
|
||||||
|
"site": "https://wuxiaworld.site/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/WuxiaWorldSite[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/wuxiaworld.site.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "zetroTL",
|
||||||
|
"name": "Zetro Translation [madara]",
|
||||||
|
"site": "https://zetrotranslation.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/ZetroTranslation[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/zetrotranslation.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "zinnovel",
|
||||||
|
"name": "ZinnNovel [madara]",
|
||||||
|
"site": "https://zinnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/english/ZinnNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/zinnnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"français, française": [
|
||||||
|
{
|
||||||
|
"id": "chireads.com",
|
||||||
|
"name": "Chireads",
|
||||||
|
"site": "https://chireads.com/",
|
||||||
|
"lang": "français, française",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/french/chireads.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/fr/chireads/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Bahasa Indonesia": [
|
||||||
|
{
|
||||||
|
"id": "IDWN.id",
|
||||||
|
"name": "IndoWebNovel",
|
||||||
|
"site": "https://indowebnovel.id/id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/indonesian/indowebnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/id/indowebnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "meionovel",
|
||||||
|
"name": "MeioNovel [madara]",
|
||||||
|
"site": "https://meionovel.id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/indonesian/MeioNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/meionovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "morenovel",
|
||||||
|
"name": "MoreNovel [madara]",
|
||||||
|
"site": "https://morenovel.net/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/indonesian/MoreNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/morenovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelringan.com",
|
||||||
|
"name": "NovelRingan",
|
||||||
|
"site": "https://novelringan.com/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/indonesian/novelringan.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/id/novelringan/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sakura.id",
|
||||||
|
"name": "SakuraNovel",
|
||||||
|
"site": "https://sakuranovel.id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/indonesian/sakuranovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/id/sakuranovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wbnovel",
|
||||||
|
"name": "WBNovel [madara]",
|
||||||
|
"site": "https://wbnovel.com/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/indonesian/WBNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/wbnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"日本語": [
|
||||||
|
{
|
||||||
|
"id": "yomou.syosetu",
|
||||||
|
"name": "Syosetu",
|
||||||
|
"site": "https//yomou.syosetu.com/",
|
||||||
|
"lang": "日本語",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/japanese/Syosetu.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/jp/syosetu/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Português": [
|
||||||
|
{
|
||||||
|
"id": "lightnovelbrasil",
|
||||||
|
"name": "Light Novel Brasil",
|
||||||
|
"site": "https://lightnovelbrasil.com/",
|
||||||
|
"lang": "Português",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/portuguese/lightnovelbrasil.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/wpmangastream/icons/lightnovelbrasil.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"русский язык": [
|
||||||
|
{
|
||||||
|
"id": "axel.znovel",
|
||||||
|
"name": "Аксел",
|
||||||
|
"site": "https://axel.znovel.space",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/axelznovelspace[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bel.novel",
|
||||||
|
"name": "Белманга",
|
||||||
|
"site": "https://bel.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/belnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "erolate",
|
||||||
|
"name": "Erolate",
|
||||||
|
"site": "https://erolate.com",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/Erolate[rulate].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "jaomix.ru",
|
||||||
|
"name": "Jaomix",
|
||||||
|
"site": "https://jaomix.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/jaomix.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/ru/jaomix/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "japit.novel",
|
||||||
|
"name": "Japit Comics",
|
||||||
|
"site": "https://japit.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/japitnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kg.novel",
|
||||||
|
"name": "Карманная галактика",
|
||||||
|
"site": "https://kg.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/kgnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kod.novel",
|
||||||
|
"name": "K.O.D.",
|
||||||
|
"site": "https://kod.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/kodnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nightnovel",
|
||||||
|
"name": "Nightnovel",
|
||||||
|
"site": "https://nightnovel.online",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/nightnovelonline[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "original.novel",
|
||||||
|
"name": "Авторские работы",
|
||||||
|
"site": "https://original.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/originalnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "red.novel",
|
||||||
|
"name": "Север и Юг",
|
||||||
|
"site": "https://red.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/rednoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ruranobe",
|
||||||
|
"name": "РуРанобэ",
|
||||||
|
"site": "https://ruranobe.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/ruranoberu[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sferdrakon.novel",
|
||||||
|
"name": "Уголок дракона",
|
||||||
|
"site": "https://sferdrakon.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/sferdrakonnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "si.novel",
|
||||||
|
"name": "Сказочные истории",
|
||||||
|
"site": "https://si.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/sinoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "snailulitka.novel",
|
||||||
|
"name": "Snailulitka",
|
||||||
|
"site": "https://snailulitka.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/snailulitkanoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tl.rulate",
|
||||||
|
"name": "Rulate",
|
||||||
|
"site": "https://tl.rulate.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/Rulate[rulate].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tsundoku.novel",
|
||||||
|
"name": "TsundokuTrans",
|
||||||
|
"site": "https://tsundoku.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/tsundokunoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ukr.novel",
|
||||||
|
"name": "Переклади українською мовою",
|
||||||
|
"site": "https://ukr.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/russian/ukrnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"español, castellano": [
|
||||||
|
{
|
||||||
|
"id": "HasuTL",
|
||||||
|
"name": "Hasu Translations",
|
||||||
|
"site": "https://hasutl.wordpress.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/spanish/hasutl.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/es/hasutl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ligera.com",
|
||||||
|
"name": "Novelas Ligera",
|
||||||
|
"site": "https://novelasligera.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/spanish/novelasligera.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/es/novelasligera/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "TNL.com",
|
||||||
|
"name": "TuNovelaLigera",
|
||||||
|
"site": "https://tunovelaligera.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/spanish/tunovelaligera.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/es/tunovelaligera/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "yuukitls.com",
|
||||||
|
"name": "Yuuki Tls",
|
||||||
|
"site": "https://yuukitls.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/spanish/yukitls.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/es/yuukitls/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Türkçe": [
|
||||||
|
{
|
||||||
|
"id": "epiknovel.com",
|
||||||
|
"name": "EpikNovel",
|
||||||
|
"site": "https://www.epiknovel.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/turkish/epiknovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/tr/epiknovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lshnovel",
|
||||||
|
"name": "Liebe Schnee Hiver Novel",
|
||||||
|
"site": "https://lshnovel.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/turkish/lshnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/wpmangastream/icons/lshnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "turkcelightnovels",
|
||||||
|
"name": "TurkceLightNovels [madara]",
|
||||||
|
"site": "https://turkcelightnovels.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/turkish/TurkceLightNovels[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/turkcelightnovels.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "webnoveloku",
|
||||||
|
"name": "WebNovelOku [madara]",
|
||||||
|
"site": "https://www.webnoveloku.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/turkish/WebNovelOku[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/multisrc/madara/icons/webnoveloku.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Tiếng Việt": [
|
||||||
|
{
|
||||||
|
"id": "ln.hako",
|
||||||
|
"name": "Hako",
|
||||||
|
"site": "https://ln.hako.vn",
|
||||||
|
"lang": "Tiếng Việt",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/js/plugins/vietnamese/LNHako.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/SkillGG/lnreader-plugins/ts-support/icons/src/vi/hakolightnovel/icon.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+895
@@ -0,0 +1,895 @@
|
|||||||
|
{
|
||||||
|
"العربية": [
|
||||||
|
{
|
||||||
|
"id": "ar-mtl",
|
||||||
|
"name": "ArMTL [madara]",
|
||||||
|
"site": "https://ar-mtl.club/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/ArMTL[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/armtl.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "arnovel",
|
||||||
|
"name": "ArNovel [madara]",
|
||||||
|
"site": "https://arnovel.me/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/ArNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/arnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "hizomanga",
|
||||||
|
"name": "HizoManga [madara]",
|
||||||
|
"site": "https://hizomanga.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/HizoManga[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/hizomanga.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kolnovel",
|
||||||
|
"name": "KolNovel",
|
||||||
|
"site": "https://kolnovel.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/kolnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/wpmangastream/icons/kolnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novel4up",
|
||||||
|
"name": "Novel4Up [madara]",
|
||||||
|
"site": "https://novel4up.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/Novel4Up[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/novel4up.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "riwyat",
|
||||||
|
"name": "Riwyat [madara]",
|
||||||
|
"site": "https://riwyat.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/Riwyat[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/riwyat.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "teamxnovel",
|
||||||
|
"name": "TeamXNovel [madara]",
|
||||||
|
"site": "https://teamxnovel.com/",
|
||||||
|
"lang": "العربية",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/arabic/TeamXNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/teamxnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"English": [
|
||||||
|
{
|
||||||
|
"id": "1stkissnovel",
|
||||||
|
"name": "FirstKissNovel [madara]",
|
||||||
|
"site": "https://1stkissnovel.org/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/FirstKissNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/firstkissnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ANF.com",
|
||||||
|
"name": "AllNovelFull",
|
||||||
|
"site": "https://allnovelfull.com",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/allnovelfull.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/allnovelfull/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "BLN.com",
|
||||||
|
"name": "BestLightNovel",
|
||||||
|
"site": "https://bestlightnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/bestlightnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/bestlightnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "boxnovel",
|
||||||
|
"name": "BoxNovel [madara]",
|
||||||
|
"site": "https://boxnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/BoxNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/boxnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "clicknovel",
|
||||||
|
"name": "ClickNovel [madara]",
|
||||||
|
"site": "https://clicknovel.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/ClickNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/clicknovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "comrademao",
|
||||||
|
"name": "Comrade Mao",
|
||||||
|
"site": "https://comrademao.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/comrademao.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/comrademao/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "cratenovel",
|
||||||
|
"name": "CrateNovel [madara]",
|
||||||
|
"site": "https://cratenovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/CrateNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/cratenovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "daonovel",
|
||||||
|
"name": "DaoNovel [madara]",
|
||||||
|
"site": "https://daonovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/DaoNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/daonovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "DDL.com",
|
||||||
|
"name": "Divine Dao Library",
|
||||||
|
"site": "https://www.divinedaolibrary.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/divinedaolibrary.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/`en/divinedaolibrary/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "earlynovel",
|
||||||
|
"name": "Early Novel",
|
||||||
|
"site": "https://earlynovel.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/earlynovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/latestnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fanTLS",
|
||||||
|
"name": "Fans Translations [madara]",
|
||||||
|
"site": "https://fanstranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/FansTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/fanstranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fastnovel",
|
||||||
|
"name": "Fast Novel",
|
||||||
|
"site": "https://fastnovel.org/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/fastnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/fastnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "foxaholic",
|
||||||
|
"name": "Foxaholic",
|
||||||
|
"site": "https://www.foxaholic.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/foxaholic.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/foxaholic/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "freenovel.me",
|
||||||
|
"name": "FreeNovelMe [madara]",
|
||||||
|
"site": "https://freenovel.me/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/FreeNovelMe[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/freenovelme.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "freenovelupdates",
|
||||||
|
"name": "Free Novel Updates (Broken)",
|
||||||
|
"site": "https://www.freenovelupdates.com",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/freenovelupdates.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/freenovelupdates/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "FWN.com",
|
||||||
|
"name": "Web NOVEL",
|
||||||
|
"site": "https://freewebnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/freewebnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/freewebnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "guavaread",
|
||||||
|
"name": "Guavaread [madara]",
|
||||||
|
"site": "https://guavaread.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/Guavaread[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/guavaread.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lightnovelpub",
|
||||||
|
"name": "LightNovelPub",
|
||||||
|
"site": "https://www.lightnovelpub.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/lightnovelpub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/lightnovelpub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lnheaven",
|
||||||
|
"name": "LightNovelHeaven [madara]",
|
||||||
|
"site": "https://lightnovelheaven.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/LightNovelHeaven[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/lightnovelheaven.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Ltnovel.com",
|
||||||
|
"name": "Ltnovel.com",
|
||||||
|
"site": "https://www.ltnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/Ltnovelcom[readwn].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/readwn/icon/ltnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lunarletters",
|
||||||
|
"name": "LunarLetters [madara]",
|
||||||
|
"site": "https://www.lunarletters.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/LunarLetters[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/lunarletters.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mostnovel",
|
||||||
|
"name": "MostNovel [madara]",
|
||||||
|
"site": "https://mostnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/MostNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/mostnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtl-novel",
|
||||||
|
"name": "MTL-Novel [madara]",
|
||||||
|
"site": "https://mtl-novel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/MTLNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/mtl-novel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtlnovel.club",
|
||||||
|
"name": "MTLNovel.Club [madara]",
|
||||||
|
"site": "https://mtlnovel.club/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/MTLNovelClub[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/mtlnovel.club.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mtlreader",
|
||||||
|
"name": "MTL Reader",
|
||||||
|
"site": "https://mtlreader.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/mtlreader.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/mtlreader/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mysticalmerries",
|
||||||
|
"name": "MysticalSeries [madara]",
|
||||||
|
"site": "https://mysticalmerries.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/MysticalSeries[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/mysticalseries.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "neosekaiTLS",
|
||||||
|
"name": "NeoSekai Translations [madara]",
|
||||||
|
"site": "https://www.neosekaitranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NeoSekaiTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/neosekaitranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NF.me",
|
||||||
|
"name": "NovelFull.me",
|
||||||
|
"site": "https://novelfull.me/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NovelFullMe.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/novelfullme/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nitroscans",
|
||||||
|
"name": "Nitroscans",
|
||||||
|
"site": "https://nitroscans.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/nitroscans.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/nitroscans/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NO.net",
|
||||||
|
"name": "novelsOnline",
|
||||||
|
"site": "https://novelsonline.net",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NovelOnline.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/coverNotAvailable.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NobleMTL",
|
||||||
|
"name": "NobleMTL",
|
||||||
|
"site": "https://www.noblemtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/nobleMTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/noblemtl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nocturneTLS",
|
||||||
|
"name": "Nocturne Translations [madara]",
|
||||||
|
"site": "https://nocturnetls.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NocturneTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/nocturnetranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "noobchanTL",
|
||||||
|
"name": "Noobchan Translation [madara]",
|
||||||
|
"site": "https://noobchan.xyz/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NoobchanTranslation[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/noobchantranslation.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelforest",
|
||||||
|
"name": "Novel Forest (Broken)",
|
||||||
|
"site": "https://novelforest.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/novelforest.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/novelforest/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelfull",
|
||||||
|
"name": "NovelFull",
|
||||||
|
"site": "https://novelfull.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/novelfull.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/novelfull/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelhold",
|
||||||
|
"name": "Novel Hold",
|
||||||
|
"site": "https://novelhold.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/novelhold.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/novelhold/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Novelmt.com",
|
||||||
|
"name": "Novelmt.com",
|
||||||
|
"site": "https://www.novelmt.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/Novelmtcom[readwn].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/readwn/icon/novelmt.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelmultiverse",
|
||||||
|
"name": "NovelMultiverse [madara]",
|
||||||
|
"site": "https://www.novelmultiverse.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NovelMultiverse[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/novelmultiverse.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelpub.com",
|
||||||
|
"name": "NovelPub",
|
||||||
|
"site": "https://www.novelpub.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/novelpub.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/novelpub/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelr18",
|
||||||
|
"name": "NovelR18 [madara]",
|
||||||
|
"site": "https://novelr18.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NovelR18[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/novelr18.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelroom",
|
||||||
|
"name": "Novelroom.net [madara]",
|
||||||
|
"site": "https://novelroom.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/Novelroomnet[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/novelroom.net.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelstic",
|
||||||
|
"name": "Novelstic [madara]",
|
||||||
|
"site": "https://novelstic.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/Novelstic[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/novelstic.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelTL",
|
||||||
|
"name": "NovelTranslate [madara]",
|
||||||
|
"site": "https://noveltranslate.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/NovelTranslate[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/noveltranslate.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "onlymtl",
|
||||||
|
"name": "OnlyMTL [madara]",
|
||||||
|
"site": "https://www.onlymtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/OnlyMTL[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/onlymtl.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "PandaMTL",
|
||||||
|
"name": "PandaMTL",
|
||||||
|
"site": "https://www.pandamtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/pandaMTL.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/en/wordpress/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "readwebnovels",
|
||||||
|
"name": "ReadWebNovels [madara]",
|
||||||
|
"site": "https://readwebnovels.net/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/ReadWebNovels[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/readwebnovels.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Readwn.com",
|
||||||
|
"name": "Readwn.com",
|
||||||
|
"site": "https://www.readwn.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/Readwncom[readwn].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/readwn/icon/readwn.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sleeptTLS",
|
||||||
|
"name": "SleepyTranslations [madara]",
|
||||||
|
"site": "https://sleepytranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/SleepyTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/sleepytranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sonicmtl",
|
||||||
|
"name": "SonicMTL [madara]",
|
||||||
|
"site": "https://www.sonicmtl.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/SonicMTL[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/sonicmtl.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sugarbbscan",
|
||||||
|
"name": "Sugar Babies [madara]",
|
||||||
|
"site": "https://sugarbbscan.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/SugarBabies[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/sugarbabies.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sweetEscapeTL",
|
||||||
|
"name": "Sweet Escape Translations [madara]",
|
||||||
|
"site": "https://sweetescapetranslations.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/SweetEscapeTranslations[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/sweetescapetranslations.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "webnovelover",
|
||||||
|
"name": "WebNovelLover [madara]",
|
||||||
|
"site": "https://www.webnovelover.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/WebNovelLover[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/webnovellover.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wuxiaworld.site",
|
||||||
|
"name": "WuxiaWorld.Site [madara]",
|
||||||
|
"site": "https://wuxiaworld.site/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/WuxiaWorldSite[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/wuxiaworld.site.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "zetroTL",
|
||||||
|
"name": "Zetro Translation [madara]",
|
||||||
|
"site": "https://zetrotranslation.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/ZetroTranslation[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/zetrotranslation.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "zinnovel",
|
||||||
|
"name": "ZinnNovel [madara]",
|
||||||
|
"site": "https://zinnovel.com/",
|
||||||
|
"lang": "English",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/english/ZinnNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/zinnnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"français, française": [
|
||||||
|
{
|
||||||
|
"id": "chireads.com",
|
||||||
|
"name": "Chireads",
|
||||||
|
"site": "https://chireads.com/",
|
||||||
|
"lang": "français, française",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/french/chireads.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/fr/chireads/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Bahasa Indonesia": [
|
||||||
|
{
|
||||||
|
"id": "IDWN.id",
|
||||||
|
"name": "IndoWebNovel",
|
||||||
|
"site": "https://indowebnovel.id/id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/indonesian/indowebnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/id/indowebnovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "meionovel",
|
||||||
|
"name": "MeioNovel [madara]",
|
||||||
|
"site": "https://meionovel.id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/indonesian/MeioNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/meionovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "morenovel",
|
||||||
|
"name": "MoreNovel [madara]",
|
||||||
|
"site": "https://morenovel.net/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/indonesian/MoreNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/morenovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "novelringan.com",
|
||||||
|
"name": "NovelRingan",
|
||||||
|
"site": "https://novelringan.com/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/indonesian/novelringan.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/id/novelringan/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sakura.id",
|
||||||
|
"name": "SakuraNovel",
|
||||||
|
"site": "https://sakuranovel.id/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/indonesian/sakuranovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/id/sakuranovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wbnovel",
|
||||||
|
"name": "WBNovel [madara]",
|
||||||
|
"site": "https://wbnovel.com/",
|
||||||
|
"lang": "Bahasa Indonesia",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/indonesian/WBNovel[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/wbnovel.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"日本語": [
|
||||||
|
{
|
||||||
|
"id": "yomou.syosetu",
|
||||||
|
"name": "Syosetu",
|
||||||
|
"site": "https//yomou.syosetu.com/",
|
||||||
|
"lang": "日本語",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/japanese/Syosetu.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/jp/syosetu/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Português": [
|
||||||
|
{
|
||||||
|
"id": "lightnovelbrasil",
|
||||||
|
"name": "Light Novel Brasil",
|
||||||
|
"site": "https://lightnovelbrasil.com/",
|
||||||
|
"lang": "Português",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/portuguese/lightnovelbrasil.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/wpmangastream/icons/lightnovelbrasil.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"русский язык": [
|
||||||
|
{
|
||||||
|
"id": "axel.znovel",
|
||||||
|
"name": "Аксел",
|
||||||
|
"site": "https://axel.znovel.space",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/axelznovelspace[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bel.novel",
|
||||||
|
"name": "Белманга",
|
||||||
|
"site": "https://bel.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/belnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "erolate",
|
||||||
|
"name": "Erolate",
|
||||||
|
"site": "https://erolate.com",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/Erolate[rulate].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "jaomix.ru",
|
||||||
|
"name": "Jaomix",
|
||||||
|
"site": "https://jaomix.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/jaomix.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/ru/jaomix/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "japit.novel",
|
||||||
|
"name": "Japit Comics",
|
||||||
|
"site": "https://japit.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/japitnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kg.novel",
|
||||||
|
"name": "Карманная галактика",
|
||||||
|
"site": "https://kg.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/kgnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kod.novel",
|
||||||
|
"name": "K.O.D.",
|
||||||
|
"site": "https://kod.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/kodnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "nightnovel",
|
||||||
|
"name": "Nightnovel",
|
||||||
|
"site": "https://nightnovel.online",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/nightnovelonline[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "original.novel",
|
||||||
|
"name": "Авторские работы",
|
||||||
|
"site": "https://original.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/originalnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "red.novel",
|
||||||
|
"name": "Север и Юг",
|
||||||
|
"site": "https://red.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/rednoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ruranobe",
|
||||||
|
"name": "РуРанобэ",
|
||||||
|
"site": "https://ruranobe.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/ruranoberu[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sferdrakon.novel",
|
||||||
|
"name": "Уголок дракона",
|
||||||
|
"site": "https://sferdrakon.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/sferdrakonnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "si.novel",
|
||||||
|
"name": "Сказочные истории",
|
||||||
|
"site": "https://si.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/sinoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "snailulitka.novel",
|
||||||
|
"name": "Snailulitka",
|
||||||
|
"site": "https://snailulitka.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/snailulitkanoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tl.rulate",
|
||||||
|
"name": "Rulate",
|
||||||
|
"site": "https://tl.rulate.ru",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/Rulate[rulate].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tsundoku.novel",
|
||||||
|
"name": "TsundokuTrans",
|
||||||
|
"site": "https://tsundoku.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/tsundokunoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ukr.novel",
|
||||||
|
"name": "Переклади українською мовою",
|
||||||
|
"site": "https://ukr.novel.tl",
|
||||||
|
"lang": "русский язык",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/russian/ukrnoveltl[noveltl].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"español, castellano": [
|
||||||
|
{
|
||||||
|
"id": "HasuTL",
|
||||||
|
"name": "Hasu Translations",
|
||||||
|
"site": "https://hasutl.wordpress.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/spanish/hasutl.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/es/hasutl/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ligera.com",
|
||||||
|
"name": "Novelas Ligera",
|
||||||
|
"site": "https://novelasligera.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/spanish/novelasligera.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/es/novelasligera/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "TNL.com",
|
||||||
|
"name": "TuNovelaLigera",
|
||||||
|
"site": "https://tunovelaligera.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/spanish/tunovelaligera.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/es/tunovelaligera/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "yuukitls.com",
|
||||||
|
"name": "Yuuki Tls",
|
||||||
|
"site": "https://yuukitls.com/",
|
||||||
|
"lang": "español, castellano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/spanish/yukitls.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/es/yuukitls/icon.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Türkçe": [
|
||||||
|
{
|
||||||
|
"id": "epiknovel.com",
|
||||||
|
"name": "EpikNovel",
|
||||||
|
"site": "https://www.epiknovel.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/turkish/epiknovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/tr/epiknovel/icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "lshnovel",
|
||||||
|
"name": "Liebe Schnee Hiver Novel",
|
||||||
|
"site": "https://lshnovel.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/turkish/lshnovel.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/wpmangastream/icons/lshnovel.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "turkcelightnovels",
|
||||||
|
"name": "TurkceLightNovels [madara]",
|
||||||
|
"site": "https://turkcelightnovels.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/turkish/TurkceLightNovels[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/turkcelightnovels.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "webnoveloku",
|
||||||
|
"name": "WebNovelOku [madara]",
|
||||||
|
"site": "https://www.webnoveloku.com/",
|
||||||
|
"lang": "Türkçe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/turkish/WebNovelOku[madara].js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/multisrc/madara/icons/webnoveloku.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Tiếng Việt": [
|
||||||
|
{
|
||||||
|
"id": "ln.hako",
|
||||||
|
"name": "Hako",
|
||||||
|
"site": "https://ln.hako.vn",
|
||||||
|
"lang": "Tiếng Việt",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"url": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/js/plugins/vietnamese/LNHako.js",
|
||||||
|
"iconUrl": "https://raw.githubusercontent.com/nyagami/plugins/ts-support/icons/src/vi/hakolightnovel/icon.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
@@ -1,65 +0,0 @@
|
|||||||
require('module-alias/register');
|
|
||||||
|
|
||||||
const path = require('path');
|
|
||||||
const dayjs = require('dayjs')
|
|
||||||
const express = require('express');
|
|
||||||
const bodyParser = require('body-parser');
|
|
||||||
const pluginApi = require('@api/plugins');
|
|
||||||
const localizedFormat = require('dayjs/plugin/localizedFormat');
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
const port = 3000;
|
|
||||||
const host = 'localhost';
|
|
||||||
|
|
||||||
app.use(bodyParser.json());
|
|
||||||
app.use('/static', express.static(path.join(__dirname, 'test_web', 'static')));
|
|
||||||
app.get('/all_plugins', (req, res) => {
|
|
||||||
res.json(pluginApi.all_plugins());
|
|
||||||
});
|
|
||||||
app.post('/popularNovels/', async (req, res) => {
|
|
||||||
const filters = req.body['filters'] || {};
|
|
||||||
const showLatestNovels = req.body['showLatestNovels'] || false
|
|
||||||
const novels = await pluginApi.popularNovels(req.body['pluginRequirePath'], {showLatestNovels, filters});
|
|
||||||
res.json(novels);
|
|
||||||
});
|
|
||||||
app.post('/searchNovels/', async(req, res) => {
|
|
||||||
const novels = await pluginApi.searchNovels(req.body['pluginRequirePath'], req.body['searchTerm']);
|
|
||||||
res.json(novels);
|
|
||||||
})
|
|
||||||
app.post('/parseNovelAndChapters/', async(req, res) => {
|
|
||||||
const sourceNovel = await pluginApi.parseNovelAndChapters(req.body['pluginRequirePath'], req.body['novelUrl']);
|
|
||||||
res.json(sourceNovel);
|
|
||||||
})
|
|
||||||
app.post('/parseChapter/', async(req, res) => {
|
|
||||||
const chapterText = await pluginApi.parseChapter(req.body['pluginRequirePath'], req.body['chapterUrl']);
|
|
||||||
res.json(chapterText);
|
|
||||||
})
|
|
||||||
app.post('/fetchImage/', async(req, res) => {
|
|
||||||
const base64 = await pluginApi.fetchImage(req.body['pluginRequirePath'], req.body['url']);
|
|
||||||
res.json(base64);
|
|
||||||
})
|
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
|
||||||
res.sendFile(path.join(__dirname, 'test_web', 'index.html'));
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
app.listen(port, host, () => {
|
|
||||||
console.log("Testing plugins web listening on http://localhost:3000");
|
|
||||||
});
|
|
||||||
|
|
||||||
//Dayjs localization
|
|
||||||
const language = Intl?.DateTimeFormat()?.resolvedOptions()?.locale || "en";
|
|
||||||
|
|
||||||
require("dayjs/locale/ar");
|
|
||||||
require("dayjs/locale/de");
|
|
||||||
require("dayjs/locale/es");
|
|
||||||
require("dayjs/locale/it");
|
|
||||||
require("dayjs/locale/pt");
|
|
||||||
require("dayjs/locale/ru");
|
|
||||||
require("dayjs/locale/tr");
|
|
||||||
require("dayjs/locale/uk");
|
|
||||||
require("dayjs/locale/zh");
|
|
||||||
|
|
||||||
dayjs.locale(language);
|
|
||||||
dayjs.extend(localizedFormat);
|
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
require("module-alias/register");
|
||||||
|
|
||||||
|
import path from "path";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import express from "express";
|
||||||
|
import bodyParser from "body-parser";
|
||||||
|
import * as pluginApi from "./test_web/api/plugins";
|
||||||
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
const port = 3000;
|
||||||
|
const host = "localhost";
|
||||||
|
|
||||||
|
const dirname = path.join(__dirname, "..");
|
||||||
|
|
||||||
|
app.use(bodyParser.json());
|
||||||
|
app.use("/static", express.static(path.join(dirname, "test_web", "static")));
|
||||||
|
app.get("/all_plugins", (req, res) => {
|
||||||
|
const allPlugins = pluginApi.all_plugins();
|
||||||
|
res.json(allPlugins);
|
||||||
|
});
|
||||||
|
app.post("/popularNovels/", async (req, res) => {
|
||||||
|
const filters = req.body["filters"] || {};
|
||||||
|
const showLatestNovels = req.body["showLatestNovels"] || false;
|
||||||
|
const novels = await pluginApi.popularNovels(
|
||||||
|
req.body["pluginRequirePath"],
|
||||||
|
{ showLatestNovels, filters }
|
||||||
|
);
|
||||||
|
res.json(novels);
|
||||||
|
});
|
||||||
|
app.post("/searchNovels/", async (req, res) => {
|
||||||
|
const novels = await pluginApi.searchNovels(
|
||||||
|
req.body["pluginRequirePath"],
|
||||||
|
req.body["searchTerm"]
|
||||||
|
);
|
||||||
|
res.json(novels);
|
||||||
|
});
|
||||||
|
app.post("/parseNovelAndChapters/", async (req, res) => {
|
||||||
|
const sourceNovel = await pluginApi.parseNovelAndChapters(
|
||||||
|
req.body["pluginRequirePath"],
|
||||||
|
req.body["novelUrl"]
|
||||||
|
);
|
||||||
|
res.json(sourceNovel);
|
||||||
|
});
|
||||||
|
app.post("/parseChapter/", async (req, res) => {
|
||||||
|
const chapterText = await pluginApi.parseChapter(
|
||||||
|
req.body["pluginRequirePath"],
|
||||||
|
req.body["chapterUrl"]
|
||||||
|
);
|
||||||
|
res.json(chapterText);
|
||||||
|
});
|
||||||
|
app.post("/fetchImage/", async (req, res) => {
|
||||||
|
const base64 = await pluginApi.fetchImage(
|
||||||
|
req.body["pluginRequirePath"],
|
||||||
|
req.body["url"]
|
||||||
|
);
|
||||||
|
res.json(base64);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.sendFile(path.join(dirname, "test_web", "index.html"));
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(port, host, () => {
|
||||||
|
console.log("Testing plugins web listening on http://localhost:3000");
|
||||||
|
});
|
||||||
|
|
||||||
|
//Dayjs localization
|
||||||
|
const language = Intl?.DateTimeFormat()?.resolvedOptions()?.locale || "en";
|
||||||
|
|
||||||
|
require("dayjs/locale/ar");
|
||||||
|
require("dayjs/locale/de");
|
||||||
|
require("dayjs/locale/es");
|
||||||
|
require("dayjs/locale/it");
|
||||||
|
require("dayjs/locale/pt");
|
||||||
|
require("dayjs/locale/ru");
|
||||||
|
require("dayjs/locale/tr");
|
||||||
|
require("dayjs/locale/uk");
|
||||||
|
require("dayjs/locale/zh");
|
||||||
|
|
||||||
|
dayjs.locale(language);
|
||||||
|
dayjs.extend(localizedFormat);
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "ar-mtl";
|
||||||
|
exports.name = "ArMTL [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/armtl.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://ar-mtl.club/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "arnovel";
|
||||||
|
exports.name = "ArNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/arnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://arnovel.me/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "hizomanga";
|
||||||
|
exports.name = "HizoManga [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/hizomanga.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://hizomanga.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "serie" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "serie" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "novel4up";
|
||||||
|
exports.name = "Novel4Up [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/novel4up.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://novel4up.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "riwyat";
|
||||||
|
exports.name = "Riwyat [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/riwyat.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://riwyat.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "teamxnovel";
|
||||||
|
exports.name = "TeamXNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/teamxnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://teamxnovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,245 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.filters = exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
exports.id = "kolnovel";
|
||||||
|
exports.name = "KolNovel";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "multisrc/wpmangastream/icons/kolnovel.png";
|
||||||
|
exports.site = "https://kolnovel.com/";
|
||||||
|
module.exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let link = `${baseUrl}series/?page=${page}`;
|
||||||
|
if (filters) {
|
||||||
|
if (Array.isArray(filters.genres) && filters.genres.length) {
|
||||||
|
link += filters.genres.map((i) => `&genre[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
if (Array.isArray(filters.type) && filters.type.length)
|
||||||
|
link += filters.type.map((i) => `&lang[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters.status : "");
|
||||||
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters.order : "popular");
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(link, {}, pluginId).then((result) => result.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.maindet").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function parseNovelAndChapters(novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("h1.entry-title").text();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
|
loadedCheerio("div.serl:nth-child(3) > span").each(function () {
|
||||||
|
const detailName = loadedCheerio(this).text().trim();
|
||||||
|
const detail = loadedCheerio(this).next().text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case "الكاتب":
|
||||||
|
case "Author":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.status = loadedCheerio("div.sertostat > span").attr("class");
|
||||||
|
novel.genres = loadedCheerio(".sertogenre")
|
||||||
|
.children("a")
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
novel.summary = loadedCheerio(".sersys")
|
||||||
|
.find("br")
|
||||||
|
.replaceWith("\n")
|
||||||
|
.end()
|
||||||
|
.text();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio(".eplister")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find(".epl-num").text() +
|
||||||
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".epl-date")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function parseChapter(chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let ignore = loadedCheerio(".epcontent > p").next().attr("class");
|
||||||
|
loadedCheerio(`p.${ignore}`).remove();
|
||||||
|
let chapterText = loadedCheerio(".epcontent").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function searchNovels(searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}?s=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.maindet").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
novels.push({
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function fetchImage(url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.filters = [
|
||||||
|
{
|
||||||
|
key: "order",
|
||||||
|
label: "ترتيب حسب",
|
||||||
|
values: [
|
||||||
|
{ label: "الإعداد الأولي", value: "" },
|
||||||
|
{ label: "A-Z", value: "title" },
|
||||||
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
|
{ label: "أخر التحديثات", value: "update" },
|
||||||
|
{ label: "أخر ما تم إضافته", value: "latest" },
|
||||||
|
{ label: "الرائجة", value: "popular" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "status",
|
||||||
|
label: "الحالة",
|
||||||
|
values: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
|
{ label: "Completed", value: "completed" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
label: "النوع",
|
||||||
|
values: [
|
||||||
|
{ label: "إنجليزية", value: "english" },
|
||||||
|
{ label: "روايةلايت", value: "light-novel" },
|
||||||
|
{ label: "روايةويب", value: "web-novel" },
|
||||||
|
{ label: "صينية", value: "chinese" },
|
||||||
|
{ label: "عربية", value: "arabic" },
|
||||||
|
{ label: "كورية", value: "korean" },
|
||||||
|
{ label: "يابانية", value: "japanese" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "genres",
|
||||||
|
label: "تصنيف",
|
||||||
|
values: [
|
||||||
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
|
{ label: "Xianxia", value: "xianxia" },
|
||||||
|
{ label: "XUANHUAN", value: "xuanhuan" },
|
||||||
|
{ label: "أكشن", value: "action" },
|
||||||
|
{ label: "إثارة", value: "excitement" },
|
||||||
|
{ label: "إنتقالالىعالمأخر", value: "isekai" },
|
||||||
|
{ label: "إيتشي", value: "etchi" },
|
||||||
|
{ label: "الخيالالعلمي", value: "sci-fi" },
|
||||||
|
{ label: "بوليسي", value: "policy" },
|
||||||
|
{ label: "تاريخي", value: "historical" },
|
||||||
|
{ label: "تحقيقات", value: "%d8%aa%d8%ad%d9%82%d9%8a%d9%82" },
|
||||||
|
{ label: "تقمصشخصيات", value: "rpg" },
|
||||||
|
{ label: "جريمة", value: "crime" },
|
||||||
|
{ label: "جوسى", value: "josei" },
|
||||||
|
{ label: "حريم", value: "harem" },
|
||||||
|
{ label: "حياةمدرسية", value: "school-life" },
|
||||||
|
{ label: "خيالي(فانتازيا)", value: "fantasy" },
|
||||||
|
{ label: "دراما", value: "drama" },
|
||||||
|
{ label: "رعب", value: "horror" },
|
||||||
|
{ label: "رومانسي", value: "romantic" },
|
||||||
|
{ label: "سحر", value: "magic" },
|
||||||
|
{ label: "سينن", value: "senen" },
|
||||||
|
{ label: "شريحةمنالحياة", value: "slice-of-life" },
|
||||||
|
{ label: "شوجو", value: "shojo" },
|
||||||
|
{ label: "شونين", value: "shonen" },
|
||||||
|
{ label: "طبي", value: "medical" },
|
||||||
|
{ label: "ظواهرخارقةللطبيعة", value: "supernatural" },
|
||||||
|
{ label: "غموض", value: "mysteries" },
|
||||||
|
{ label: "فنونالقتال", value: "martial-arts" },
|
||||||
|
{ label: "قوىخارقة", value: "superpower" },
|
||||||
|
{ label: "كوميدي", value: "comedy" },
|
||||||
|
{ label: "مأساوي", value: "tragedy" },
|
||||||
|
{ label: "مابعدالكارثة", value: "after-the-disaster" },
|
||||||
|
{ label: "مغامرة", value: "adventure" },
|
||||||
|
{ label: "ميكا", value: "mechanical" },
|
||||||
|
{ label: "ناضج", value: "mature" },
|
||||||
|
{ label: "نفسي", value: "psychological" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "boxnovel";
|
||||||
|
exports.name = "BoxNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/boxnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://boxnovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "clicknovel";
|
||||||
|
exports.name = "ClickNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/clicknovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://clicknovel.net/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "cratenovel";
|
||||||
|
exports.name = "CrateNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/cratenovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://cratenovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "daonovel";
|
||||||
|
exports.name = "DaoNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/daonovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://daonovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novels-list" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novels" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "fanTLS";
|
||||||
|
exports.name = "Fans Translations [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/fanstranslations.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://fanstranslations.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "1stkissnovel";
|
||||||
|
exports.name = "FirstKissNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/firstkissnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://1stkissnovel.org/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "freenovel.me";
|
||||||
|
exports.name = "FreeNovelMe [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/freenovelme.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://freenovel.me/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "guavaread";
|
||||||
|
exports.name = "Guavaread [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/guavaread.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://guavaread.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "lnheaven";
|
||||||
|
exports.name = "LightNovelHeaven [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/lightnovelheaven.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://lightnovelheaven.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "series" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "series" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
// import dayjs from 'dayjs';
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
// import { Filter, FilterInputs } from "@libs/filterInputs";
|
||||||
|
// import { NovelStatus } from '@libs/novelStatus';
|
||||||
|
// import { defaultCover } from "@libs/defaultCover";
|
||||||
|
exports.id = "Ltnovel.com";
|
||||||
|
exports.name = "Ltnovel.com";
|
||||||
|
exports.icon = "multisrc/readwn/icon/ltnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.ltnovel.com/";
|
||||||
|
// export const filters: Filter[] = [];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { filters, showLatestNovels }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const pageNo = page - 1;
|
||||||
|
const url = baseUrl + 'list/all/all-onclick-' + pageNo + '.html';
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('li.novel-item').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('h4').text();
|
||||||
|
const novelUrl = baseUrl + loadedCheerio(this).find('a').attr('href');
|
||||||
|
const coverUri = loadedCheerio(this)
|
||||||
|
.find('.novel-cover > img')
|
||||||
|
.attr('data-src');
|
||||||
|
const novelCover = baseUrl + coverUri;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio('h1.novel-title').text();
|
||||||
|
const coverUri = loadedCheerio('figure.cover > img').attr('data-src');
|
||||||
|
novel.cover = baseUrl + coverUri;
|
||||||
|
novel.summary = loadedCheerio('.summary')
|
||||||
|
.text()
|
||||||
|
.replace('Summary', '')
|
||||||
|
.trim();
|
||||||
|
novel.genres = '';
|
||||||
|
loadedCheerio('div.categories > ul > li').each(function () {
|
||||||
|
novel.genres += loadedCheerio(this).text().trim() + ',';
|
||||||
|
});
|
||||||
|
loadedCheerio('div.header-stats > span').each(function () {
|
||||||
|
if (loadedCheerio(this).find('small').text() === 'Status') {
|
||||||
|
novel.status = loadedCheerio(this).find('strong').text();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.genres = novel.genres.slice(0, -1);
|
||||||
|
novel.author = loadedCheerio('span[itemprop=author]').text();
|
||||||
|
let novelChapters = [];
|
||||||
|
const novelId = novelUrl.replace('.html', '').replace(baseUrl, '');
|
||||||
|
const latestChapterNo = parseInt(loadedCheerio('.header-stats')
|
||||||
|
.find('span > strong')
|
||||||
|
.first()
|
||||||
|
.text()
|
||||||
|
.trim());
|
||||||
|
let lastChapterNo = 1;
|
||||||
|
loadedCheerio('.chapter-list li').each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find('a .chapter-title')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = baseUrl + ((_a = loadedCheerio(this).find('a').attr('href')) === null || _a === void 0 ? void 0 : _a.trim());
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find('a .chapter-update')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
lastChapterNo = parseInt(loadedCheerio(this).find('a .chapter-no').text().trim());
|
||||||
|
const chapter = { name: chapterName, releaseTime: releaseDate, url: chapterUrl };
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
});
|
||||||
|
// Itterate once more before loop to finish off
|
||||||
|
lastChapterNo++;
|
||||||
|
for (let i = lastChapterNo; i <= latestChapterNo; i++) {
|
||||||
|
const chapterName = 'Chapter ' + i;
|
||||||
|
const chapterUrl = baseUrl + novelId + '_' + i + '.html';
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapter = { name: chapterName, releaseTime: releaseDate, url: chapterUrl };
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
}
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.chapter-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const searchUrl = baseUrl + 'e/search/index.php';
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(searchUrl, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
Referer: baseUrl + 'search.html',
|
||||||
|
Origin: baseUrl,
|
||||||
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36',
|
||||||
|
},
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({
|
||||||
|
show: 'title',
|
||||||
|
tempid: 1,
|
||||||
|
tbname: 'news',
|
||||||
|
keyboard: searchTerm,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('li.novel-item').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('h4').text();
|
||||||
|
const novelUrl = baseUrl + loadedCheerio(this).find('a').attr('href');
|
||||||
|
const coverUri = baseUrl + loadedCheerio(this).find('img').attr('data-src');
|
||||||
|
const novelCover = baseUrl + coverUri;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "lunarletters";
|
||||||
|
exports.name = "LunarLetters [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/lunarletters.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.lunarletters.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "series" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "series" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "mtlnovel.club";
|
||||||
|
exports.name = "MTLNovel.Club [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/mtlnovel.club.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://mtlnovel.club/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "mtl-novel";
|
||||||
|
exports.name = "MTL-Novel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/mtl-novel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://mtl-novel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "mostnovel";
|
||||||
|
exports.name = "MostNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/mostnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://mostnovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "manga" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "manga" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "mysticalmerries";
|
||||||
|
exports.name = "MysticalSeries [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/mysticalseries.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://mysticalmerries.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "series" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "series" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "neosekaiTLS";
|
||||||
|
exports.name = "NeoSekai Translations [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/neosekaitranslations.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.neosekaitranslations.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "nocturneTLS";
|
||||||
|
exports.name = "Nocturne Translations [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/nocturnetranslations.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://nocturnetls.net/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novels" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novels" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "noobchanTL";
|
||||||
|
exports.name = "Noobchan Translation [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/noobchantranslation.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://noobchan.xyz/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "NF.me";
|
||||||
|
exports.name = "NovelFull.me";
|
||||||
|
exports.site = "https://novelfull.me/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/novelfullme/icon.png";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}popular?page=${page}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".book-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this).find(".title").text();
|
||||||
|
const novelCover = "https:" + loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this).find(".title a").attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url,
|
||||||
|
name: "",
|
||||||
|
cover: "",
|
||||||
|
author: "",
|
||||||
|
status: "",
|
||||||
|
genres: "",
|
||||||
|
summary: "",
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".name h1").text().trim();
|
||||||
|
novel.cover =
|
||||||
|
"https:" + loadedCheerio(".img-cover img").attr("data-src");
|
||||||
|
novel.summary = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.mt-1 > div.section.box.mt-1.summary > div.section-body > p.content")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
novel.author = "Unknown";
|
||||||
|
novel.status = (_a = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.book-info > div.detail > div.meta.box.mt-1.p-10 > p:nth-child(1) > a > span")
|
||||||
|
.text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||||
|
novel.genres = (_b = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.book-info > div.detail > div.meta.box.mt-1.p-10 > p:nth-child(2)")
|
||||||
|
.text()) === null || _b === void 0 ? void 0 : _b.replace("Genres :", "").replace(/[\s\n]+/g, " ").trim();
|
||||||
|
let chapters = [];
|
||||||
|
const chaptersUrl = novelUrl.replace(baseUrl, "https://novelfull.me/api/novels/") +
|
||||||
|
"/chapters?source=detail";
|
||||||
|
const chaptersRequest = yield (0, fetch_1.fetchApi)(chaptersUrl);
|
||||||
|
const chaptersHtml = yield chaptersRequest.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chaptersHtml);
|
||||||
|
loadedCheerio("li").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find(".chapter-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".chapter-update")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio("#listen-chapter").remove();
|
||||||
|
loadedCheerio("#google_translate_element").remove();
|
||||||
|
const chapterText = loadedCheerio(".chapter__content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}search?status=all&sort=views&q=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".book-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this).find(".title").text();
|
||||||
|
const novelCover = "https:" + loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this).find(".title a").attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "novelmultiverse";
|
||||||
|
exports.name = "NovelMultiverse [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/novelmultiverse.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.novelmultiverse.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.parseChapter = exports.popularNovels = exports.parseNovelAndChapters = exports.searchNovels = exports.version = exports.icon = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "NO.net";
|
||||||
|
exports.name = "novelsOnline";
|
||||||
|
exports.site = "https://novelsonline.net";
|
||||||
|
exports.icon = "src/coverNotAvailable.jpg";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)("https://novelsonline.net/sResults.php", {
|
||||||
|
headers: {
|
||||||
|
Accept: "*/*",
|
||||||
|
"Accept-Language": "pl,en-US;q=0.7,en;q=0.3",
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
body: "q=" + encodeURIComponent(searchTerm),
|
||||||
|
}, pluginId).then((res) => res.text());
|
||||||
|
let $ = (0, cheerio_1.load)(result);
|
||||||
|
const headers = $("li");
|
||||||
|
return headers
|
||||||
|
.map((i, h) => {
|
||||||
|
const novelName = $(h).text();
|
||||||
|
const novelUrl = $(h).find("a").attr("href");
|
||||||
|
const novelCover = $(h).find("img").attr("src");
|
||||||
|
if (!novelUrl) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get()
|
||||||
|
.filter((sr) => sr !== null);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl).then((res) => res.text());
|
||||||
|
let $ = (0, cheerio_1.load)(result);
|
||||||
|
novel.name = $("h1").text();
|
||||||
|
novel.cover = $(".novel-cover").find("a > img").attr("src");
|
||||||
|
novel.author = $("div.novel-details > div:nth-child(5) > div.novel-detail-body")
|
||||||
|
.find("li")
|
||||||
|
.map((_, el) => $(el).text())
|
||||||
|
.get()
|
||||||
|
.join(", ");
|
||||||
|
novel.genres = $("div.novel-details > div:nth-child(2) > div.novel-detail-body")
|
||||||
|
.find("li")
|
||||||
|
.map((_, el) => $(el).text())
|
||||||
|
.get()
|
||||||
|
.join(",");
|
||||||
|
novel.summary = $("div.novel-right > div > div:nth-child(1) > div.novel-detail-body").text();
|
||||||
|
novel.chapters = $("ul.chapter-chs > li > a")
|
||||||
|
.map((_, el) => {
|
||||||
|
const chapterUrl = $(el).attr("href");
|
||||||
|
const chapterName = $(el).text();
|
||||||
|
return {
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: "",
|
||||||
|
url: chapterUrl,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return []; /** TO DO */
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl).then((res) => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(result);
|
||||||
|
const chapterText = loadedCheerio("#contentall").html() || "";
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "novelr18";
|
||||||
|
exports.name = "NovelR18 [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/novelr18.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://novelr18.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "manga" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "novelTL";
|
||||||
|
exports.name = "NovelTranslate [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/noveltranslate.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://noveltranslate.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "all-novels" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "manga" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
// import dayjs from 'dayjs';
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
// import { Filter, FilterInputs } from "@libs/filterInputs";
|
||||||
|
// import { NovelStatus } from '@libs/novelStatus';
|
||||||
|
// import { defaultCover } from "@libs/defaultCover";
|
||||||
|
exports.id = "Novelmt.com";
|
||||||
|
exports.name = "Novelmt.com";
|
||||||
|
exports.icon = "multisrc/readwn/icon/novelmt.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.novelmt.com/";
|
||||||
|
// export const filters: Filter[] = [];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { filters, showLatestNovels }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const pageNo = page - 1;
|
||||||
|
const url = baseUrl + 'list/all/all-onclick-' + pageNo + '.html';
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('li.novel-item').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('h4').text();
|
||||||
|
const novelUrl = baseUrl + loadedCheerio(this).find('a').attr('href');
|
||||||
|
const coverUri = loadedCheerio(this)
|
||||||
|
.find('.novel-cover > img')
|
||||||
|
.attr('data-src');
|
||||||
|
const novelCover = baseUrl + coverUri;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio('h1.novel-title').text();
|
||||||
|
const coverUri = loadedCheerio('figure.cover > img').attr('data-src');
|
||||||
|
novel.cover = baseUrl + coverUri;
|
||||||
|
novel.summary = loadedCheerio('.summary')
|
||||||
|
.text()
|
||||||
|
.replace('Summary', '')
|
||||||
|
.trim();
|
||||||
|
novel.genres = '';
|
||||||
|
loadedCheerio('div.categories > ul > li').each(function () {
|
||||||
|
novel.genres += loadedCheerio(this).text().trim() + ',';
|
||||||
|
});
|
||||||
|
loadedCheerio('div.header-stats > span').each(function () {
|
||||||
|
if (loadedCheerio(this).find('small').text() === 'Status') {
|
||||||
|
novel.status = loadedCheerio(this).find('strong').text();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.genres = novel.genres.slice(0, -1);
|
||||||
|
novel.author = loadedCheerio('span[itemprop=author]').text();
|
||||||
|
let novelChapters = [];
|
||||||
|
const novelId = novelUrl.replace('.html', '').replace(baseUrl, '');
|
||||||
|
const latestChapterNo = parseInt(loadedCheerio('.header-stats')
|
||||||
|
.find('span > strong')
|
||||||
|
.first()
|
||||||
|
.text()
|
||||||
|
.trim());
|
||||||
|
let lastChapterNo = 1;
|
||||||
|
loadedCheerio('.chapter-list li').each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find('a .chapter-title')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = baseUrl + ((_a = loadedCheerio(this).find('a').attr('href')) === null || _a === void 0 ? void 0 : _a.trim());
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find('a .chapter-update')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
lastChapterNo = parseInt(loadedCheerio(this).find('a .chapter-no').text().trim());
|
||||||
|
const chapter = { name: chapterName, releaseTime: releaseDate, url: chapterUrl };
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
});
|
||||||
|
// Itterate once more before loop to finish off
|
||||||
|
lastChapterNo++;
|
||||||
|
for (let i = lastChapterNo; i <= latestChapterNo; i++) {
|
||||||
|
const chapterName = 'Chapter ' + i;
|
||||||
|
const chapterUrl = baseUrl + novelId + '_' + i + '.html';
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapter = { name: chapterName, releaseTime: releaseDate, url: chapterUrl };
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
}
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.chapter-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const searchUrl = baseUrl + 'e/search/index.php';
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(searchUrl, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
Referer: baseUrl + 'search.html',
|
||||||
|
Origin: baseUrl,
|
||||||
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36',
|
||||||
|
},
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({
|
||||||
|
show: 'title',
|
||||||
|
tempid: 1,
|
||||||
|
tbname: 'news',
|
||||||
|
keyboard: searchTerm,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('li.novel-item').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('h4').text();
|
||||||
|
const novelUrl = baseUrl + loadedCheerio(this).find('a').attr('href');
|
||||||
|
const coverUri = baseUrl + loadedCheerio(this).find('img').attr('data-src');
|
||||||
|
const novelCover = baseUrl + coverUri;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "novelroom";
|
||||||
|
exports.name = "Novelroom.net [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/novelroom.net.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://novelroom.net/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "manga" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "manga" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "novelstic";
|
||||||
|
exports.name = "Novelstic [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/novelstic.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://novelstic.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "onlymtl";
|
||||||
|
exports.name = "OnlyMTL [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/onlymtl.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.onlymtl.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "readwebnovels";
|
||||||
|
exports.name = "ReadWebNovels [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/readwebnovels.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://readwebnovels.net/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
// import dayjs from 'dayjs';
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
// import { Filter, FilterInputs } from "@libs/filterInputs";
|
||||||
|
// import { NovelStatus } from '@libs/novelStatus';
|
||||||
|
// import { defaultCover } from "@libs/defaultCover";
|
||||||
|
exports.id = "Readwn.com";
|
||||||
|
exports.name = "Readwn.com";
|
||||||
|
exports.icon = "multisrc/readwn/icon/readwn.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.readwn.com/";
|
||||||
|
// export const filters: Filter[] = [];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { filters, showLatestNovels }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const pageNo = page - 1;
|
||||||
|
const url = baseUrl + 'list/all/all-onclick-' + pageNo + '.html';
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('li.novel-item').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('h4').text();
|
||||||
|
const novelUrl = baseUrl + loadedCheerio(this).find('a').attr('href');
|
||||||
|
const coverUri = loadedCheerio(this)
|
||||||
|
.find('.novel-cover > img')
|
||||||
|
.attr('data-src');
|
||||||
|
const novelCover = baseUrl + coverUri;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio('h1.novel-title').text();
|
||||||
|
const coverUri = loadedCheerio('figure.cover > img').attr('data-src');
|
||||||
|
novel.cover = baseUrl + coverUri;
|
||||||
|
novel.summary = loadedCheerio('.summary')
|
||||||
|
.text()
|
||||||
|
.replace('Summary', '')
|
||||||
|
.trim();
|
||||||
|
novel.genres = '';
|
||||||
|
loadedCheerio('div.categories > ul > li').each(function () {
|
||||||
|
novel.genres += loadedCheerio(this).text().trim() + ',';
|
||||||
|
});
|
||||||
|
loadedCheerio('div.header-stats > span').each(function () {
|
||||||
|
if (loadedCheerio(this).find('small').text() === 'Status') {
|
||||||
|
novel.status = loadedCheerio(this).find('strong').text();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.genres = novel.genres.slice(0, -1);
|
||||||
|
novel.author = loadedCheerio('span[itemprop=author]').text();
|
||||||
|
let novelChapters = [];
|
||||||
|
const novelId = novelUrl.replace('.html', '').replace(baseUrl, '');
|
||||||
|
const latestChapterNo = parseInt(loadedCheerio('.header-stats')
|
||||||
|
.find('span > strong')
|
||||||
|
.first()
|
||||||
|
.text()
|
||||||
|
.trim());
|
||||||
|
let lastChapterNo = 1;
|
||||||
|
loadedCheerio('.chapter-list li').each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find('a .chapter-title')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = baseUrl + ((_a = loadedCheerio(this).find('a').attr('href')) === null || _a === void 0 ? void 0 : _a.trim());
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find('a .chapter-update')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
lastChapterNo = parseInt(loadedCheerio(this).find('a .chapter-no').text().trim());
|
||||||
|
const chapter = { name: chapterName, releaseTime: releaseDate, url: chapterUrl };
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
});
|
||||||
|
// Itterate once more before loop to finish off
|
||||||
|
lastChapterNo++;
|
||||||
|
for (let i = lastChapterNo; i <= latestChapterNo; i++) {
|
||||||
|
const chapterName = 'Chapter ' + i;
|
||||||
|
const chapterUrl = baseUrl + novelId + '_' + i + '.html';
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapter = { name: chapterName, releaseTime: releaseDate, url: chapterUrl };
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
}
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.chapter-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const searchUrl = baseUrl + 'e/search/index.php';
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(searchUrl, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
Referer: baseUrl + 'search.html',
|
||||||
|
Origin: baseUrl,
|
||||||
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36',
|
||||||
|
},
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({
|
||||||
|
show: 'title',
|
||||||
|
tempid: 1,
|
||||||
|
tbname: 'news',
|
||||||
|
keyboard: searchTerm,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('li.novel-item').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('h4').text();
|
||||||
|
const novelUrl = baseUrl + loadedCheerio(this).find('a').attr('href');
|
||||||
|
const coverUri = baseUrl + loadedCheerio(this).find('img').attr('data-src');
|
||||||
|
const novelCover = baseUrl + coverUri;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "sleeptTLS";
|
||||||
|
exports.name = "SleepyTranslations [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/sleepytranslations.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://sleepytranslations.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "series" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "series" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "sonicmtl";
|
||||||
|
exports.name = "SonicMTL [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/sonicmtl.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.sonicmtl.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "sugarbbscan";
|
||||||
|
exports.name = "Sugar Babies [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/sugarbabies.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://sugarbbscan.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "series" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "series" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "sweetEscapeTL";
|
||||||
|
exports.name = "Sweet Escape Translations [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/sweetescapetranslations.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://sweetescapetranslations.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "manga" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "manga" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "webnovelover";
|
||||||
|
exports.name = "WebNovelLover [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/webnovellover.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://www.webnovelover.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "wuxiaworld.site";
|
||||||
|
exports.name = "WuxiaWorld.Site [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/wuxiaworld.site.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://wuxiaworld.site/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "zetroTL";
|
||||||
|
exports.name = "Zetro Translation [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/zetrotranslation.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://zetrotranslation.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "zinnovel";
|
||||||
|
exports.name = "ZinnNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/zinnnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://zinnovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "manga" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "manga" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "ANF.com";
|
||||||
|
exports.name = "AllNovelFull";
|
||||||
|
exports.site = "https://allnovelfull.com";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/allnovelfull/icon.png";
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${exports.site}/most-popular?page=${page}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {});
|
||||||
|
if (!result.ok) {
|
||||||
|
console.error("Cloudflare error");
|
||||||
|
// console.error(await result.text());
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio(".col-truyen-main .list-truyen .row").each(function () {
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.text();
|
||||||
|
const novelCover = exports.site + loadedCheerio(this).find("img.cover").attr("src");
|
||||||
|
const novelUrl = exports.site + loadedCheerio(this).find("h3.truyen-title > a").attr("href");
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
if (!result.ok) {
|
||||||
|
console.error("Cloudflare error");
|
||||||
|
// console.error(await result.text());
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return { url, chapters: [] };
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("div.book > img").attr("alt");
|
||||||
|
novel.cover = exports.site + loadedCheerio("div.book > img").attr("src");
|
||||||
|
novel.summary = loadedCheerio("div.desc-text").text().trim();
|
||||||
|
novel.author = loadedCheerio("div.info > div > h3")
|
||||||
|
.filter(function () {
|
||||||
|
return loadedCheerio(this).text().trim() === "Author:";
|
||||||
|
})
|
||||||
|
.siblings()
|
||||||
|
.text();
|
||||||
|
novel.genres = loadedCheerio("div.info > div")
|
||||||
|
.filter(function () {
|
||||||
|
return (loadedCheerio(this).find("h3").text().trim() === "Genre:");
|
||||||
|
})
|
||||||
|
.text()
|
||||||
|
.replace("Genre:", "");
|
||||||
|
novel.status = loadedCheerio("div.info > div > h3")
|
||||||
|
.filter(function () {
|
||||||
|
return loadedCheerio(this).text().trim() === "Status:";
|
||||||
|
})
|
||||||
|
.next()
|
||||||
|
.text();
|
||||||
|
const novelId = loadedCheerio("#rating").attr("data-novel-id");
|
||||||
|
function getChapters(id) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const chapterListUrl = exports.site + "/ajax/chapter-option?novelId=" + id;
|
||||||
|
const data = yield (0, fetch_1.fetchApi)(chapterListUrl);
|
||||||
|
if (!data.ok) {
|
||||||
|
console.error("Cloudflare error");
|
||||||
|
// console.error(await result.text());
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
const chapters = yield data.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chapters);
|
||||||
|
const novelChapters = [];
|
||||||
|
loadedCheerio("select > option").each(function () {
|
||||||
|
var _a;
|
||||||
|
let chapterName = loadedCheerio(this).text();
|
||||||
|
let releaseDate = null;
|
||||||
|
let chapterUrl = (_a = loadedCheerio(this)
|
||||||
|
.attr("value")) === null || _a === void 0 ? void 0 : _a.replace(`/${novelUrl}`, "");
|
||||||
|
if (chapterUrl) {
|
||||||
|
novelChapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novelChapters;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (novelId) {
|
||||||
|
novel.chapters = yield getChapters(novelId);
|
||||||
|
}
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = exports.site + chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
if (!result.ok) {
|
||||||
|
console.error("Cloudflare error");
|
||||||
|
// console.error(await result.text());
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return "Cloudflare protected site!";
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio("#chapter-content").html() || "";
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${exports.site}/search?keyword=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
if (!result.ok) {
|
||||||
|
console.error(yield result.text());
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("div.col-truyen-main > div.list-truyen > .row").each(function () {
|
||||||
|
const novelUrl = exports.site +
|
||||||
|
loadedCheerio(this).find("h3.truyen-title > a").attr("href");
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.text();
|
||||||
|
const novelCover = exports.site + loadedCheerio(this).find("img").attr("src");
|
||||||
|
if (novelUrl) {
|
||||||
|
novels.push({
|
||||||
|
url: novelUrl,
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url, init) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, init);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.protected = false;
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
exports.id = "BLN.com";
|
||||||
|
exports.name = "BestLightNovel";
|
||||||
|
exports.site = "https://bestlightnovel.com/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/bestlightnovel/icon.png";
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = exports.site + "novel_list?type=topview&category=all&state=all&page=1" + page;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
if (!result.ok) {
|
||||||
|
console.error(yield result.text());
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".update_item.list_category").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h3 > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
|
if (!novelUrl) {
|
||||||
|
// TODO: Handle error
|
||||||
|
console.error("No novel url!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b, _c;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
if (!result.ok) {
|
||||||
|
console.error(yield result.text());
|
||||||
|
// TODO: Cloudflare protection
|
||||||
|
return { url, chapters: [] };
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url,
|
||||||
|
name: "",
|
||||||
|
cover: "",
|
||||||
|
author: "",
|
||||||
|
status: novelStatus_1.NovelStatus.Unknown,
|
||||||
|
genres: "",
|
||||||
|
summary: "",
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".truyen_info_right h1").text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio(".info_image img").attr("src") || defaultCover_1.defaultCover;
|
||||||
|
novel.summary = (_a = loadedCheerio("#noidungm").text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||||
|
novel.author = (_b = loadedCheerio("#main_body > div.cotgiua > div.truyen_info_wrapper > div.truyen_info > div.entry-header > div.truyen_if_wrap > ul > li:nth-child(2) > a")
|
||||||
|
.text()) === null || _b === void 0 ? void 0 : _b.trim();
|
||||||
|
let status = (_c = loadedCheerio("#main_body > div.cotgiua > div.truyen_info_wrapper > div.truyen_info > div.entry-header > div.truyen_if_wrap > ul > li:nth-child(4) > a")
|
||||||
|
.text()) === null || _c === void 0 ? void 0 : _c.trim();
|
||||||
|
novel.status =
|
||||||
|
status === "ONGOING"
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: status === "COMPLETED"
|
||||||
|
? novelStatus_1.NovelStatus.Completed
|
||||||
|
: novelStatus_1.NovelStatus.Unknown;
|
||||||
|
let novelChapters = [];
|
||||||
|
loadedCheerio(".chapter-list div.row").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find("span:nth-child(2)")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl) {
|
||||||
|
// TODO: Handle error
|
||||||
|
console.error("No chapter url!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
novelChapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = novelChapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio("#vung_doc").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${exports.site}search_novels/${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".update_item.list_category").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h3 > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
|
if (!novelUrl) {
|
||||||
|
// TODO: Handle error
|
||||||
|
console.error("No novel url!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (...args) => (0, fetch_1.fetchFile)(...args);
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.protected = false;
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "comrademao";
|
||||||
|
exports.name = "Comrade Mao";
|
||||||
|
exports.site = "https://comrademao.com/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/comrademao/icon.png";
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let url = exports.site + "page/" + page + "/?post_type=novel";
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".listupd")
|
||||||
|
.find("div.bs")
|
||||||
|
.each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".tt").text().trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl) {
|
||||||
|
// TODO: Handle error
|
||||||
|
console.error("No novel url!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = { url };
|
||||||
|
novel.name = loadedCheerio(".entry-title").text().trim();
|
||||||
|
novel.cover = loadedCheerio("div.thumbook > div > img").attr("src");
|
||||||
|
novel.summary = loadedCheerio("div.infox > div:nth-child(6) > span > p")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
novel.genres = loadedCheerio("div.infox > div:nth-child(4) > span")
|
||||||
|
.text()
|
||||||
|
.replace(/\s/g, "");
|
||||||
|
novel.status = loadedCheerio("div.infox > div:nth-child(3) > span")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
novel.author = loadedCheerio("div.infox > div:nth-child(2) > span")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
let novelChapters = [];
|
||||||
|
loadedCheerio("#chapterlist")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const releaseDate = (0, dayjs_1.default)(loadedCheerio(this).find(".chapterdate").text()).format("LL");
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find(".chapternum")
|
||||||
|
.text();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl) {
|
||||||
|
// TODO: Handle error
|
||||||
|
console.error("No chapter url!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
novelChapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
url: chapterUrl,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = novelChapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
if (!result.ok) {
|
||||||
|
const err = yield result.text();
|
||||||
|
console.error(err);
|
||||||
|
// TODO: Cloudflare protection or other error
|
||||||
|
return "Error!" + err;
|
||||||
|
}
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterText = loadedCheerio("#chaptercontent").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = exports.site + "?s=" + searchTerm + "&post_type=novel";
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".listupd")
|
||||||
|
.find("div.bs")
|
||||||
|
.each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".tt").text().trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl) {
|
||||||
|
// TODO: Handle error
|
||||||
|
console.error("No novel url!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (...args) => (0, fetch_1.fetchFile)(...args);
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.protected = false;
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "DDL.com";
|
||||||
|
exports.name = "Divine Dao Library";
|
||||||
|
exports.site = "https://www.divinedaolibrary.com/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/`en/divinedaolibrary/icon.png";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let url = baseUrl + "novels";
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("#main")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("a").text();
|
||||||
|
const novelCover = defaultCover_1.defaultCover;
|
||||||
|
const novelUrl = loadedCheerio(this).find(" a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = { url };
|
||||||
|
novel.name = loadedCheerio("h1.entry-title").text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio(".entry-content").find("img").attr("data-ezsrc") ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
novel.summary = loadedCheerio("#main > article > div > p:nth-child(6)")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
novel.author = loadedCheerio("#main > article > div > h3:nth-child(2)")
|
||||||
|
.text()
|
||||||
|
.replace(/Author:/g, "")
|
||||||
|
.trim();
|
||||||
|
let novelChapters = [];
|
||||||
|
loadedCheerio("#main")
|
||||||
|
.find("li > span > a")
|
||||||
|
.each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).text().trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = loadedCheerio(this).attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
novelChapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterName = loadedCheerio(".entry-title").text().trim();
|
||||||
|
let chapterText = loadedCheerio(".entry-content").html();
|
||||||
|
if (!chapterText) {
|
||||||
|
chapterText = loadedCheerio(".page-header").html();
|
||||||
|
}
|
||||||
|
chapterText = `<p><h1>${chapterName}</h1></p>` + chapterText;
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let url = baseUrl + "novels";
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("#main")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("a").text();
|
||||||
|
const novelCover = defaultCover_1.defaultCover;
|
||||||
|
const novelUrl = loadedCheerio(this).find(" a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
novels = novels.filter((novel) => novel.name.toLowerCase().includes(searchTerm.toLowerCase()));
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url, init) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, init);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const showToast_1 = require("@libs/showToast");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "earlynovel";
|
||||||
|
exports.name = "Early Novel";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "multisrc/madara/icons/latestnovel.png";
|
||||||
|
exports.site = "https://earlynovel.net/";
|
||||||
|
module.exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}most-popular?page=${page}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".col-truyen-main > .list-truyen > .row").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.attr("title");
|
||||||
|
const novelCover = loadedCheerio(this).find(".lazyimg").attr("data-desk-image") ||
|
||||||
|
loadedCheerio(this).find("img.cover").attr("src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.attr("href")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
if (!novelUrl || !novelName)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover || defaultCover_1.defaultCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
(0, showToast_1.showToast)("Early Novel may take 20-30 seconds");
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const name = loadedCheerio(".book > img").attr("alt");
|
||||||
|
const cover = loadedCheerio(".book > img").attr("src") || defaultCover_1.defaultCover;
|
||||||
|
const summary = loadedCheerio(".desc-text").text().trim();
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
name,
|
||||||
|
summary,
|
||||||
|
cover,
|
||||||
|
};
|
||||||
|
loadedCheerio(".info > div > h3").each(function () {
|
||||||
|
let detailName = loadedCheerio(this).text();
|
||||||
|
let detail = loadedCheerio(this)
|
||||||
|
.siblings()
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
switch (detailName) {
|
||||||
|
case "Author:":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case "Status:":
|
||||||
|
novel.status = detail;
|
||||||
|
break;
|
||||||
|
case "Genre:":
|
||||||
|
novel.genres = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//! Doesn't work since there are multiple pages and can't find source API
|
||||||
|
//# Since cannot find sourceAPI i try similar function to lightnovelpub
|
||||||
|
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||||
|
const lastPageStr = (_a = loadedCheerio('a:contains("Last ")')
|
||||||
|
.attr("title")) === null || _a === void 0 ? void 0 : _a.match(/(\d+)/g);
|
||||||
|
const lastPage = Number((lastPageStr === null || lastPageStr === void 0 ? void 0 : lastPageStr[1]) || "0");
|
||||||
|
function getChapters() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let chapter = [];
|
||||||
|
for (let i = 1; i <= lastPage; i++) {
|
||||||
|
const chaptersUrl = `${novelUrl}?page=${i}`;
|
||||||
|
const chaptersHtml = yield (0, fetch_1.fetchApi)(chaptersUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chaptersHtml);
|
||||||
|
loadedCheerio("ul.list-chapter > li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find(".chapter-text")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterHref = (_a = loadedCheerio(this)
|
||||||
|
.find("a")
|
||||||
|
.attr("href")) === null || _a === void 0 ? void 0 : _a.slice(1);
|
||||||
|
if (!chapterHref)
|
||||||
|
return;
|
||||||
|
const chapterUrl = baseUrl + chapterHref;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
yield delay(1000);
|
||||||
|
}
|
||||||
|
return chapter;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
novel.chapters = yield getChapters();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio("#chapter-c").html() || "";
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}search?keyword=${searchTerm}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("div.col-truyen-main > div.list-truyen > .row").each(function () {
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
loadedCheerio(this).find("h3.truyen-title > a").attr("href");
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.text();
|
||||||
|
const novelCover = baseUrl + loadedCheerio(this).find("img").attr("src");
|
||||||
|
if (novelUrl) {
|
||||||
|
novels.push({
|
||||||
|
url: novelUrl,
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function fetchImage(url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "fastnovel";
|
||||||
|
exports.name = "Fast Novel";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/fastnovel/icon.png";
|
||||||
|
exports.site = "https://fastnovel.org/";
|
||||||
|
exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}sort/p/?page=${page}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".col-novel-main .list-novel .row").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h3.novel-title > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img.cover").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this)
|
||||||
|
.find("h3.novel-title > a")
|
||||||
|
.attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("div.book > img").attr("alt");
|
||||||
|
novel.cover = loadedCheerio("div.book > img").attr("src");
|
||||||
|
novel.summary = loadedCheerio("div.desc-text").text().trim();
|
||||||
|
loadedCheerio("ul.info > li > h3").each(function () {
|
||||||
|
let detailName = loadedCheerio(this).text();
|
||||||
|
let detail = loadedCheerio(this)
|
||||||
|
.siblings()
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
switch (detailName) {
|
||||||
|
case "Author:":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case "Status:":
|
||||||
|
novel.status = detail;
|
||||||
|
break;
|
||||||
|
case "Genre:":
|
||||||
|
novel.genres = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const novelId = loadedCheerio("#rating").attr("data-novel-id");
|
||||||
|
function getChapters(id) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const chapterListUrl = baseUrl + "ajax/chapter-archive?novelId=" + id;
|
||||||
|
const data = yield (0, fetch_1.fetchApi)(chapterListUrl);
|
||||||
|
const chapterdata = yield data.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chapterdata);
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio("ul.list-chapter > li").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").attr("title");
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterName || !chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return chapter;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (novelId) {
|
||||||
|
novel.chapters = yield getChapters(novelId);
|
||||||
|
}
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('#chr-content > div,h6,p[style="display: none;"]').remove();
|
||||||
|
let chapterText = loadedCheerio("#chr-content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}search/?keyword=${searchTerm}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("div.col-novel-main > div.list-novel > .row").each(function () {
|
||||||
|
const novelUrl = loadedCheerio(this)
|
||||||
|
.find("h3.novel-title > a")
|
||||||
|
.attr("href");
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.novel-title > a")
|
||||||
|
.text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
if (novelUrl) {
|
||||||
|
novels.push({
|
||||||
|
url: novelUrl,
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "foxaholic";
|
||||||
|
exports.name = "Foxaholic";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/foxaholic/icon.png";
|
||||||
|
exports.site = "https://www.foxaholic.com/";
|
||||||
|
module.exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const link = `${baseUrl}novel/page/${page}/?m_orderby=rating`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(link, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio(".page-item-detail").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".h5 > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = loadedCheerio(this).find(".h5 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".post-title > h1").text().trim();
|
||||||
|
novel.cover = loadedCheerio(".summary_image > a > img").attr("data-src");
|
||||||
|
loadedCheerio(".post-content_item").each(function () {
|
||||||
|
const detailName = loadedCheerio(this)
|
||||||
|
.find(".summary-heading > h5")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const detail = loadedCheerio(this).find(".summary-content").html();
|
||||||
|
if (!detail)
|
||||||
|
return;
|
||||||
|
switch (detailName) {
|
||||||
|
case "Genre":
|
||||||
|
novel.genres = loadedCheerio(detail)
|
||||||
|
.children("a")
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
break;
|
||||||
|
case "Author":
|
||||||
|
novel.author = loadedCheerio(detail)
|
||||||
|
.children("a")
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(", ");
|
||||||
|
break;
|
||||||
|
case "Novel":
|
||||||
|
novel.status = detail === null || detail === void 0 ? void 0 : detail.trim().replace(/G/g, "g");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio(".description-summary > div.summary__content > div").remove();
|
||||||
|
novel.summary = loadedCheerio(".description-summary > div.summary__content")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio(".wp-manga-chapter").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find("a")
|
||||||
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "")
|
||||||
|
.trim();
|
||||||
|
const releaseDate = loadedCheerio(this).find("span").text().trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio("img").removeAttr("srcset");
|
||||||
|
let chapterText = loadedCheerio(".reading-content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}?s=${searchTerm}&post_type=wp-manga`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio(".c-tabs-item__content").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".h4 > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = loadedCheerio(this).find(".h4 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
novels.push({
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const showToast_1 = require("@libs/showToast");
|
||||||
|
const isAbsoluteUrl_1 = require("@libs/isAbsoluteUrl");
|
||||||
|
exports.id = "freenovelupdates";
|
||||||
|
exports.name = "Free Novel Updates (Broken)";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/freenovelupdates/icon.png";
|
||||||
|
exports.site = "https://www.freenovelupdates.com";
|
||||||
|
exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}genres/light-novel-1002`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".books-item").each(function () {
|
||||||
|
let novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (novelUrl && !(0, isAbsoluteUrl_1.isUrlAbsolute)(novelUrl)) {
|
||||||
|
novelUrl = baseUrl + novelUrl;
|
||||||
|
}
|
||||||
|
if (novelUrl) {
|
||||||
|
const novelName = loadedCheerio(this).find(".title").text().trim();
|
||||||
|
let novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
if (novelCover && !(0, isAbsoluteUrl_1.isUrlAbsolute)(novelCover)) {
|
||||||
|
novelCover = baseUrl + novelCover;
|
||||||
|
}
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("h1").text();
|
||||||
|
let novelCover = loadedCheerio(".img > img").attr("src");
|
||||||
|
novel.cover = novelCover
|
||||||
|
? (0, isAbsoluteUrl_1.isUrlAbsolute)(novelCover)
|
||||||
|
? novelCover
|
||||||
|
: baseUrl + novelCover
|
||||||
|
: undefined;
|
||||||
|
novel.summary = loadedCheerio(".description-content").text().trim();
|
||||||
|
novel.author = loadedCheerio(".author").text().trim();
|
||||||
|
novel.genres = loadedCheerio(".category").text().trim();
|
||||||
|
novel.status = loadedCheerio(".status").text().trim();
|
||||||
|
loadedCheerio(".chapter").each(function () {
|
||||||
|
var _a;
|
||||||
|
let chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (chapterUrl && !(0, isAbsoluteUrl_1.isUrlAbsolute)(chapterUrl)) {
|
||||||
|
chapterUrl = baseUrl + chapterUrl;
|
||||||
|
}
|
||||||
|
if (chapterUrl) {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapter = {
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
};
|
||||||
|
(_a = novel.chapters) === null || _a === void 0 ? void 0 : _a.push(chapter);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio(".content").html() || "";
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
(0, showToast_1.showToast)("Search is not available in this source");
|
||||||
|
return [];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "FWN.com";
|
||||||
|
exports.name = "Web NOVEL";
|
||||||
|
exports.site = "https://freewebnovel.com/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/freewebnovel/icon.png";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let url = baseUrl + "completed-novel/" + page;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".li-row").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".tit").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
let novelUrl = "https://freewebnovel.com" +
|
||||||
|
loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url,
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("h1.tit").text();
|
||||||
|
novel.cover = loadedCheerio(".pic > img").attr("src");
|
||||||
|
novel.genres = loadedCheerio("[title=Genre]")
|
||||||
|
.next()
|
||||||
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "");
|
||||||
|
novel.author = loadedCheerio("[title=Author]")
|
||||||
|
.next()
|
||||||
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "");
|
||||||
|
novel.status = loadedCheerio("[title=Status]")
|
||||||
|
.next()
|
||||||
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "");
|
||||||
|
let novelSummary = loadedCheerio(".inner").text().trim();
|
||||||
|
novel.summary = novelSummary;
|
||||||
|
let novelChapters = [];
|
||||||
|
let latestChapter;
|
||||||
|
loadedCheerio("h3.tit").each(function (res) {
|
||||||
|
var _a;
|
||||||
|
if (loadedCheerio(this).find("a").text() === novel.name) {
|
||||||
|
latestChapter = (_a = loadedCheerio(this)
|
||||||
|
.next()
|
||||||
|
.find("span.s3")
|
||||||
|
.text()
|
||||||
|
.match(/(\d+)/)) === null || _a === void 0 ? void 0 : _a[0];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let prefixUrl = novelUrl.replace(".html", "/");
|
||||||
|
for (let i = 1; i <= parseInt(latestChapter || "0", 10); i++) {
|
||||||
|
const chapterName = "Chapter " + i;
|
||||||
|
const releaseDate = null;
|
||||||
|
let chapterUrl = "chapter-" + i;
|
||||||
|
chapterUrl = `${prefixUrl}${chapterUrl}.html`;
|
||||||
|
const chapter = {
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
};
|
||||||
|
novelChapters.push(chapter);
|
||||||
|
}
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterText = loadedCheerio("div.txt").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "search/";
|
||||||
|
const formData = {
|
||||||
|
searchkey: searchTerm,
|
||||||
|
};
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(formData),
|
||||||
|
});
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".li-row > .li > .con").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".tit").text();
|
||||||
|
const novelCover = loadedCheerio(this)
|
||||||
|
.find(".pic > a > img")
|
||||||
|
.attr("data-cfsrc");
|
||||||
|
let novelUrl = "https://freewebnovel.com" +
|
||||||
|
loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "lightnovelpub";
|
||||||
|
exports.name = "LightNovelPub";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/lightnovelpub/icon.png";
|
||||||
|
exports.site = "https://www.lightnovelpub.com/";
|
||||||
|
exports.protected = true;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
};
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}browse/all/popular/all/${page}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio(".novel-item.ads").remove();
|
||||||
|
loadedCheerio(".novel-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find(".novel-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this)
|
||||||
|
.find(".novel-title > a")
|
||||||
|
.attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("h1.novel-title").text().trim();
|
||||||
|
novel.cover = loadedCheerio("figure.cover > img").attr("data-src");
|
||||||
|
novel.genres = "";
|
||||||
|
loadedCheerio(".categories > ul > li > a").each(function () {
|
||||||
|
novel.genres += loadedCheerio(this).text() + ",";
|
||||||
|
});
|
||||||
|
novel.genres = novel.genres.slice(0, -1);
|
||||||
|
loadedCheerio("div.header-stats > span").each(function () {
|
||||||
|
if (loadedCheerio(this).find("small").text() === "Status") {
|
||||||
|
novel.status = loadedCheerio(this).find("strong").text();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.author = loadedCheerio(".author > a > span").text();
|
||||||
|
novel.summary = loadedCheerio(".summary > .content").text().trim();
|
||||||
|
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||||
|
let lastPage = 1;
|
||||||
|
lastPage = parseInt((_a = loadedCheerio("#novel > header > div.header-body.container > div.novel-info > div.header-stats > span:nth-child(1) > strong")
|
||||||
|
.text()) === null || _a === void 0 ? void 0 : _a.trim());
|
||||||
|
lastPage = Math.ceil(lastPage / 100);
|
||||||
|
function getChapters() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let chapter = [];
|
||||||
|
for (let i = 1; i <= lastPage; i++) {
|
||||||
|
const chaptersUrl = `${novelUrl}/chapters/page-${i}`;
|
||||||
|
const chaptersHtml = yield (0, fetch_1.fetchApi)(chaptersUrl, { headers: headers }, pluginId).then((r) => r.text());
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chaptersHtml);
|
||||||
|
loadedCheerio(".chapter-list li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find(".chapter-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".chapter-update")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this)
|
||||||
|
.find("a")
|
||||||
|
.attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
yield delay(1000);
|
||||||
|
}
|
||||||
|
return chapter;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
novel.chapters = yield getChapters();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterText = loadedCheerio("#chapter-container").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}lnsearchlive`;
|
||||||
|
const link = `${baseUrl}search`;
|
||||||
|
const response = yield (0, fetch_1.fetchApi)(link, {}, pluginId).then((r) => r.text());
|
||||||
|
const token = (0, cheerio_1.load)(response);
|
||||||
|
let verifytoken = token("#novelSearchForm > input").attr("value");
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append("inputContent", searchTerm);
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { LNRequestVerifyToken: verifytoken },
|
||||||
|
body: formData,
|
||||||
|
}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
let results = JSON.parse(loadedCheerio("body").text());
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(results.resultview);
|
||||||
|
loadedCheerio(".novel-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h4.novel-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = baseUrl + ((_a = loadedCheerio(this).find("a").attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
novels.push({
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "mtlreader";
|
||||||
|
exports.name = "MTL Reader";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/mtlreader/icon.png";
|
||||||
|
exports.site = "https://mtlreader.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}novels?page=${page}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".col-md-4.col-sm-4").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h5").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h5 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".agent-title").text().trim();
|
||||||
|
novel.cover = loadedCheerio(".agent-p-img > img").attr("src");
|
||||||
|
novel.summary = loadedCheerio("#editdescription").text().trim();
|
||||||
|
novel.author = loadedCheerio("i.fa-user")
|
||||||
|
.parent()
|
||||||
|
.text()
|
||||||
|
.replace("Author: ", "")
|
||||||
|
.trim();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio("tr.spaceUnder").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio(".container ins,script,p.mtlreader").remove();
|
||||||
|
const chapterText = loadedCheerio(".container").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}search?input=${searchTerm}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".col-md-4.col-sm-4").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h5").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h5 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "nitroscans";
|
||||||
|
exports.name = "Nitroscans";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/nitroscans/icon.png";
|
||||||
|
exports.site = "https://nitroscans.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "wp-admin/admin-ajax.php";
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append("action", "madara_load_more");
|
||||||
|
formData.append("page", `${Number(page - 1)}`);
|
||||||
|
formData.append("template", "madara-core/content/content-archive");
|
||||||
|
formData.append("vars[orderby]", "meta_value_num");
|
||||||
|
formData.append("vars[post_type]", "wp-manga");
|
||||||
|
formData.append("vars[meta_key]", "_wp_manga_views");
|
||||||
|
formData.append("vars[wp-manga-genre]", "novels");
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
}).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".page-item-detail").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h3 > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
loadedCheerio(".manga-title-badges.custom.novel").remove();
|
||||||
|
novel.name = loadedCheerio(".post-title > h1").text().trim();
|
||||||
|
novel.cover = loadedCheerio(".summary_image")
|
||||||
|
.find("img")
|
||||||
|
.attr("data-src");
|
||||||
|
novel.summary = (_a = loadedCheerio(".summary__content").text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||||
|
novel.genres = loadedCheerio(".genres-content")
|
||||||
|
.children("a")
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
loadedCheerio(".post-content_item").each(function () {
|
||||||
|
const detailName = loadedCheerio(this)
|
||||||
|
.find(".summary-heading")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const detail = loadedCheerio(this)
|
||||||
|
.find(".summary-content")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case "Author(s)":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case "Status":
|
||||||
|
novel.status = detail.replace(/G/g, "g");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let chapter = [];
|
||||||
|
let chapterlisturl = novelUrl + "ajax/chapters/";
|
||||||
|
const data = yield (0, fetch_1.fetchApi)(chapterlisturl, { method: "POST" });
|
||||||
|
const text = yield data.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(text);
|
||||||
|
loadedCheerio(".wp-manga-chapter").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
|
const releaseDate = loadedCheerio(this).find("span").text().trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio(".text-left").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "wp-admin/admin-ajax.php";
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append("action", "madara_load_more");
|
||||||
|
formData.append("page", `${Number(1 - 1)}`);
|
||||||
|
formData.append("template", "madara-core/content/content-search");
|
||||||
|
formData.append("vars[s]", searchTerm);
|
||||||
|
formData.append("vars[post_type]", "wp-manga");
|
||||||
|
formData.append("vars[wp-manga-genre]", "novels");
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
}).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".c-tabs-item__content").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h3 > a").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.filters = exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
exports.id = "NobleMTL";
|
||||||
|
exports.name = "NobleMTL";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/noblemtl/icon.png";
|
||||||
|
exports.site = "https://www.noblemtl.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let link = `${exports.site}series/?page=${page}`;
|
||||||
|
if ((_a = filters === null || filters === void 0 ? void 0 : filters.genres) === null || _a === void 0 ? void 0 : _a.length) {
|
||||||
|
if (Array.isArray(filters.genres))
|
||||||
|
link += filters.genres.map((i) => `&genre[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
if ((_b = filters === null || filters === void 0 ? void 0 : filters.type) === null || _b === void 0 ? void 0 : _b.length) {
|
||||||
|
if (Array.isArray(filters.type))
|
||||||
|
link += filters.type.map((i) => `&lang[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters === null || filters === void 0 ? void 0 : filters.status : "");
|
||||||
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters === null || filters === void 0 ? void 0 : filters.order : "popular");
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(link).then((result) => result.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function parseNovelAndChapters(novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".entry-title").text();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
|
loadedCheerio("div.spe > span").each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find("b").text().trim();
|
||||||
|
const detail = loadedCheerio(this)
|
||||||
|
.find("b")
|
||||||
|
.remove()
|
||||||
|
.end()
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case "المؤلف:":
|
||||||
|
case "Yazar:":
|
||||||
|
case "Autor:":
|
||||||
|
case "Author:":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case "Status:":
|
||||||
|
case "Seviye:":
|
||||||
|
novel.status = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.genres = loadedCheerio(".genxed")
|
||||||
|
.text()
|
||||||
|
.trim()
|
||||||
|
.replace(/\s/g, ",");
|
||||||
|
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
||||||
|
novel.summary = loadedCheerio('div[itemprop="description"]')
|
||||||
|
.find("br")
|
||||||
|
.replaceWith("\n")
|
||||||
|
.end()
|
||||||
|
.text();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio(".eplister")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find(".epl-num").text() +
|
||||||
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".epl-date")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterText = loadedCheerio("div.epcontent").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${exports.site}?s=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
novels.push({
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: exports.site,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.filters = [
|
||||||
|
{
|
||||||
|
key: "order",
|
||||||
|
label: "Sort By",
|
||||||
|
values: [
|
||||||
|
{ label: "Default", value: "" },
|
||||||
|
{ label: "A-Z", value: "title" },
|
||||||
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
|
{ label: "Latest Update", value: "update" },
|
||||||
|
{ label: "Latest Added", value: "latest" },
|
||||||
|
{ label: "Popular", value: "popular" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "status",
|
||||||
|
label: "Status",
|
||||||
|
values: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
|
{ label: "Completed", value: "completed" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
label: "Type",
|
||||||
|
values: [
|
||||||
|
{ label: "Chinese novel", value: "chinese-novel" },
|
||||||
|
{ label: "habyeol", value: "habyeol" },
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
|
{ label: "삼심", value: "%ec%82%bc%ec%8b%ac" },
|
||||||
|
{ label: "호곡", value: "%ed%98%b8%ea%b3%a1" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "genres",
|
||||||
|
label: "Genres",
|
||||||
|
values: [
|
||||||
|
{ label: "A.I", value: "a.i" },
|
||||||
|
{ label: "Academy", value: "academy" },
|
||||||
|
{ label: "Action", value: "action" },
|
||||||
|
{ label: "Adult", value: "adult" },
|
||||||
|
{ label: "Adventure", value: "adventure" },
|
||||||
|
{ label: "Alternative History", value: "alternative-history" },
|
||||||
|
{ label: "Another World", value: "another-world" },
|
||||||
|
{ label: "Apocalypse", value: "apocalypse" },
|
||||||
|
{ label: "Bromance", value: "bromance" },
|
||||||
|
{ label: "Comedy", value: "comedy" },
|
||||||
|
{ label: "Dark fantasy", value: "dark-fantasy" },
|
||||||
|
{ label: "Demons", value: "demons" },
|
||||||
|
{ label: "Drama", value: "drama" },
|
||||||
|
{ label: "Dystopia", value: "dystopia" },
|
||||||
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
|
{ label: "Entertainment", value: "entertainment" },
|
||||||
|
{ label: "Exhaustion", value: "exhaustion" },
|
||||||
|
{ label: "Fanfiction", value: "fanfiction" },
|
||||||
|
{ label: "fantasy", value: "fantasy" },
|
||||||
|
{ label: "finance", value: "finance" },
|
||||||
|
{ label: "Full color", value: "full-color" },
|
||||||
|
{ label: "Game", value: "game" },
|
||||||
|
{ label: "Gender Bender", value: "gender-bender" },
|
||||||
|
{ label: "Genius", value: "genius" },
|
||||||
|
{ label: "Harem", value: "harem" },
|
||||||
|
{ label: "Hero", value: "hero" },
|
||||||
|
{ label: "Historical", value: "historical" },
|
||||||
|
{ label: "Hunter", value: "hunter" },
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
|
{ label: "Light Novel", value: "light-novel" },
|
||||||
|
{
|
||||||
|
label: "List Adventure Manga Genres",
|
||||||
|
value: "list-adventure-manga-genres",
|
||||||
|
},
|
||||||
|
{ label: "Long Strip", value: "long-strip" },
|
||||||
|
{ label: "Love comedy", value: "love-comedy" },
|
||||||
|
{ label: "magic", value: "magic" },
|
||||||
|
{ label: "Manhua", value: "manhua" },
|
||||||
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
|
{ label: "Mature", value: "mature" },
|
||||||
|
{ label: "Medieval", value: "medieval" },
|
||||||
|
{ label: "Misunderstanding", value: "misunderstanding" },
|
||||||
|
{ label: "Modern", value: "modern" },
|
||||||
|
{ label: "modern fantasy", value: "modern-fantasy" },
|
||||||
|
{ label: "music", value: "music" },
|
||||||
|
{ label: "Mystery", value: "mystery" },
|
||||||
|
{ label: "Necromancy", value: "necromancy" },
|
||||||
|
{ label: "No Romance", value: "no-romance" },
|
||||||
|
{ label: "NTL", value: "ntl" },
|
||||||
|
{ label: "o", value: "o" },
|
||||||
|
{ label: "Obsession", value: "obsession" },
|
||||||
|
{ label: "Politics", value: "politics" },
|
||||||
|
{ label: "Possession", value: "possession" },
|
||||||
|
{ label: "Programming", value: "programming" },
|
||||||
|
{ label: "Psychological", value: "psychological" },
|
||||||
|
{ label: "Pure Love", value: "pure-love" },
|
||||||
|
{ label: "Redemption", value: "redemption" },
|
||||||
|
{ label: "Regression", value: "regression" },
|
||||||
|
{ label: "Regret", value: "regret" },
|
||||||
|
{ label: "Reincarnation", value: "reincarnation" },
|
||||||
|
{ label: "Revenge", value: "revenge" },
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
|
{ label: "Romance Fanrasy", value: "romance-fanrasy" },
|
||||||
|
{ label: "Salvation", value: "salvation" },
|
||||||
|
{ label: "School Life", value: "school-life" },
|
||||||
|
{ label: "Sci-fi", value: "sci-fi" },
|
||||||
|
{ label: "Science fiction", value: "science-fiction" },
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
|
{ label: "Shounen", value: "shounen" },
|
||||||
|
{ label: "Slice of Life", value: "slice-of-life" },
|
||||||
|
{ label: "Soft yandere", value: "soft-yandere" },
|
||||||
|
{ label: "Sports", value: "sports" },
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
|
{ label: "Survival", value: "survival" },
|
||||||
|
{ label: "system", value: "system" },
|
||||||
|
{ label: "Time limit", value: "time-limit" },
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
|
{ label: "Transmigration", value: "transmigration" },
|
||||||
|
{ label: "TS", value: "ts" },
|
||||||
|
{ label: "Tsundere", value: "tsundere" },
|
||||||
|
{ label: "Unique", value: "unique" },
|
||||||
|
{ label: "Wholesome", value: "wholesome" },
|
||||||
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
|
{ label: "Xuanhuan", value: "xuanhuan" },
|
||||||
|
{ label: "Yandere", value: "yandere" },
|
||||||
|
{ label: "Yuri", value: "yuri" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
exports.id = "novelforest";
|
||||||
|
exports.name = "Novel Forest (Broken)";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/novelforest/icon.png";
|
||||||
|
exports.site = "https://novelforest.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}popular?page=${page}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".book-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this).find(".title").text();
|
||||||
|
const novelCover = "https:" + loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this).find(".title a").attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".name h1").text().trim();
|
||||||
|
novel.cover = "https:" + loadedCheerio(".img-cover img").attr("data-src");
|
||||||
|
novel.summary = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.mt-1 > div.section.box.mt-1.summary > div.section-body > p.content")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
novel.author = (_a = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.book-info > div.detail > div.meta.box.mt-1.p-10 > p:nth-child(1) > a > span")
|
||||||
|
.text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||||
|
novel.status = (_b = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.book-info > div.detail > div.meta.box.mt-1.p-10 > p:nth-child(2) > a > span")
|
||||||
|
.text()) === null || _b === void 0 ? void 0 : _b.trim();
|
||||||
|
novel.genres = (_c = loadedCheerio("body > div.layout > div.main-container.book-details > div > div.row.no-gutters > div.col-lg-8 > div.book-info > div.detail > div.meta.box.mt-1.p-10 > p:nth-child(3)")
|
||||||
|
.text()) === null || _c === void 0 ? void 0 : _c.replace("Genres :", "").replace(/[\s\n]+/g, " ").trim();
|
||||||
|
let chapter = [];
|
||||||
|
const chaptersUrl = novelUrl.replace(baseUrl, "https://novelforest.com/api/novels/") +
|
||||||
|
"/chapters?source=detail";
|
||||||
|
const chaptersRequest = yield fetch(chaptersUrl);
|
||||||
|
const chaptersHtml = yield chaptersRequest.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chaptersHtml);
|
||||||
|
loadedCheerio("li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find(".chapter-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".chapter-update")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = baseUrl + ((_a = loadedCheerio(this).find("a").attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio("#listen-chapter").remove();
|
||||||
|
loadedCheerio("#google_translate_element").remove();
|
||||||
|
const chapterText = loadedCheerio(".chapter__content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}search?q=${searchTerm}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url, {}, pluginId).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".book-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this).find(".title").text();
|
||||||
|
const novelCover = "https:" + loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this).find(".title a").attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "novelfull";
|
||||||
|
exports.name = "NovelFull";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/novelfull/icon.png";
|
||||||
|
exports.site = "https://novelfull.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}most-popular?page=${page}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".col-truyen-main .list-truyen .row").each(function () {
|
||||||
|
var _a, _b;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.text();
|
||||||
|
const novelCover = baseUrl + ((_a = loadedCheerio(this).find("img").attr("src")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_b = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.attr("href")) === null || _b === void 0 ? void 0 : _b.slice(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("div.book > img").attr("alt");
|
||||||
|
novel.cover = baseUrl + loadedCheerio("div.book > img").attr("src");
|
||||||
|
novel.summary = loadedCheerio("div.desc-text").text().trim();
|
||||||
|
novel.author = loadedCheerio('h3:contains("Author")')
|
||||||
|
.parent()
|
||||||
|
.contents()
|
||||||
|
.text()
|
||||||
|
.replace("Author:", "");
|
||||||
|
novel.genres = loadedCheerio('h3:contains("Genre")')
|
||||||
|
.siblings()
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
novel.status = loadedCheerio('h3:contains("Status")').next().text();
|
||||||
|
const novelId = loadedCheerio("#rating").attr("data-novel-id");
|
||||||
|
function getChapters(id) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const chapterListUrl = baseUrl + "ajax/chapter-option?novelId=" + id;
|
||||||
|
const data = yield (0, fetch_1.fetchApi)(chapterListUrl);
|
||||||
|
const chapterlist = yield data.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chapterlist);
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio("select > option").each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this).text();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = baseUrl + ((_a = loadedCheerio(this).attr("value")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return chapter;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
novel.chapters = yield getChapters(novelId);
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio("#chapter-content div.ads").remove();
|
||||||
|
let chapterText = loadedCheerio("#chapter-content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const searchUrl = `${baseUrl}search?keyword=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(searchUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".col-truyen-main .list-truyen .row").each(function () {
|
||||||
|
var _a, _b;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.text();
|
||||||
|
const novelCover = baseUrl + ((_a = loadedCheerio(this).find("img").attr("src")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_b = loadedCheerio(this)
|
||||||
|
.find("h3.truyen-title > a")
|
||||||
|
.attr("href")) === null || _b === void 0 ? void 0 : _b.slice(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "novelhold";
|
||||||
|
exports.name = "Novel Hold";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/novelhold/icon.png";
|
||||||
|
exports.site = "https://novelhold.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}all-${page}.html`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then((r) => r.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("#article_list_content > li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3")
|
||||||
|
.text()
|
||||||
|
.replace(/\t+/g, "")
|
||||||
|
.replace(/\n/g, " ");
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl + ((_a = loadedCheerio(this).find("a").attr("href")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".booknav2 > h1").text();
|
||||||
|
novel.cover = loadedCheerio('meta[property="og:image"]').attr("content");
|
||||||
|
novel.summary = loadedCheerio(".navtxt").text().trim();
|
||||||
|
novel.author = loadedCheerio('p:contains("Author")')
|
||||||
|
.text()
|
||||||
|
.replace("Author:", "")
|
||||||
|
.trim();
|
||||||
|
novel.status = loadedCheerio('p:contains("Status")')
|
||||||
|
.text()
|
||||||
|
.replace("Status:", "")
|
||||||
|
.replace("Active", "Ongoing")
|
||||||
|
.trim();
|
||||||
|
novel.genres = (_a = loadedCheerio('p:contains("Genre")')
|
||||||
|
.text()) === null || _a === void 0 ? void 0 : _a.replace("Genre:", "").trim();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio("ul.chapterlist > li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = baseUrl + ((_a = loadedCheerio(this).find("a").attr("href")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter;
|
||||||
|
console.log(novel);
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio(".content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}index.php?s=so&module=book&keyword=${searchTerm}`;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then((r) => r.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("#article_list_content > li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find("h3")
|
||||||
|
.text()
|
||||||
|
.replace(/\t+/g, "")
|
||||||
|
.replace(/\n/g, " ");
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl + ((_a = loadedCheerio(this).find("a").attr("href")) === null || _a === void 0 ? void 0 : _a.slice(1));
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "novelpub.com";
|
||||||
|
exports.name = "NovelPub";
|
||||||
|
exports.site = "https://www.novelpub.com/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/novelpub/icon.png";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
|
||||||
|
};
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let url = baseUrl + "browse/all/popular/all/" + page;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, { method: "GET", headers });
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".novel-item.ads").remove();
|
||||||
|
loadedCheerio(".novel-item").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find(".novel-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("data-src");
|
||||||
|
const novelUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this)
|
||||||
|
.find(".novel-title > a")
|
||||||
|
.attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, { method: "GET", headers });
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = { url, genres: "" };
|
||||||
|
novel.name = loadedCheerio("h1.novel-title").text().trim();
|
||||||
|
novel.cover = loadedCheerio("figure.cover > img").attr("data-src");
|
||||||
|
loadedCheerio("div.categories > ul > li").each(function () {
|
||||||
|
novel.genres +=
|
||||||
|
loadedCheerio(this)
|
||||||
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "") + ",";
|
||||||
|
});
|
||||||
|
loadedCheerio("div.header-stats > span").each(function () {
|
||||||
|
if (loadedCheerio(this).find("small").text() === "Status") {
|
||||||
|
novel.status = loadedCheerio(this).find("strong").text();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.genres = (_a = novel.genres) === null || _a === void 0 ? void 0 : _a.slice(0, -1);
|
||||||
|
novel.author = loadedCheerio(".author > a > span").text();
|
||||||
|
novel.summary = loadedCheerio(".summary > .content").text().trim();
|
||||||
|
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||||
|
let lastPage = 1;
|
||||||
|
lastPage = parseInt((_b = loadedCheerio("#novel > header > div.header-body.container > div.novel-info > div.header-stats > span:nth-child(1) > strong")
|
||||||
|
.text()) === null || _b === void 0 ? void 0 : _b.trim());
|
||||||
|
lastPage = Math.ceil(lastPage / 100);
|
||||||
|
const getChapters = () => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let novelChapters = [];
|
||||||
|
for (let i = 1; i <= lastPage; i++) {
|
||||||
|
const chaptersUrl = `${novelUrl}/chapters/page-${i}`;
|
||||||
|
const chaptersRequest = yield (0, fetch_1.fetchApi)(chaptersUrl, {
|
||||||
|
headers,
|
||||||
|
});
|
||||||
|
const chaptersHtml = yield chaptersRequest.text();
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(chaptersHtml);
|
||||||
|
loadedCheerio(".chapter-list li").each(function () {
|
||||||
|
var _a;
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find(".chapter-title")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".chapter-update")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = baseUrl +
|
||||||
|
((_a = loadedCheerio(this)
|
||||||
|
.find("a")
|
||||||
|
.attr("href")) === null || _a === void 0 ? void 0 : _a.substring(1));
|
||||||
|
novelChapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
yield delay(1000);
|
||||||
|
}
|
||||||
|
return novelChapters;
|
||||||
|
});
|
||||||
|
novel.chapters = yield getChapters();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, { method: "GET", headers });
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio("#chapter-container").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
// They have API to search, pls update it, im quite lazy xD
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}lnwsearchlive?inputContent=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, { method: "GET", headers });
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
// let results = JSON.parse(loadedCheerio('body').text());
|
||||||
|
// loadedCheerio = load(results.resultview);
|
||||||
|
// loadedCheerio('.novel-item').each(function () {
|
||||||
|
// const novelName = loadedCheerio(this).find('.novel-title').text().trim();
|
||||||
|
// const novelCover = loadedCheerio(this).find('img').attr('src');
|
||||||
|
// const novelUrl =
|
||||||
|
// baseUrl + loadedCheerio(this).find('a').attr('href').substring(1);
|
||||||
|
// const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
// novels.push(novel);
|
||||||
|
// });
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.filters = exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
exports.id = "PandaMTL";
|
||||||
|
exports.name = "PandaMTL";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/en/wordpress/icon.png";
|
||||||
|
exports.site = "https://www.pandamtl.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let link = `${baseUrl}series/?page=${page}`;
|
||||||
|
if (filters) {
|
||||||
|
if (Array.isArray(filters.genres) && filters.genres.length) {
|
||||||
|
link += filters.genres.map((i) => `&genre[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
if (Array.isArray(filters.type) && filters.type.length) {
|
||||||
|
link += filters.type.map((i) => `&lang[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters === null || filters === void 0 ? void 0 : filters.status : "");
|
||||||
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters === null || filters === void 0 ? void 0 : filters.order : "popular");
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(link, {}, pluginId).then((result) => result.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.maindet").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio("h1.entry-title").text();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
|
loadedCheerio("div.serl:nth-child(3) > span").each(function () {
|
||||||
|
const detailName = loadedCheerio(this).text().trim();
|
||||||
|
const detail = loadedCheerio(this).next().text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case "الكاتب":
|
||||||
|
case "Author":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.status = loadedCheerio("div.sertostat > span").attr("class");
|
||||||
|
novel.genres = loadedCheerio(".sertogenre")
|
||||||
|
.children("a")
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
novel.summary = loadedCheerio(".sersys")
|
||||||
|
.find("br")
|
||||||
|
.replaceWith("\n")
|
||||||
|
.end()
|
||||||
|
.text();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio(".eplister")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find(".epl-num").text() +
|
||||||
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".epl-date")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterText = loadedCheerio(".epcontent").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}?s=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.maindet").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
novels.push({
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.filters = [
|
||||||
|
{
|
||||||
|
key: "order",
|
||||||
|
label: "Sort By",
|
||||||
|
values: [
|
||||||
|
{ label: "Default", value: "" },
|
||||||
|
{ label: "A-Z", value: "title" },
|
||||||
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
|
{ label: "Latest Update", value: "update" },
|
||||||
|
{ label: "Latest Added", value: "latest" },
|
||||||
|
{ label: "Popular", value: "popular" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "status",
|
||||||
|
label: "Status",
|
||||||
|
values: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
|
{ label: "Completed", value: "completed" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
label: "Type",
|
||||||
|
values: [
|
||||||
|
{ label: "Light Novel (KR)", value: "light-novel-kr" },
|
||||||
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "genres",
|
||||||
|
label: "Genres",
|
||||||
|
values: [
|
||||||
|
{ label: "Action", value: "action" },
|
||||||
|
{ label: "Adult", value: "adult" },
|
||||||
|
{ label: "Adventure", value: "adventure" },
|
||||||
|
{ label: "Comedy", value: "comedy" },
|
||||||
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
|
{ label: "Fantasy", value: "fantasy" },
|
||||||
|
{ label: "Harem", value: "harem" },
|
||||||
|
{ label: "Josei", value: "josei" },
|
||||||
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
|
{ label: "Mature", value: "mature" },
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
|
{ label: "School Life", value: "school-life" },
|
||||||
|
{ label: "Sci-fi", value: "sci-fi" },
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
|
{ label: "Slice of Life", value: "slice-of-life" },
|
||||||
|
{ label: "Smut", value: "smut" },
|
||||||
|
{ label: "Sports", value: "sports" },
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "chireads.com";
|
||||||
|
exports.name = "Chireads";
|
||||||
|
exports.site = "https://chireads.com/";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/fr/chireads/icon.png";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}category/translatedtales/page/${page}/`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("#content li").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".news-list-tit h5").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this)
|
||||||
|
.find(".news-list-tit h5 a")
|
||||||
|
.attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url,
|
||||||
|
name: "",
|
||||||
|
cover: "",
|
||||||
|
author: "",
|
||||||
|
status: "",
|
||||||
|
genres: "",
|
||||||
|
summary: "",
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".inform-title").text().trim();
|
||||||
|
novel.cover = loadedCheerio(".inform-product img").attr("src");
|
||||||
|
novel.summary = loadedCheerio(".inform-inform-txt").text().trim();
|
||||||
|
let chapters = [];
|
||||||
|
loadedCheerio(".chapitre-table a").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).text().trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = loadedCheerio(this).attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio("#content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}search?x=0&y=0&name=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("#content li").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".news-list-tit h5").text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this)
|
||||||
|
.find(".news-list-tit h5 a")
|
||||||
|
.attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "meionovel";
|
||||||
|
exports.name = "MeioNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/meionovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://meionovel.id/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "morenovel";
|
||||||
|
exports.name = "MoreNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/morenovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://morenovel.net/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (true) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const parseMadaraDate_1 = require("@libs/parseMadaraDate");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
exports.id = "wbnovel";
|
||||||
|
exports.name = "WBNovel [madara]";
|
||||||
|
exports.icon = "multisrc/madara/icons/wbnovel.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://wbnovel.com/";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = (pageNo, { showLatestNovels }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const sortOrder = showLatestNovels
|
||||||
|
? '?m_orderby=latest'
|
||||||
|
: '/?m_orderby=rating';
|
||||||
|
let url = exports.site + "novel" + '/page/' + pageNo + sortOrder;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
loadedCheerio('.page-item-detail').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this).find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = (novelUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(novelUrl).then(res => res.text());
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.manga-title-badges').remove();
|
||||||
|
novel.name = loadedCheerio('.post-title h1').text().trim();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('data-src') ||
|
||||||
|
loadedCheerio('.summary_image > a > img').attr('src') ||
|
||||||
|
defaultCover_1.defaultCover;
|
||||||
|
loadedCheerio('.post-content_item, .post-content').each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find('h5').text().trim();
|
||||||
|
const detail = loadedCheerio(this).find('.summary-content').text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case 'Genre(s)':
|
||||||
|
case 'التصنيفات':
|
||||||
|
novel.genres = detail.replace(/[\t\n]/g, ',');
|
||||||
|
break;
|
||||||
|
case 'Author(s)':
|
||||||
|
case 'المؤلف':
|
||||||
|
case 'المؤلف (ين)':
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case 'Status':
|
||||||
|
case 'الحالة':
|
||||||
|
novel.status =
|
||||||
|
detail.includes('OnGoing') || detail.includes('مستمرة')
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
loadedCheerio('div.summary__content .code-block,script').remove();
|
||||||
|
novel.summary = loadedCheerio('div.summary__content').text().trim();
|
||||||
|
let html;
|
||||||
|
if (false) {
|
||||||
|
const novelId = loadedCheerio('.rating-post-id').attr('value') ||
|
||||||
|
loadedCheerio('#manga-chapters-holder').attr('data-id') || '';
|
||||||
|
const body = {
|
||||||
|
action: "manga_get_chapters",
|
||||||
|
manga: novelId,
|
||||||
|
};
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'wp-admin/admin-ajax.php', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
})
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html = yield (0, fetch_1.fetchApi)(baseUrl + 'ajax/chapters/', { method: 'POST' })
|
||||||
|
.then(res => res.text());
|
||||||
|
}
|
||||||
|
if (html !== '0') {
|
||||||
|
loadedCheerio = (0, cheerio_1.load)(html);
|
||||||
|
}
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio('.wp-manga-chapter').each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find('a').text().trim();
|
||||||
|
let releaseDate = null;
|
||||||
|
releaseDate = loadedCheerio(this)
|
||||||
|
.find('span.chapter-release-date')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
if (releaseDate) {
|
||||||
|
releaseDate = (0, parseMadaraDate_1.parseMadaraDate)(releaseDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Insert current date
|
||||||
|
*/
|
||||||
|
releaseDate = (0, dayjs_1.default)().format('LL');
|
||||||
|
}
|
||||||
|
let chapterUrl = loadedCheerio(this).find('a').attr('href') || '';
|
||||||
|
chapters.push({ name: chapterName, releaseTime: releaseDate, url: chapterUrl });
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = (chapterUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "/" + "novel" + "/" + chapterUrl;
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(chapterUrl).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio('.text-left').html() ||
|
||||||
|
loadedCheerio('.text-right').html() ||
|
||||||
|
loadedCheerio('.entry-content').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const novels = [];
|
||||||
|
const url = baseUrl + "?s=" + searchTerm + "&post_type=wp-manga";
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(url).then(res => res.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.c-tabs-item__content').each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find('.post-title').text().trim();
|
||||||
|
let image = loadedCheerio(this).find('img');
|
||||||
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
let novelUrl = loadedCheerio(this)
|
||||||
|
.find('.post-title')
|
||||||
|
.find('a')
|
||||||
|
.attr('href') || '';
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.version = exports.icon = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "IDWN.id";
|
||||||
|
exports.name = "IndoWebNovel";
|
||||||
|
exports.site = "https://indowebnovel.id/id/";
|
||||||
|
exports.icon = "src/id/indowebnovel/icon.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}daftar-novel/`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".novellist-blc li").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("a").text();
|
||||||
|
const novelCover = defaultCover_1.defaultCover;
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl || !novelName)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url,
|
||||||
|
name: "",
|
||||||
|
cover: "",
|
||||||
|
author: "",
|
||||||
|
status: "",
|
||||||
|
genres: "",
|
||||||
|
summary: "",
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".series-title").text().trim();
|
||||||
|
novel.cover = loadedCheerio(".series-thumb > img").attr("src");
|
||||||
|
novel.summary = loadedCheerio(".series-synops").text().trim();
|
||||||
|
novel.status = loadedCheerio(".status").text().trim();
|
||||||
|
const genres = [];
|
||||||
|
loadedCheerio(".series-genres").each(function () {
|
||||||
|
genres.push(loadedCheerio(this).find("a").text().trim());
|
||||||
|
});
|
||||||
|
novel.genres = genres.join(",");
|
||||||
|
let chapters = [];
|
||||||
|
loadedCheerio(".series-chapterlist li").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio(".reader").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}daftar-novel/`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".novellist-blc li").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("a").text();
|
||||||
|
const novelCover = defaultCover_1.defaultCover;
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
if (novelName.toLowerCase().includes(searchTerm.toLowerCase())) {
|
||||||
|
novels.push(novel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.version = exports.icon = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
exports.id = "novelringan.com";
|
||||||
|
exports.name = "NovelRingan";
|
||||||
|
exports.site = "https://novelringan.com/";
|
||||||
|
exports.icon = "src/id/novelringan/icon.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const coverUriPrefix = "https://i0.wp.com/novelringan.com/wp-content/uploads/";
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}/top-novel/page/${page}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.post").each(function () {
|
||||||
|
var _a;
|
||||||
|
const novelName = (_a = loadedCheerio(this)
|
||||||
|
.find(".entry-title")
|
||||||
|
.text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||||
|
const novelCover = coverUriPrefix + loadedCheerio(this).find("img").attr("data-sxrx");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h2 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url,
|
||||||
|
name: "",
|
||||||
|
cover: "",
|
||||||
|
genres: "",
|
||||||
|
author: "",
|
||||||
|
status: novelStatus_1.NovelStatus.Unknown,
|
||||||
|
summary: "",
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = (_a = loadedCheerio(".entry-title").text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||||
|
novel.cover =
|
||||||
|
coverUriPrefix +
|
||||||
|
loadedCheerio("img.ts-post-image").attr("data-sxrx");
|
||||||
|
novel.summary = loadedCheerio("body > div.site-container > div > main > article > div > div.maininfo > span > p").text();
|
||||||
|
let genreSelector = loadedCheerio("body > div.site-container > div > main > article > div > div.maininfo > span > ul > li:nth-child(4)").text();
|
||||||
|
novel.genres = genreSelector.includes("Genre")
|
||||||
|
? genreSelector.replace("Genre:", "").trim()
|
||||||
|
: "";
|
||||||
|
let statusSelector = loadedCheerio("body > div.site-container > div > main > article > div > div.maininfo > span > ul > li:nth-child(3)").text();
|
||||||
|
novel.status = statusSelector.includes("Status")
|
||||||
|
? statusSelector.replace("Status:", "").trim()
|
||||||
|
: novelStatus_1.NovelStatus.Unknown;
|
||||||
|
let chapters = [];
|
||||||
|
loadedCheerio(".bxcl > ul > li").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find("a").text();
|
||||||
|
const releaseDate = null;
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
const chapter = {
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
};
|
||||||
|
chapters.push(chapter);
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = chapterUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('.entry-content div[style="display:none"]').remove();
|
||||||
|
const chapterText = loadedCheerio(".entry-content").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = baseUrl + "?s=" + searchTerm;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio("article.post").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".entry-title").text();
|
||||||
|
const novelCover = coverUriPrefix + loadedCheerio(this).find("img").attr("data-sxrx");
|
||||||
|
const novelUrl = loadedCheerio(this).find("h2 > a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.version = exports.icon = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
exports.id = "sakura.id";
|
||||||
|
exports.name = "SakuraNovel";
|
||||||
|
exports.site = "https://sakuranovel.id/";
|
||||||
|
exports.icon = "src/id/sakuranovel/icon.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const sourceName = exports.name;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}advanced-search/page/${page}/?title&author&yearx&status&type&order=rating&country%5B0%5D=china&country%5B1%5D=jepang&country%5B2%5D=unknown`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".flexbox2-item").each(function () {
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find(".flexbox2-title span")
|
||||||
|
.first()
|
||||||
|
.text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this)
|
||||||
|
.find(".flexbox2-content > a")
|
||||||
|
.attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
name: sourceName,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".series-title h2").text().trim();
|
||||||
|
novel.cover = loadedCheerio(".series-thumb img").attr("src");
|
||||||
|
loadedCheerio(".series-infolist > li").each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find("b").text().trim();
|
||||||
|
const detail = loadedCheerio(this).find("b").next().text().trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case "Author":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.status = loadedCheerio(".status").text().trim();
|
||||||
|
novel.genres = loadedCheerio(".series-genres")
|
||||||
|
.children("a")
|
||||||
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
|
.toArray()
|
||||||
|
.join(",");
|
||||||
|
loadedCheerio(".series-synops div").remove();
|
||||||
|
novel.summary = loadedCheerio(".series-synops").text().trim();
|
||||||
|
let chapters = [];
|
||||||
|
loadedCheerio(".series-chapterlist li").each(function () {
|
||||||
|
const chapterName = loadedCheerio(this)
|
||||||
|
.find("a span")
|
||||||
|
.first()
|
||||||
|
.text()
|
||||||
|
.replace(/.*?(Chapter.|[0-9])/g, "$1")
|
||||||
|
.replace(/Bahasa Indonesia/g, "")
|
||||||
|
.replace(/\s+/g, " ")
|
||||||
|
.trim();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find("a span")
|
||||||
|
.first()
|
||||||
|
.next()
|
||||||
|
.text();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const chapterText = loadedCheerio(".readers").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}?s=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio(".flexbox2-item").each(function () {
|
||||||
|
const novelName = loadedCheerio(this)
|
||||||
|
.find(".flexbox2-title span")
|
||||||
|
.first()
|
||||||
|
.text();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this)
|
||||||
|
.find(".flexbox2-content > a")
|
||||||
|
.attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
// const novelStatus = require('@libs/novelStatus');
|
||||||
|
// const isUrlAbsolute = require('@libs/isAbsoluteUrl');
|
||||||
|
// const parseDate = require('@libs/parseDate');
|
||||||
|
const pluginId = "yomou.syosetu";
|
||||||
|
exports.id = pluginId;
|
||||||
|
exports.name = "Syosetu";
|
||||||
|
exports.icon = "src/jp/syosetu/icon.png";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https//yomou.syosetu.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const searchUrl = (pagenum, order) => {
|
||||||
|
return `https://yomou.syosetu.com/search.php?order=${order || "hyoka"}${pagenum !== undefined
|
||||||
|
? `&p=${pagenum <= 1 || pagenum > 100 ? "1" : pagenum}` // check if pagenum is between 1 and 100
|
||||||
|
: "" // if isn't don't set ?p
|
||||||
|
}`;
|
||||||
|
};
|
||||||
|
const popularNovels = function (pageNo) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
function getNovelsFromPage(pagenumber) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// load page
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(searchUrl(pagenumber));
|
||||||
|
const body = yield result.text();
|
||||||
|
// Cheerio it!
|
||||||
|
const cheerioQuery = (0, cheerio_1.load)(body, { decodeEntities: false });
|
||||||
|
let pageNovels = [];
|
||||||
|
// find class=searchkekka_box
|
||||||
|
cheerioQuery(".searchkekka_box").each(function (i, e) {
|
||||||
|
// get div with link and name
|
||||||
|
const novelDIV = cheerioQuery(this).find(".novel_h");
|
||||||
|
// get link element
|
||||||
|
const novelA = novelDIV.children()[0];
|
||||||
|
// add new novel to array
|
||||||
|
pageNovels.push({
|
||||||
|
name: novelDIV.text(),
|
||||||
|
url: novelA.attribs.href,
|
||||||
|
cover: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// return all novels from this page
|
||||||
|
return pageNovels;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const novels = yield getNovelsFromPage(pageNo);
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let chapters = [];
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body, { decodeEntities: false });
|
||||||
|
// create novel object
|
||||||
|
let novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: loadedCheerio(".novel_title").text(),
|
||||||
|
author: loadedCheerio(".novel_writername")
|
||||||
|
.text()
|
||||||
|
.replace("作者:", ""),
|
||||||
|
cover: defaultCover_1.defaultCover,
|
||||||
|
};
|
||||||
|
// Get all the chapters
|
||||||
|
const cqGetChapters = loadedCheerio(".novel_sublist2");
|
||||||
|
if (cqGetChapters.length !== 0) {
|
||||||
|
// has more than 1 chapter
|
||||||
|
novel.summary = loadedCheerio("#novel_ex")
|
||||||
|
.text()
|
||||||
|
.replace(/<\s*br.*?>/g, "\n");
|
||||||
|
cqGetChapters.each(function (i, e) {
|
||||||
|
const chapterA = loadedCheerio(this).find("a");
|
||||||
|
const [chapterName, releaseDate, chapterUrl] = [
|
||||||
|
// set the variables
|
||||||
|
chapterA.text(),
|
||||||
|
loadedCheerio(this)
|
||||||
|
.find("dt") // get title
|
||||||
|
.text() // get text
|
||||||
|
.replace(/(.)/g, "") // remove "(edited)" mark
|
||||||
|
.trim(),
|
||||||
|
"https://ncode.syosetu.com" + chapterA.attr("href"),
|
||||||
|
];
|
||||||
|
chapters.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/**
|
||||||
|
* Because there are oneshots on the site, they have to be treated with special care
|
||||||
|
* that's what pisses me off in Shosetsu app. They have this extension,
|
||||||
|
* but every oneshot is set as "there are no chapters" and all contents are thrown into the description!!
|
||||||
|
*/
|
||||||
|
// get summary for oneshot chapter
|
||||||
|
const nameResult = yield (0, fetch_1.fetchApi)(searchUrl() + `&word=${novel.name}`);
|
||||||
|
const nameBody = yield nameResult.text();
|
||||||
|
const summaryQuery = (0, cheerio_1.load)(nameBody, {
|
||||||
|
decodeEntities: false,
|
||||||
|
});
|
||||||
|
const foundText = summaryQuery(".searchkekka_box")
|
||||||
|
.first()
|
||||||
|
.find(".ex")
|
||||||
|
.text()
|
||||||
|
.replace(/\s{2,}/g, "\n");
|
||||||
|
novel.summary = foundText;
|
||||||
|
// add single chapter
|
||||||
|
chapters.push({
|
||||||
|
name: "Oneshot",
|
||||||
|
releaseTime: loadedCheerio("head")
|
||||||
|
.find("meta[name='WWWC']")
|
||||||
|
.attr("content"),
|
||||||
|
url: novelUrl, // set chapterUrl to oneshot so that chapterScraper knows it's a one-shot,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
novel.chapters = chapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
// create cheerioQuery
|
||||||
|
const cheerioQuery = (0, cheerio_1.load)(body, {
|
||||||
|
decodeEntities: false,
|
||||||
|
});
|
||||||
|
let chapterText = cheerioQuery("#novel_honbun") // get chapter text
|
||||||
|
.html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let novels = [];
|
||||||
|
// returns list of novels from given page
|
||||||
|
function getNovelsFromPage(pagenumber) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// load page
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(searchUrl(pagenumber) + `&word=${searchTerm}`);
|
||||||
|
const body = yield result.text();
|
||||||
|
// Cheerio it!
|
||||||
|
const cheerioQuery = (0, cheerio_1.load)(body, { decodeEntities: false });
|
||||||
|
let pageNovels = [];
|
||||||
|
// find class=searchkekka_box
|
||||||
|
cheerioQuery(".searchkekka_box").each(function (i, e) {
|
||||||
|
// get div with link and name
|
||||||
|
const novelDIV = cheerioQuery(this).find(".novel_h");
|
||||||
|
// get link element
|
||||||
|
const novelA = novelDIV.children()[0];
|
||||||
|
// add new novel to array
|
||||||
|
pageNovels.push({
|
||||||
|
name: novelDIV.text(),
|
||||||
|
url: novelA.attribs.href,
|
||||||
|
cover: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// return all novels from this page
|
||||||
|
return pageNovels;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// counter of loaded pages
|
||||||
|
// let pagesLoaded = 0;
|
||||||
|
// do {
|
||||||
|
// // always load first one
|
||||||
|
// novels.push(...(await getNovelsFromPage(pagesLoaded + 1)));
|
||||||
|
// pagesLoaded++;
|
||||||
|
// } while (pagesLoaded < maxPageLoad && isNext); // check if we should load more
|
||||||
|
novels = yield getNovelsFromPage(1);
|
||||||
|
/** Use
|
||||||
|
* novels.push(...(await getNovelsFromPage(pageNumber)))
|
||||||
|
* if you want to load more
|
||||||
|
*/
|
||||||
|
// respond with novels!
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,301 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.filters = exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.site = exports.icon = exports.version = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
exports.id = "lightnovelbrasil";
|
||||||
|
exports.name = "Light Novel Brasil";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "multisrc/wpmangastream/icons/lightnovelbrasil.png";
|
||||||
|
exports.site = "https://lightnovelbrasil.com/";
|
||||||
|
exports.protected = false;
|
||||||
|
const pluginId = exports.id;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let link = `${baseUrl}series/?page=${page}`;
|
||||||
|
if (filters) {
|
||||||
|
if (Array.isArray(filters.genres) && filters.genres.length) {
|
||||||
|
link += filters.genres.map((i) => `&genre[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
if (Array.isArray(filters.type) && filters.type.length) {
|
||||||
|
link += filters.type.map((i) => `&lang[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters === null || filters === void 0 ? void 0 : filters.status : "");
|
||||||
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters === null || filters === void 0 ? void 0 : filters.order : "popular");
|
||||||
|
const body = yield (0, fetch_1.fetchApi)(link, {}, pluginId).then((result) => result.text());
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novels.push(novel);
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = novelUrl;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
let loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novel = {
|
||||||
|
url,
|
||||||
|
chapters: [],
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio(".entry-title").text();
|
||||||
|
novel.cover =
|
||||||
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
|
loadedCheerio("div.spe > span").each(function () {
|
||||||
|
const detailName = loadedCheerio(this).find("b").text().trim();
|
||||||
|
const detail = loadedCheerio(this)
|
||||||
|
.find("b")
|
||||||
|
.remove()
|
||||||
|
.end()
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
switch (detailName) {
|
||||||
|
case "المؤلف:":
|
||||||
|
case "Yazar:":
|
||||||
|
case "Autor:":
|
||||||
|
case "Author:":
|
||||||
|
novel.author = detail;
|
||||||
|
break;
|
||||||
|
case "Status:":
|
||||||
|
case "Seviye:":
|
||||||
|
novel.status = detail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
novel.genres = loadedCheerio(".genxed")
|
||||||
|
.text()
|
||||||
|
.trim()
|
||||||
|
.replace(/\s/g, ",");
|
||||||
|
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
||||||
|
novel.summary = loadedCheerio('div[itemprop="description"]')
|
||||||
|
.find("br")
|
||||||
|
.replaceWith("\n")
|
||||||
|
.end()
|
||||||
|
.text();
|
||||||
|
let chapter = [];
|
||||||
|
loadedCheerio(".eplister")
|
||||||
|
.find("li")
|
||||||
|
.each(function () {
|
||||||
|
const chapterName = loadedCheerio(this).find(".epl-num").text() +
|
||||||
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
|
const releaseDate = loadedCheerio(this)
|
||||||
|
.find(".epl-date")
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!chapterUrl)
|
||||||
|
return;
|
||||||
|
chapter.push({
|
||||||
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapter.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let chapterText = loadedCheerio("div.epcontent").html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}?s=${searchTerm}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url, {}, pluginId);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
const novels = [];
|
||||||
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
if (!novelUrl)
|
||||||
|
return;
|
||||||
|
novels.push({
|
||||||
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
|
cover: novelCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = function (url) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const headers = {
|
||||||
|
Referer: baseUrl,
|
||||||
|
};
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, { headers: headers });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
|
exports.filters = [
|
||||||
|
{
|
||||||
|
key: "order",
|
||||||
|
label: "Sort By",
|
||||||
|
values: [
|
||||||
|
{ label: "Default", value: "" },
|
||||||
|
{ label: "A-Z", value: "title" },
|
||||||
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
|
{ label: "Latest Update", value: "update" },
|
||||||
|
{ label: "Latest Added", value: "latest" },
|
||||||
|
{ label: "Popular", value: "popular" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "status",
|
||||||
|
label: "Status",
|
||||||
|
values: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
|
{ label: "Completed", value: "completed" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
label: "Type",
|
||||||
|
values: [
|
||||||
|
{ label: "Chinese novel", value: "chinese-novel" },
|
||||||
|
{ label: "habyeol", value: "habyeol" },
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
|
{ label: "삼심", value: "%ec%82%bc%ec%8b%ac" },
|
||||||
|
{ label: "호곡", value: "%ed%98%b8%ea%b3%a1" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "genres",
|
||||||
|
label: "Genres",
|
||||||
|
values: [
|
||||||
|
{ label: "A.I", value: "a.i" },
|
||||||
|
{ label: "Academy", value: "academy" },
|
||||||
|
{ label: "Action", value: "action" },
|
||||||
|
{ label: "Adult", value: "adult" },
|
||||||
|
{ label: "Adventure", value: "adventure" },
|
||||||
|
{ label: "Alternative History", value: "alternative-history" },
|
||||||
|
{ label: "Another World", value: "another-world" },
|
||||||
|
{ label: "Apocalypse", value: "apocalypse" },
|
||||||
|
{ label: "Bromance", value: "bromance" },
|
||||||
|
{ label: "Comedy", value: "comedy" },
|
||||||
|
{ label: "Dark fantasy", value: "dark-fantasy" },
|
||||||
|
{ label: "Demons", value: "demons" },
|
||||||
|
{ label: "Drama", value: "drama" },
|
||||||
|
{ label: "Dystopia", value: "dystopia" },
|
||||||
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
|
{ label: "Entertainment", value: "entertainment" },
|
||||||
|
{ label: "Exhaustion", value: "exhaustion" },
|
||||||
|
{ label: "Fanfiction", value: "fanfiction" },
|
||||||
|
{ label: "fantasy", value: "fantasy" },
|
||||||
|
{ label: "finance", value: "finance" },
|
||||||
|
{ label: "Full color", value: "full-color" },
|
||||||
|
{ label: "Game", value: "game" },
|
||||||
|
{ label: "Gender Bender", value: "gender-bender" },
|
||||||
|
{ label: "Genius", value: "genius" },
|
||||||
|
{ label: "Harem", value: "harem" },
|
||||||
|
{ label: "Hero", value: "hero" },
|
||||||
|
{ label: "Historical", value: "historical" },
|
||||||
|
{ label: "Hunter", value: "hunter" },
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
|
{ label: "Light Novel", value: "light-novel" },
|
||||||
|
{
|
||||||
|
label: "List Adventure Manga Genres",
|
||||||
|
value: "list-adventure-manga-genres",
|
||||||
|
},
|
||||||
|
{ label: "Long Strip", value: "long-strip" },
|
||||||
|
{ label: "Love comedy", value: "love-comedy" },
|
||||||
|
{ label: "magic", value: "magic" },
|
||||||
|
{ label: "Manhua", value: "manhua" },
|
||||||
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
|
{ label: "Mature", value: "mature" },
|
||||||
|
{ label: "Medieval", value: "medieval" },
|
||||||
|
{ label: "Misunderstanding", value: "misunderstanding" },
|
||||||
|
{ label: "Modern", value: "modern" },
|
||||||
|
{ label: "modern fantasy", value: "modern-fantasy" },
|
||||||
|
{ label: "music", value: "music" },
|
||||||
|
{ label: "Mystery", value: "mystery" },
|
||||||
|
{ label: "Necromancy", value: "necromancy" },
|
||||||
|
{ label: "No Romance", value: "no-romance" },
|
||||||
|
{ label: "NTL", value: "ntl" },
|
||||||
|
{ label: "o", value: "o" },
|
||||||
|
{ label: "Obsession", value: "obsession" },
|
||||||
|
{ label: "Politics", value: "politics" },
|
||||||
|
{ label: "Possession", value: "possession" },
|
||||||
|
{ label: "Programming", value: "programming" },
|
||||||
|
{ label: "Psychological", value: "psychological" },
|
||||||
|
{ label: "Pure Love", value: "pure-love" },
|
||||||
|
{ label: "Redemption", value: "redemption" },
|
||||||
|
{ label: "Regression", value: "regression" },
|
||||||
|
{ label: "Regret", value: "regret" },
|
||||||
|
{ label: "Reincarnation", value: "reincarnation" },
|
||||||
|
{ label: "Revenge", value: "revenge" },
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
|
{ label: "Romance Fanrasy", value: "romance-fanrasy" },
|
||||||
|
{ label: "Salvation", value: "salvation" },
|
||||||
|
{ label: "School Life", value: "school-life" },
|
||||||
|
{ label: "Sci-fi", value: "sci-fi" },
|
||||||
|
{ label: "Science fiction", value: "science-fiction" },
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
|
{ label: "Shounen", value: "shounen" },
|
||||||
|
{ label: "Slice of Life", value: "slice-of-life" },
|
||||||
|
{ label: "Soft yandere", value: "soft-yandere" },
|
||||||
|
{ label: "Sports", value: "sports" },
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
|
{ label: "Survival", value: "survival" },
|
||||||
|
{ label: "system", value: "system" },
|
||||||
|
{ label: "Time limit", value: "time-limit" },
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
|
{ label: "Transmigration", value: "transmigration" },
|
||||||
|
{ label: "TS", value: "ts" },
|
||||||
|
{ label: "Tsundere", value: "tsundere" },
|
||||||
|
{ label: "Unique", value: "unique" },
|
||||||
|
{ label: "Wholesome", value: "wholesome" },
|
||||||
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
|
{ label: "Xuanhuan", value: "xuanhuan" },
|
||||||
|
{ label: "Yandere", value: "yandere" },
|
||||||
|
{ label: "Yuri", value: "yuri" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
];
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "axel.znovel";
|
||||||
|
exports.name = "Аксел";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://axel.znovel.space";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Богини", "value": 316 }, { "label": "Везучий главный герой", "value": 411 }, { "label": "Виртуальная реальность", "value": 744 }, { "label": "Высокомерный герой", "value": 56 }, { "label": "Герой-извращенец", "value": 521 }, { "label": "Главная героиня — женщина", "value": 277 }, { "label": "Главный герой — мужчина", "value": 419 }, { "label": "Дворяне", "value": 487 }, { "label": "Девочки-волшебницы", "value": 415 }, { "label": "Демоны", "value": 193 }, { "label": "Дружба", "value": 293 }, { "label": "Есть аниме-адаптация", "value": 10 }, { "label": "Есть видеоигра", "value": 13 }, { "label": "Есть манга-адаптация", "value": 14 }, { "label": "Игра на выживание", "value": 696 }, { "label": "Из грязи в князи", "value": 542 }, { "label": "Королевская особа", "value": 596 }, { "label": "Ленивый главный герой", "value": 389 }, { "label": "Маги", "value": 757 }, { "label": "Магические технологии", "value": 417 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "bel.novel";
|
||||||
|
exports.name = "Белманга";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://bel.novel.tl";
|
||||||
|
exports.filters = [];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,210 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.filters = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.icon = exports.version = exports.site = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
exports.id = "jaomix.ru";
|
||||||
|
exports.name = "Jaomix";
|
||||||
|
exports.site = "https://jaomix.ru";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.icon = "src/ru/jaomix/icon.png";
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const popularNovels = function (page, { showLatestNovels, filters }) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let url = baseUrl + "/?searchrn&sortby=";
|
||||||
|
url += showLatestNovels ? "upd" : (filters === null || filters === void 0 ? void 0 : filters.sort) || "count";
|
||||||
|
if (filters) {
|
||||||
|
if (Array.isArray(filters.type) && filters.type.length) {
|
||||||
|
url += filters.type.map((i) => `&lang[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
if (Array.isArray(filters.genres) && filters.genres.length) {
|
||||||
|
url += filters.genres.map((i) => `&genre[]=${i}`).join("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url += `&page=${page}`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
let body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio('div[class="block-home"] > div[class="one"]').each(function () {
|
||||||
|
var _a;
|
||||||
|
const name = loadedCheerio(this)
|
||||||
|
.find('div[class="img-home"] > a')
|
||||||
|
.attr("title");
|
||||||
|
const cover = (_a = loadedCheerio(this)
|
||||||
|
.find('div[class="img-home"] > a > img')
|
||||||
|
.attr("src")) === null || _a === void 0 ? void 0 : _a.replace("-150x150", "");
|
||||||
|
const url = loadedCheerio(this)
|
||||||
|
.find('div[class="img-home"] > a')
|
||||||
|
.attr("href");
|
||||||
|
if (!name || !url)
|
||||||
|
return;
|
||||||
|
novels.push({ name, cover, url });
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(novelUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
};
|
||||||
|
novel.name = loadedCheerio('div[class="desc-book"] > h1').text().trim();
|
||||||
|
novel.cover = loadedCheerio('div[class="img-book"] > img').attr("src");
|
||||||
|
novel.summary = loadedCheerio('div[id="desc-tab"]').text().trim();
|
||||||
|
loadedCheerio("#info-book > p").each(function () {
|
||||||
|
let text = loadedCheerio(this).text().replace(/,/g, "").split(" ");
|
||||||
|
if (text[0] === "Автор:") {
|
||||||
|
novel.author = text.splice(1).join(" ");
|
||||||
|
}
|
||||||
|
else if (text[0] === "Жанры:") {
|
||||||
|
novel.genres = text.splice(1).join(",");
|
||||||
|
}
|
||||||
|
else if (text[0] === "Статус:") {
|
||||||
|
novel.status = text.includes("продолжается")
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const chapters = [];
|
||||||
|
loadedCheerio(".download-chapter div.title").each(function () {
|
||||||
|
chapters.push({
|
||||||
|
name: loadedCheerio(this).find("a").attr("title"),
|
||||||
|
releaseTime: loadedCheerio(this).find("time").text(),
|
||||||
|
url: loadedCheerio(this).find("a").attr("href"),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(chapterUrl);
|
||||||
|
const body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
loadedCheerio('div[class="adblock-service"]').remove();
|
||||||
|
const chapterText = loadedCheerio('div[class="entry-content"]').html();
|
||||||
|
return chapterText;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = function (searchTerm) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const url = `${baseUrl}/?searchrn=${searchTerm}&but=Поиск по названию&sortby=upd`;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)(url);
|
||||||
|
let body = yield result.text();
|
||||||
|
const loadedCheerio = (0, cheerio_1.load)(body);
|
||||||
|
let novels = [];
|
||||||
|
loadedCheerio('div[class="block-home"] > div[class="one"]').each(function () {
|
||||||
|
var _a;
|
||||||
|
const name = loadedCheerio(this)
|
||||||
|
.find('div[class="img-home"] > a')
|
||||||
|
.attr("title");
|
||||||
|
const cover = (_a = loadedCheerio(this)
|
||||||
|
.find('div[class="img-home"] > a > img')
|
||||||
|
.attr("src")) === null || _a === void 0 ? void 0 : _a.replace("-150x150", "");
|
||||||
|
const url = loadedCheerio(this)
|
||||||
|
.find('div[class="img-home"] > a')
|
||||||
|
.attr("href");
|
||||||
|
if (!name || !url)
|
||||||
|
return;
|
||||||
|
novels.push({ name, cover, url });
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
exports.filters = [
|
||||||
|
{
|
||||||
|
key: "sort",
|
||||||
|
label: "Сортировка",
|
||||||
|
values: [
|
||||||
|
{ label: "Имя", value: "alphabet" },
|
||||||
|
{ label: "Просмотры", value: "count" },
|
||||||
|
{ label: "Дате добавления", value: "new" },
|
||||||
|
{ label: "Дате обновления", value: "upd" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Picker,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
label: "Тип",
|
||||||
|
values: [
|
||||||
|
{ label: "Английский", value: "Английский" },
|
||||||
|
{ label: "Китайский", value: "Китайский" },
|
||||||
|
{ label: "Корейский", value: "Корейский" },
|
||||||
|
{ label: "Японский", value: "Японский" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "genres",
|
||||||
|
label: "Жанры",
|
||||||
|
values: [
|
||||||
|
{ label: "Боевые Искусства", value: "Боевые Искусства" },
|
||||||
|
{ label: "Виртуальный Мир", value: "Виртуальный Мир" },
|
||||||
|
{ label: "Гарем", value: "Гарем" },
|
||||||
|
{ label: "Детектив", value: "Детектив" },
|
||||||
|
{ label: "Драма", value: "Драма" },
|
||||||
|
{ label: "Игра", value: "Игра" },
|
||||||
|
{ label: "Истории из жизни", value: "Истории из жизни" },
|
||||||
|
{ label: "Исторический", value: "Исторический" },
|
||||||
|
{ label: "История", value: "История" },
|
||||||
|
{ label: "Исэкай", value: "Исэкай" },
|
||||||
|
{ label: "Комедия", value: "Комедия" },
|
||||||
|
{ label: "Меха", value: "Меха" },
|
||||||
|
{ label: "Мистика", value: "Мистика" },
|
||||||
|
{ label: "Научная Фантастика", value: "Научная Фантастика" },
|
||||||
|
{ label: "Повседневность", value: "Повседневность" },
|
||||||
|
{ label: "Постапокалипсис", value: "Постапокалипсис" },
|
||||||
|
{ label: "Приключения", value: "Приключения" },
|
||||||
|
{ label: "Психология", value: "Психология" },
|
||||||
|
{ label: "Романтика", value: "Романтика" },
|
||||||
|
{ label: "Сверхъестественное", value: "Сверхъестественное" },
|
||||||
|
{ label: "Сёнэн", value: "Сёнэн" },
|
||||||
|
{ label: "Сёнэн-ай", value: "Сёнэн-ай" },
|
||||||
|
{ label: "Спорт", value: "Спорт" },
|
||||||
|
{ label: "Сэйнэн", value: "Сэйнэн" },
|
||||||
|
{ label: "Сюаньхуа", value: "Сюаньхуа" },
|
||||||
|
{ label: "Трагедия", value: "Трагедия" },
|
||||||
|
{ label: "Триллер", value: "Триллер" },
|
||||||
|
{ label: "Фантастика", value: "Фантастика" },
|
||||||
|
{ label: "Фэнтези", value: "Фэнтези" },
|
||||||
|
{ label: "Хоррор", value: "Хоррор" },
|
||||||
|
{ label: "Школьная жизнь", value: "Школьная жизнь" },
|
||||||
|
{ label: "Шоунен", value: "Шоунен" },
|
||||||
|
{ label: "Экшн", value: "Экшн" },
|
||||||
|
{ label: "Этти", value: "Этти" },
|
||||||
|
{ label: "Юри", value: "Юри" },
|
||||||
|
{ label: "Adult", value: "Adult" },
|
||||||
|
{ label: "Ecchi", value: "Ecchi" },
|
||||||
|
{ label: "Josei", value: "Josei" },
|
||||||
|
{ label: "Lolicon", value: "Lolicon" },
|
||||||
|
{ label: "Mature", value: "Mature" },
|
||||||
|
{ label: "Shoujo", value: "Shoujo" },
|
||||||
|
{ label: "Wuxia", value: "Wuxia" },
|
||||||
|
{ label: "Xianxia", value: "Xianxia" },
|
||||||
|
{ label: "Xuanhuan", value: "Xuanhuan" },
|
||||||
|
{ label: "Yaoi", value: "Yaoi" },
|
||||||
|
],
|
||||||
|
inputType: filterInputs_1.FilterInputs.Checkbox,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
exports.fetchImage = fetch_1.fetchFile;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "japit.novel";
|
||||||
|
exports.name = "Japit Comics";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://japit.novel.tl";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Академия", "value": 5 }, { "label": "Андроиды", "value": 37 }, { "label": "Беззаботный герой", "value": 115 }, { "label": "Боги", "value": 318 }, { "label": "Богини", "value": 316 }, { "label": "Вампиры", "value": 742 }, { "label": "Везучий главный герой", "value": 411 }, { "label": "Влияние прошлого", "value": 517 }, { "label": "Внезапное обогащение", "value": 691 }, { "label": "Военные хроники", "value": 749 }, { "label": "Война", "value": 750 }, { "label": "Воспоминания прошлого", "value": 283 }, { "label": "Герои", "value": 341 }, { "label": "Героиня красавица", "value": 81 }, { "label": "Герой влюбляется первым", "value": 561 }, { "label": "Герой красавец", "value": 329 }, { "label": "Герой-бесстыдник", "value": 632 }, { "label": "Герой-извращенец", "value": 521 }, { "label": "Герой-трудяга", "value": 330 }, { "label": "R-15", "value": 570 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "kg.novel";
|
||||||
|
exports.name = "Карманная галактика";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://kg.novel.tl";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Алхимия", "value": 27 }, { "label": "Андроиды", "value": 37 }, { "label": "Анти-рост персонажа", "value": 25 }, { "label": "Антигерой", "value": 43 }, { "label": "Апатичный главный герой", "value": 46 }, { "label": "Аристократия", "value": 51 }, { "label": "Асоциальный главный герой", "value": 42 }, { "label": "Ассасины", "value": 61 }, { "label": "Беззаботный герой", "value": 115 }, { "label": "Безработные", "value": 377 }, { "label": "Бессмертные", "value": 359 }, { "label": "Библиотека", "value": 393 }, { "label": "Боги", "value": 318 }, { "label": "Боевая академия", "value": 75 }, { "label": "Бывший герой", "value": 290 }, { "label": "Ведьмы", "value": 756 }, { "label": "Везучий главный герой", "value": 411 }, { "label": "Верные подданные", "value": 410 }, { "label": "Взросление персонажа", "value": 24 }, { "label": "R-15", "value": 570 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "kod.novel";
|
||||||
|
exports.name = "K.O.D.";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://kod.novel.tl";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Актёрское искусство", "value": 7 }, { "label": "Забота о детях", "value": 127 }, { "label": "Управление бизнесом", "value": 109 }, { "label": "Шоу-бизнес", "value": 642 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "nightnovel";
|
||||||
|
exports.name = "Nightnovel";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://nightnovel.online";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Альтернативная реальность", "value": 30 }, { "label": "Амнезия", "value": 31 }, { "label": "Анал", "value": 33 }, { "label": "Ангелы", "value": 38 }, { "label": "Аристократия", "value": 51 }, { "label": "Артефакты", "value": 58 }, { "label": "Ассасины", "value": 61 }, { "label": "Банды", "value": 302 }, { "label": "БДСМ", "value": 77 }, { "label": "Беременность", "value": 551 }, { "label": "Боги", "value": 318 }, { "label": "Богини", "value": 316 }, { "label": "Боевая академия", "value": 75 }, { "label": "Божественная сила", "value": 317 }, { "label": "Влияние прошлого", "value": 517 }, { "label": "Враги становятся союзниками", "value": 238 }, { "label": "Вынужденные условия проживания", "value": 287 }, { "label": "Герои", "value": 341 }, { "label": "Героиня красавица", "value": 81 }, { "label": "R-18", "value": 571 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "original.novel";
|
||||||
|
exports.name = "Авторские работы";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://original.novel.tl";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Агрессивные персонажи", "value": 26 }, { "label": "Академия", "value": 5 }, { "label": "Андроиды", "value": 37 }, { "label": "Антимагия", "value": 41 }, { "label": "Аристократия", "value": 51 }, { "label": "Артефакты", "value": 58 }, { "label": "Брошенные дети", "value": 1 }, { "label": "Вероломные герои/плетение интриг", "value": 424 }, { "label": "Взросление персонажа", "value": 24 }, { "label": "Владелец уникального оружия", "value": 736 }, { "label": "Герой-извращенец", "value": 521 }, { "label": "Главный герой не человек", "value": 488 }, { "label": "Государственные интриги", "value": 212 }, { "label": "Душещипательная история", "value": 335 }, { "label": "Жестокие персонажи", "value": 4 }, { "label": "Зверолюди", "value": 39 }, { "label": "Знания из прошлой жизни", "value": 553 }, { "label": "Искусственный интеллект", "value": 59 }, { "label": "Конфликт в семье", "value": 261 }, { "label": "Королевства", "value": 382 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "red.novel";
|
||||||
|
exports.name = "Север и Юг";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://red.novel.tl";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Героиня красавица", "value": 81 }, { "label": "Герой влюбляется первым", "value": 561 }, { "label": "Главный герой — мужчина", "value": 419 }, { "label": "Дружба", "value": 293 }, { "label": "Жизнь в одиночку", "value": 396 }, { "label": "Сложные семейные отношения", "value": 149 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.fetchImage = exports.searchNovels = exports.parseChapter = exports.parseNovelAndChapters = exports.popularNovels = exports.filters = exports.site = exports.version = exports.icon = exports.name = exports.id = void 0;
|
||||||
|
const cheerio_1 = require("cheerio");
|
||||||
|
const dayjs_1 = __importDefault(require("dayjs"));
|
||||||
|
const fetch_1 = require("@libs/fetch");
|
||||||
|
// import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||||
|
// import { isUrlAbsolute } from '@libs/isAbsoluteUrl';
|
||||||
|
// import { showToast } from "@libs/showToast";
|
||||||
|
const filterInputs_1 = require("@libs/filterInputs");
|
||||||
|
const novelStatus_1 = require("@libs/novelStatus");
|
||||||
|
const defaultCover_1 = require("@libs/defaultCover");
|
||||||
|
exports.id = "ruranobe";
|
||||||
|
exports.name = "РуРанобэ";
|
||||||
|
exports.icon = "";
|
||||||
|
exports.version = "1.0.0";
|
||||||
|
exports.site = "https://ruranobe.ru";
|
||||||
|
exports.filters = [{ "key": "tags", "label": "Тэги", "values": [{ "label": "Автоматы", "value": 64 }, { "label": "Агрессивные персонажи", "value": 26 }, { "label": "Ад", "value": 338 }, { "label": "Адаптация манги", "value": 8 }, { "label": "Академия", "value": 5 }, { "label": "Алхимия", "value": 27 }, { "label": "Альтернативная реальность", "value": 30 }, { "label": "Амнезия", "value": 31 }, { "label": "Анабиоз", "value": 170 }, { "label": "Ангелы", "value": 38 }, { "label": "Андроиды", "value": 37 }, { "label": "Антигерой", "value": 43 }, { "label": "Антимагия", "value": 41 }, { "label": "Апатичный главный герой", "value": 46 }, { "label": "Апокалипсис", "value": 47 }, { "label": "Аристократия", "value": 51 }, { "label": "Артефакты", "value": 58 }, { "label": "Асоциальный главный герой", "value": 42 }, { "label": "R-15", "value": 570 }, { "label": "R-18", "value": 571 }], "inputType": filterInputs_1.FilterInputs.Checkbox }];
|
||||||
|
exports["protected"] = false;
|
||||||
|
const baseUrl = exports.site;
|
||||||
|
const domain = baseUrl.split('//')[1];
|
||||||
|
const popularNovels = function (page, { filters }) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: ((_b = (_a = filters === null || filters === void 0 ? void 0 : filters.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? { tags: filters === null || filters === void 0 ? void 0 : filters.tags } : {},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = (_e = (_d = (_c = json.data) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.map((novel) => {
|
||||||
|
var _a;
|
||||||
|
return ({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.popularNovels = popularNovels;
|
||||||
|
const parseNovelAndChapters = function (novelUrl) {
|
||||||
|
var _a, _b;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Book',
|
||||||
|
query: 'query Book($url:String){project(project:{fullUrl:$url}){title translationStatus url covers{url}persons(langs:["ru","en","*"]roles:["author","illustrator","original_story","original_design"]){role name{firstName lastName}}genres{nameRu nameEng}tags{nameRu nameEng}annotation{text}subprojects{content{title volumes{content{url shortName chapters{title publishDate url published}}}}}}}',
|
||||||
|
variables: {
|
||||||
|
hostname: domain,
|
||||||
|
project: novelUrl,
|
||||||
|
url: novelUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novel = {
|
||||||
|
url: novelUrl,
|
||||||
|
name: json.data.project.title,
|
||||||
|
cover: ((_a = json.data.project.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + json.data.project.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
summary: (0, cheerio_1.load)((_b = json.data.project.annotation) === null || _b === void 0 ? void 0 : _b.text).text(),
|
||||||
|
author: json.data.project.persons[0].name.firstName +
|
||||||
|
' ' +
|
||||||
|
json.data.project.persons[0].name.lastName,
|
||||||
|
status: json.data.project.translationStatus === 'active'
|
||||||
|
? novelStatus_1.NovelStatus.Ongoing
|
||||||
|
: novelStatus_1.NovelStatus.Completed,
|
||||||
|
};
|
||||||
|
let genres = []
|
||||||
|
.concat(json.data.project.tags, json.data.project.genres)
|
||||||
|
.map((item) => (item === null || item === void 0 ? void 0 : item.nameRu) || (item === null || item === void 0 ? void 0 : item.nameEng))
|
||||||
|
.filter(item => item);
|
||||||
|
if (genres.length > 0) {
|
||||||
|
novel.genres = genres.join(',');
|
||||||
|
}
|
||||||
|
let novelChapters = [];
|
||||||
|
json.data.project.subprojects.content.forEach((work) => work.volumes.content.forEach((volume) => volume.chapters.forEach((chapter) => (chapter === null || chapter === void 0 ? void 0 : chapter.published) &&
|
||||||
|
novelChapters.push({
|
||||||
|
name: volume.shortName + ' ' + chapter.title,
|
||||||
|
url: novelUrl + '/' + volume.url + '/' + chapter.url,
|
||||||
|
releaseTime: (0, dayjs_1.default)(chapter.publishDate).format('LLL'),
|
||||||
|
}))));
|
||||||
|
novel.chapters = novelChapters;
|
||||||
|
return novel;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseNovelAndChapters = parseNovelAndChapters;
|
||||||
|
const parseChapter = function (chapterUrl) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'EReaderData',
|
||||||
|
query: 'query EReaderData($url:String!,$chapterSelector:Selector!){project(project:{fullUrl:$url}){title url}chapter(chapter:$chapterSelector){title text{text}}}',
|
||||||
|
variables: {
|
||||||
|
chapterSelector: {
|
||||||
|
fullUrl: chapterUrl,
|
||||||
|
},
|
||||||
|
url: chapterUrl,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
return (0, cheerio_1.load)(json.data.chapter.text.text).html();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.parseChapter = parseChapter;
|
||||||
|
const searchNovels = (searchTerm) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
var _a, _b, _c;
|
||||||
|
const result = yield (0, fetch_1.fetchApi)('https://api.novel.tl/api/site/v2/graphql', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Alt-Used': 'api.novel.tl',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
},
|
||||||
|
referrer: baseUrl,
|
||||||
|
body: JSON.stringify({
|
||||||
|
operationName: 'Projects',
|
||||||
|
query: 'query Projects($hostname:String! $filter:SearchFilter $page:Int $limit:Int){projects(section:{fullUrl:$hostname}filter:$filter page:{pageSize:$limit,pageNumber:$page}){content{title url covers{url}}}}',
|
||||||
|
variables: {
|
||||||
|
filter: {
|
||||||
|
query: searchTerm,
|
||||||
|
},
|
||||||
|
hostname: domain,
|
||||||
|
limit: 40,
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
const json = yield result.json();
|
||||||
|
const novels = [];
|
||||||
|
(_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.data) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.forEach((novel) => {
|
||||||
|
var _a;
|
||||||
|
return novels.push({
|
||||||
|
name: novel.title,
|
||||||
|
url: baseUrl + '/r/' + novel.url,
|
||||||
|
cover: ((_a = novel.covers[0]) === null || _a === void 0 ? void 0 : _a.url)
|
||||||
|
? baseUrl + novel.covers[0].url
|
||||||
|
: defaultCover_1.defaultCover,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return novels;
|
||||||
|
});
|
||||||
|
exports.searchNovels = searchNovels;
|
||||||
|
const fetchImage = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
return yield (0, fetch_1.fetchFile)(url, {});
|
||||||
|
});
|
||||||
|
exports.fetchImage = fetchImage;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user