commit 8ccc1db550a71482326ca5ef6f6e600cd651943f Author: masterhc Date: Wed Apr 17 22:27:49 2024 +0100 init diff --git a/.env b/.env new file mode 100644 index 0000000..1ae736f --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +DATABASE_URL=mongodb://mongoadmin:something@192.168.71.137:27017 +PORT=5010 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f42c937 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +Saved \ No newline at end of file diff --git a/Modules/AsuraModule.js b/Modules/AsuraModule.js new file mode 100644 index 0000000..f68411e --- /dev/null +++ b/Modules/AsuraModule.js @@ -0,0 +1,260 @@ +const {parse} = require('node-html-parser'); +const {decodeHTML} = require('../lib') +module.exports = class AsuraModule +{ + /** + * @property {Scanlator} scanlator - Scanlator name + * @typedef {String} Scanlator + * @pattern /^[\w-]+-scans$/ + */ + constructor() + { + this.scanlator = 'Asura-scans' + this.BaseLink = 'https://asuratoon.com/' + } + /** + * + * @param {String} query + * @returns {Array} + * @typedef {Object} Manga + * @property {Link} link - Manga Link + * @property {String} title - Manga Title + * @property {Link} img - Image Link + * @property {Number} latestChap - Latest Chapter Number + * @typedef {String} Link + */ + async Search(query) + { + return await fetch(this.BaseLink+'?s='+query) + .then(handleResponse) + .then(handleData) + .catch(handleError); + function handleResponse(response) + { + return response.text(); + } + function handleError(error) + { + return error; + } + function handleData(data) + { + data = data.split('
')[1].split('