remove this.cookieString attribute
This commit is contained in:
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var WPmangaStreamPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
}
|
}
|
||||||
WPmangaStreamPlugin.prototype.popularNovels = function (page) {
|
WPmangaStreamPlugin.prototype.popularNovels = function (page) {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var KolNovel = /** @class */ (function () {
|
|||||||
this.site = "https://kolnovel.lol/";
|
this.site = "https://kolnovel.lol/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
order: {
|
order: {
|
||||||
label: "ترتيب حسب",
|
label: "ترتيب حسب",
|
||||||
@@ -148,9 +147,6 @@ var KolNovel = /** @class */ (function () {
|
|||||||
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters.status : "");
|
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");
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters.order : "popular");
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
||||||
return result.text();
|
return result.text();
|
||||||
})];
|
})];
|
||||||
@@ -185,9 +181,6 @@ var KolNovel = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, fetch(url, { headers: headers })];
|
return [4 /*yield*/, fetch(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -258,9 +251,6 @@ var KolNovel = /** @class */ (function () {
|
|||||||
switch (_b.label) {
|
switch (_b.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, fetch(chapterUrl, { headers: headers })];
|
return [4 /*yield*/, fetch(chapterUrl, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _b.sent();
|
result = _b.sent();
|
||||||
@@ -286,9 +276,6 @@ var KolNovel = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = "".concat(this.site, "?s=").concat(searchTerm);
|
url = "".concat(this.site, "?s=").concat(searchTerm);
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ var Linovelib = /** @class */ (function () {
|
|||||||
this.site = "https://w.linovelib.com";
|
this.site = "https://w.linovelib.com";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
label: "Sort By",
|
label: "Sort By",
|
||||||
@@ -83,9 +82,6 @@ var Linovelib = /** @class */ (function () {
|
|||||||
link += filters.sort;
|
link += filters.sort;
|
||||||
link += "/".concat(pageNo, ".html");
|
link += "/".concat(pageNo, ".html");
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
||||||
return result.text();
|
return result.text();
|
||||||
})];
|
})];
|
||||||
@@ -124,9 +120,6 @@ var Linovelib = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _b.sent();
|
result = _b.sent();
|
||||||
@@ -206,9 +199,6 @@ var Linovelib = /** @class */ (function () {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
chapterText = "", pageText = "";
|
chapterText = "", pageText = "";
|
||||||
pageNumber = 1;
|
pageNumber = 1;
|
||||||
skillgg = {
|
skillgg = {
|
||||||
@@ -416,9 +406,6 @@ var Linovelib = /** @class */ (function () {
|
|||||||
searchUrl = "".concat(this.site, "/search/");
|
searchUrl = "".concat(this.site, "/search/");
|
||||||
Term = encodeURI(searchTerm);
|
Term = encodeURI(searchTerm);
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
novels = [];
|
novels = [];
|
||||||
addPage = function (pageCheerio, redirect) { return __awaiter(_this, void 0, void 0, function () {
|
addPage = function (pageCheerio, redirect) { return __awaiter(_this, void 0, void 0, function () {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var ReadwnPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
ReadwnPlugin.prototype.popularNovels = function (pageNo, _a) {
|
ReadwnPlugin.prototype.popularNovels = function (pageNo, _a) {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var ReadwnPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
ReadwnPlugin.prototype.popularNovels = function (pageNo, _a) {
|
ReadwnPlugin.prototype.popularNovels = function (pageNo, _a) {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var ReadwnPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
ReadwnPlugin.prototype.popularNovels = function (pageNo, _a) {
|
ReadwnPlugin.prototype.popularNovels = function (pageNo, _a) {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ var BLN = /** @class */ (function () {
|
|||||||
this.site = "https://bestlightnovel.com/";
|
this.site = "https://bestlightnovel.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
}
|
}
|
||||||
BLN.prototype.popularNovels = function (pageNo, options) {
|
BLN.prototype.popularNovels = function (pageNo, options) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ var FTest = /** @class */ (function () {
|
|||||||
this.site = "https://noblemtl.com/";
|
this.site = "https://noblemtl.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
picker: {
|
picker: {
|
||||||
type: filterInputs_1.FilterTypes.Picker,
|
type: filterInputs_1.FilterTypes.Picker,
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ var FreeWebNovel = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/en/freewebnovel/icon.png";
|
this.icon = "src/en/freewebnovel/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
}
|
}
|
||||||
FreeWebNovel.prototype.popularNovels = function (page, _a) {
|
FreeWebNovel.prototype.popularNovels = function (page, _a) {
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var NobleMTL = /** @class */ (function () {
|
|||||||
this.site = "https://noblemtl.com/";
|
this.site = "https://noblemtl.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
order: {
|
order: {
|
||||||
label: "Sort By",
|
label: "Sort By",
|
||||||
@@ -196,9 +195,6 @@ var NobleMTL = /** @class */ (function () {
|
|||||||
link += "&status=" + filters.status.value;
|
link += "&status=" + filters.status.value;
|
||||||
link += "&order=" + filters.order.value;
|
link += "&order=" + filters.order.value;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
||||||
return result.text();
|
return result.text();
|
||||||
})];
|
})];
|
||||||
@@ -233,9 +229,6 @@ var NobleMTL = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -311,9 +304,6 @@ var NobleMTL = /** @class */ (function () {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -335,9 +325,6 @@ var NobleMTL = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = "".concat(this.site, "?s=").concat(searchTerm);
|
url = "".concat(this.site, "?s=").concat(searchTerm);
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var PandaMTL = /** @class */ (function () {
|
|||||||
this.site = "https://pandamtl.com/";
|
this.site = "https://pandamtl.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
order: {
|
order: {
|
||||||
label: "Sort By",
|
label: "Sort By",
|
||||||
@@ -126,9 +125,6 @@ var PandaMTL = /** @class */ (function () {
|
|||||||
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters.status : "");
|
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");
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters.order : "popular");
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
||||||
return result.text();
|
return result.text();
|
||||||
})];
|
})];
|
||||||
@@ -163,9 +159,6 @@ var PandaMTL = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -234,9 +227,6 @@ var PandaMTL = /** @class */ (function () {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -258,9 +248,6 @@ var PandaMTL = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = "".concat(this.site, "?s=").concat(searchTerm);
|
url = "".concat(this.site, "?s=").concat(searchTerm);
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var WPmangaStreamPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
}
|
}
|
||||||
WPmangaStreamPlugin.prototype.popularNovels = function (page) {
|
WPmangaStreamPlugin.prototype.popularNovels = function (page) {
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ var ChireadsPlugin = /** @class */ (function () {
|
|||||||
this.site = "https://chireads.com";
|
this.site = "https://chireads.com";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36";
|
this.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36";
|
||||||
this.cookieString = "''";
|
|
||||||
}
|
}
|
||||||
ChireadsPlugin.prototype.parseNovels = function (loadedCheerio) {
|
ChireadsPlugin.prototype.parseNovels = function (loadedCheerio) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var NovelDeGlacePlugin = /** @class */ (function () {
|
|||||||
this.site = "https://noveldeglace.com/";
|
this.site = "https://noveldeglace.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "''";
|
this.userAgent = "''";
|
||||||
this.cookieString = "''";
|
|
||||||
}
|
}
|
||||||
NovelDeGlacePlugin.prototype.popularNovels = function (page) {
|
NovelDeGlacePlugin.prototype.popularNovels = function (page) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var LightNovelBrasil = /** @class */ (function () {
|
|||||||
this.site = "https://lightnovelbrasil.com/";
|
this.site = "https://lightnovelbrasil.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
order: {
|
order: {
|
||||||
label: "Sort By",
|
label: "Sort By",
|
||||||
@@ -196,9 +195,6 @@ var LightNovelBrasil = /** @class */ (function () {
|
|||||||
link += "&status=" + ((filters === null || filters === void 0 ? void 0 : filters.status) ? filters.status : "");
|
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");
|
link += "&order=" + ((filters === null || filters === void 0 ? void 0 : filters.order) ? filters.order : "popular");
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
||||||
return result.text();
|
return result.text();
|
||||||
})];
|
})];
|
||||||
@@ -233,9 +229,6 @@ var LightNovelBrasil = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -312,9 +305,6 @@ var LightNovelBrasil = /** @class */ (function () {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -336,9 +326,6 @@ var LightNovelBrasil = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = "".concat(this.site, "?s=").concat(searchTerm);
|
url = "".concat(this.site, "?s=").concat(searchTerm);
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ var IfreedomPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
IfreedomPlugin.prototype.popularNovels = function (page, _a) {
|
IfreedomPlugin.prototype.popularNovels = function (page, _a) {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var RulatePlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
RulatePlugin.prototype.popularNovels = function (pageNo, _a) {
|
RulatePlugin.prototype.popularNovels = function (pageNo, _a) {
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var freedlit = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/freedlit/icon.png";
|
this.icon = "src/ru/freedlit/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var RulatePlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
RulatePlugin.prototype.popularNovels = function (pageNo, _a) {
|
RulatePlugin.prototype.popularNovels = function (pageNo, _a) {
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ var AuthorToday = /** @class */ (function () {
|
|||||||
this.site = "https://author.today";
|
this.site = "https://author.today";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ var Bookriver = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/bookriver/icon.png";
|
this.icon = "src/ru/bookriver/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ var ficbook = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/ficbook/icon.png";
|
this.icon = "src/ru/ficbook/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ var Jaomix = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/jaomix/icon.png";
|
this.icon = "src/ru/jaomix/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sortby: {
|
sortby: {
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ var TL = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/noveltl/icon.png";
|
this.icon = "src/ru/noveltl/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
tags: {
|
tags: {
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ var RNBH = /** @class */ (function () {
|
|||||||
this.site = "https://ranobehub.org/";
|
this.site = "https://ranobehub.org/";
|
||||||
this.icon = "src/ru/ranobehub/icon.png";
|
this.icon = "src/ru/ranobehub/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ var RLIB = /** @class */ (function () {
|
|||||||
this.icon = "src/ru/ranobelib/icon.png";
|
this.icon = "src/ru/ranobelib/icon.png";
|
||||||
this.ui = undefined;
|
this.ui = undefined;
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ var RNRF = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/ranoberf/icon.png";
|
this.icon = "src/ru/ranoberf/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ var ReN = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ru/renovels/icon.png";
|
this.icon = "src/ru/renovels/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
this.filters = {
|
this.filters = {
|
||||||
sort: {
|
sort: {
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ var IfreedomPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
IfreedomPlugin.prototype.popularNovels = function (page, _a) {
|
IfreedomPlugin.prototype.popularNovels = function (page, _a) {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var TuNovelaLigera = /** @class */ (function () {
|
|||||||
this.site = "https://tunovelaligera.com/";
|
this.site = "https://tunovelaligera.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
order: {
|
order: {
|
||||||
value: "?m_orderby=rating",
|
value: "?m_orderby=rating",
|
||||||
@@ -137,9 +136,6 @@ var TuNovelaLigera = /** @class */ (function () {
|
|||||||
link += "/page/".concat(pageNo);
|
link += "/page/".concat(pageNo);
|
||||||
link += filters.order;
|
link += filters.order;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _b.sent();
|
result = _b.sent();
|
||||||
@@ -175,9 +171,6 @@ var TuNovelaLigera = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _c.sent();
|
result = _c.sent();
|
||||||
@@ -353,9 +346,6 @@ var TuNovelaLigera = /** @class */ (function () {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl)];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl)];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ var MadaraPlugin = /** @class */ (function () {
|
|||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.options = metadata.options;
|
this.options = metadata.options;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var LSHNovel = /** @class */ (function () {
|
|||||||
this.site = "https://lshnovel.com/";
|
this.site = "https://lshnovel.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.filters = {
|
this.filters = {
|
||||||
order: {
|
order: {
|
||||||
value: "popular",
|
value: "popular",
|
||||||
@@ -144,9 +143,6 @@ var LSHNovel = /** @class */ (function () {
|
|||||||
link += "&status=" + filters.status;
|
link += "&status=" + filters.status;
|
||||||
link += "&order=" + filters.order;
|
link += "&order=" + filters.order;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(link, { headers: headers }).then(function (result) {
|
||||||
return result.text();
|
return result.text();
|
||||||
})];
|
})];
|
||||||
@@ -181,9 +177,6 @@ var LSHNovel = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = novelUrl;
|
url = novelUrl;
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -259,9 +252,6 @@ var LSHNovel = /** @class */ (function () {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(chapterUrl, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
@@ -283,9 +273,6 @@ var LSHNovel = /** @class */ (function () {
|
|||||||
case 0:
|
case 0:
|
||||||
url = "".concat(this.site, "?s=").concat(searchTerm);
|
url = "".concat(this.site, "?s=").concat(searchTerm);
|
||||||
headers = new Headers();
|
headers = new Headers();
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
return [4 /*yield*/, (0, fetch_1.fetchApi)(url, { headers: headers })];
|
||||||
case 1:
|
case 1:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var Smakolykytl = /** @class */ (function () {
|
|||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.icon = "src/ua/smakolykytl/icon.png";
|
this.icon = "src/ua/smakolykytl/icon.png";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
this.fetchImage = fetch_1.fetchFile;
|
this.fetchImage = fetch_1.fetchFile;
|
||||||
}
|
}
|
||||||
Smakolykytl.prototype.popularNovels = function (pageNo, _a) {
|
Smakolykytl.prototype.popularNovels = function (pageNo, _a) {
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ var HakoPlugin = /** @class */ (function () {
|
|||||||
this.site = "https://ln.hako.vn";
|
this.site = "https://ln.hako.vn";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
}
|
}
|
||||||
HakoPlugin.prototype.parseNovels = function (loadedCheerio) {
|
HakoPlugin.prototype.parseNovels = function (loadedCheerio) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|||||||
+315
-328
@@ -1,328 +1,315 @@
|
|||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
|
|
||||||
class KolNovel implements Plugin.PluginBase {
|
class KolNovel implements Plugin.PluginBase {
|
||||||
id = "kolnovel";
|
id = "kolnovel";
|
||||||
name = "KolNovel";
|
name = "KolNovel";
|
||||||
icon = "multisrc/wpmangastream/icons/kolnovel.png";
|
icon = "multisrc/wpmangastream/icons/kolnovel.png";
|
||||||
site = "https://kolnovel.lol/";
|
site = "https://kolnovel.lol/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let link = `${this.site}series/?page=${pageNo}`;
|
||||||
let link = `${this.site}series/?page=${pageNo}`;
|
|
||||||
|
if (filters.genres.value.length)
|
||||||
if (filters.genres.value.length)
|
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
||||||
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
if (filters.type.value.length)
|
||||||
if (filters.type.value.length)
|
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
||||||
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
|
||||||
|
link += "&status=" + (filters?.status ? filters.status : "");
|
||||||
link += "&status=" + (filters?.status ? filters.status : "");
|
|
||||||
|
link += "&order=" + (filters?.order ? filters.order : "popular");
|
||||||
link += "&order=" + (filters?.order ? filters.order : "popular");
|
const headers = new Headers();
|
||||||
const headers = new Headers();
|
const body = await fetchApi(link, { headers }).then((result) =>
|
||||||
if (this.cookieString) {
|
result.text()
|
||||||
headers.append("cookie", this.cookieString);
|
);
|
||||||
}
|
|
||||||
const body = await fetchApi(link, { headers }).then((result) =>
|
const loadedCheerio = parseHTML(body);
|
||||||
result.text()
|
|
||||||
);
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
loadedCheerio("article.maindet").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
const novels: Plugin.NovelItem[] = [];
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
loadedCheerio("article.maindet").each(function () {
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
const novelName = loadedCheerio(this).find("h2").text();
|
|
||||||
let image = loadedCheerio(this).find("img");
|
if (!novelUrl) return;
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
|
||||||
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
if (!novelUrl) return;
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
const novel = {
|
};
|
||||||
name: novelName,
|
|
||||||
cover: novelCover,
|
novels.push(novel);
|
||||||
url: novelUrl,
|
});
|
||||||
};
|
|
||||||
|
return novels;
|
||||||
novels.push(novel);
|
}
|
||||||
});
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
|
const url = novelUrl;
|
||||||
return novels;
|
const headers = new Headers();
|
||||||
}
|
const result = await fetch(url, { headers });
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await result.text();
|
||||||
const url = novelUrl;
|
|
||||||
const headers = new Headers();
|
let loadedCheerio = parseHTML(body);
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
const novel: Plugin.SourceNovel = {
|
||||||
}
|
url,
|
||||||
const result = await fetch(url, { headers });
|
chapters: [],
|
||||||
const body = await result.text();
|
};
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
novel.name = loadedCheerio("h1.entry-title").text();
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
novel.cover =
|
||||||
url,
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
chapters: [],
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
};
|
|
||||||
|
loadedCheerio("div.serl:nth-child(3) > span").each(function () {
|
||||||
novel.name = loadedCheerio("h1.entry-title").text();
|
const detailName = loadedCheerio(this).text().trim();
|
||||||
|
const detail = loadedCheerio(this).next().text().trim();
|
||||||
novel.cover =
|
|
||||||
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
switch (detailName) {
|
||||||
loadedCheerio("img.wp-post-image").attr("src");
|
case "الكاتب":
|
||||||
|
case "Author":
|
||||||
loadedCheerio("div.serl:nth-child(3) > span").each(function () {
|
novel.author = detail;
|
||||||
const detailName = loadedCheerio(this).text().trim();
|
break;
|
||||||
const detail = loadedCheerio(this).next().text().trim();
|
}
|
||||||
|
});
|
||||||
switch (detailName) {
|
|
||||||
case "الكاتب":
|
novel.status = loadedCheerio("div.sertostat > span").attr("class");
|
||||||
case "Author":
|
|
||||||
novel.author = detail;
|
novel.genres = loadedCheerio(".sertogenre")
|
||||||
break;
|
.children("a")
|
||||||
}
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
});
|
.toArray()
|
||||||
|
.join(",");
|
||||||
novel.status = loadedCheerio("div.sertostat > span").attr("class");
|
|
||||||
|
novel.summary = loadedCheerio(".sersys")
|
||||||
novel.genres = loadedCheerio(".sertogenre")
|
.find("br")
|
||||||
.children("a")
|
.replaceWith("\n")
|
||||||
.map((i, el) => loadedCheerio(el).text())
|
.end()
|
||||||
.toArray()
|
.text();
|
||||||
.join(",");
|
|
||||||
|
let chapter: Plugin.ChapterItem[] = [];
|
||||||
novel.summary = loadedCheerio(".sersys")
|
|
||||||
.find("br")
|
loadedCheerio(".eplister")
|
||||||
.replaceWith("\n")
|
.find("li")
|
||||||
.end()
|
.each(function () {
|
||||||
.text();
|
const chapterName =
|
||||||
|
loadedCheerio(this).find(".epl-num").text() +
|
||||||
let chapter: Plugin.ChapterItem[] = [];
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
loadedCheerio(".eplister")
|
|
||||||
.find("li")
|
const releaseDate = loadedCheerio(this)
|
||||||
.each(function () {
|
.find(".epl-date")
|
||||||
const chapterName =
|
.text()
|
||||||
loadedCheerio(this).find(".epl-num").text() +
|
.trim();
|
||||||
" - " +
|
|
||||||
loadedCheerio(this).find(".epl-title").text();
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
|
||||||
const releaseDate = loadedCheerio(this)
|
if (!chapterUrl) return;
|
||||||
.find(".epl-date")
|
|
||||||
.text()
|
chapter.push({
|
||||||
.trim();
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
url: chapterUrl,
|
||||||
|
});
|
||||||
if (!chapterUrl) return;
|
});
|
||||||
|
|
||||||
chapter.push({
|
novel.chapters = chapter.reverse();
|
||||||
name: chapterName,
|
|
||||||
releaseTime: releaseDate,
|
return novel;
|
||||||
url: chapterUrl,
|
}
|
||||||
});
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
});
|
const headers = new Headers();
|
||||||
|
const result = await fetch(chapterUrl, { headers });
|
||||||
novel.chapters = chapter.reverse();
|
const body = await result.text();
|
||||||
|
|
||||||
return novel;
|
const loadedCheerio = parseHTML(body);
|
||||||
}
|
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
loadedCheerio(".epcontent > div, i").remove();
|
||||||
const headers = new Headers();
|
let ignore = loadedCheerio("article > style").text().trim().split(",");
|
||||||
if (this.cookieString) {
|
ignore.push(...(ignore.pop()?.match(/^\.\w+/) || []));
|
||||||
headers.append("cookie", this.cookieString);
|
ignore.map((tag) => loadedCheerio(`p${tag}`).remove());
|
||||||
}
|
|
||||||
const result = await fetch(chapterUrl, { headers });
|
let chapterText = loadedCheerio(".epcontent").html() || "";
|
||||||
const body = await result.text();
|
|
||||||
|
return chapterText;
|
||||||
const loadedCheerio = parseHTML(body);
|
}
|
||||||
|
async searchNovels(
|
||||||
loadedCheerio(".epcontent > div, i").remove();
|
searchTerm: string,
|
||||||
let ignore = loadedCheerio("article > style").text().trim().split(",");
|
pageNo?: number | undefined
|
||||||
ignore.push(...(ignore.pop()?.match(/^\.\w+/) || []));
|
): Promise<Plugin.NovelItem[]> {
|
||||||
ignore.map((tag) => loadedCheerio(`p${tag}`).remove());
|
const url = `${this.site}?s=${searchTerm}`;
|
||||||
|
const headers = new Headers();
|
||||||
let chapterText = loadedCheerio(".epcontent").html() || "";
|
const result = await fetchApi(url, { headers });
|
||||||
|
const body = await result.text();
|
||||||
return chapterText;
|
|
||||||
}
|
const loadedCheerio = parseHTML(body);
|
||||||
async searchNovels(
|
|
||||||
searchTerm: string,
|
const novels: Plugin.NovelItem[] = [];
|
||||||
pageNo?: number | undefined
|
|
||||||
): Promise<Plugin.NovelItem[]> {
|
loadedCheerio("article.maindet").each(function () {
|
||||||
const url = `${this.site}?s=${searchTerm}`;
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
const headers = new Headers();
|
let image = loadedCheerio(this).find("img");
|
||||||
if (this.cookieString) {
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
headers.append("cookie", this.cookieString);
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
}
|
|
||||||
const result = await fetchApi(url, { headers });
|
if (!novelUrl) return;
|
||||||
const body = await result.text();
|
|
||||||
|
novels.push({
|
||||||
const loadedCheerio = parseHTML(body);
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
const novels: Plugin.NovelItem[] = [];
|
cover: novelCover,
|
||||||
|
});
|
||||||
loadedCheerio("article.maindet").each(function () {
|
});
|
||||||
const novelName = loadedCheerio(this).find("h2").text();
|
|
||||||
let image = loadedCheerio(this).find("img");
|
return novels;
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
}
|
||||||
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
|
return await fetchFile(url);
|
||||||
if (!novelUrl) return;
|
}
|
||||||
|
filters = {
|
||||||
novels.push({
|
order: {
|
||||||
name: novelName,
|
label: "ترتيب حسب",
|
||||||
url: novelUrl,
|
options: [
|
||||||
cover: novelCover,
|
{ label: "الإعداد الأولي", value: "" },
|
||||||
});
|
|
||||||
});
|
{ label: "A-Z", value: "title" },
|
||||||
|
|
||||||
return novels;
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
}
|
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
{ label: "أخر التحديثات", value: "update" },
|
||||||
return await fetchFile(url);
|
|
||||||
}
|
{ label: "أخر ما تم إضافته", value: "latest" },
|
||||||
filters = {
|
|
||||||
order: {
|
{ label: "الرائجة", value: "popular" },
|
||||||
label: "ترتيب حسب",
|
],
|
||||||
options: [
|
value: "",
|
||||||
{ label: "الإعداد الأولي", value: "" },
|
type: FilterTypes.Picker,
|
||||||
|
},
|
||||||
{ label: "A-Z", value: "title" },
|
status: {
|
||||||
|
value: "",
|
||||||
{ label: "Z-A", value: "titlereverse" },
|
label: "الحالة",
|
||||||
|
options: [
|
||||||
{ label: "أخر التحديثات", value: "update" },
|
{ label: "All", value: "" },
|
||||||
|
|
||||||
{ label: "أخر ما تم إضافته", value: "latest" },
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
|
|
||||||
{ label: "الرائجة", value: "popular" },
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
],
|
|
||||||
value: "",
|
{ label: "Completed", value: "completed" },
|
||||||
type: FilterTypes.Picker,
|
],
|
||||||
},
|
type: FilterTypes.Picker,
|
||||||
status: {
|
},
|
||||||
value: "",
|
type: {
|
||||||
label: "الحالة",
|
value: [],
|
||||||
options: [
|
label: "النوع",
|
||||||
{ label: "All", value: "" },
|
options: [
|
||||||
|
{ label: "إنجليزية", value: "english" },
|
||||||
{ label: "Ongoing", value: "ongoing" },
|
|
||||||
|
{ label: "روايةلايت", value: "light-novel" },
|
||||||
{ label: "Hiatus", value: "hiatus" },
|
|
||||||
|
{ label: "روايةويب", value: "web-novel" },
|
||||||
{ label: "Completed", value: "completed" },
|
|
||||||
],
|
{ label: "صينية", value: "chinese" },
|
||||||
type: FilterTypes.Picker,
|
|
||||||
},
|
{ label: "عربية", value: "arabic" },
|
||||||
type: {
|
|
||||||
value: [],
|
{ label: "كورية", value: "korean" },
|
||||||
label: "النوع",
|
|
||||||
options: [
|
{ label: "يابانية", value: "japanese" },
|
||||||
{ label: "إنجليزية", value: "english" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "روايةلايت", value: "light-novel" },
|
},
|
||||||
|
genres: {
|
||||||
{ label: "روايةويب", value: "web-novel" },
|
value: [],
|
||||||
|
label: "تصنيف",
|
||||||
{ label: "صينية", value: "chinese" },
|
options: [
|
||||||
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
{ label: "عربية", value: "arabic" },
|
|
||||||
|
{ label: "Xianxia", value: "xianxia" },
|
||||||
{ label: "كورية", value: "korean" },
|
|
||||||
|
{ label: "XUANHUAN", value: "xuanhuan" },
|
||||||
{ label: "يابانية", value: "japanese" },
|
|
||||||
],
|
{ label: "أكشن", value: "action" },
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
{ label: "إثارة", value: "excitement" },
|
||||||
genres: {
|
|
||||||
value: [],
|
{ label: "إنتقالالىعالمأخر", value: "isekai" },
|
||||||
label: "تصنيف",
|
|
||||||
options: [
|
{ label: "إيتشي", value: "etchi" },
|
||||||
{ label: "Wuxia", value: "wuxia" },
|
|
||||||
|
{ label: "الخيالالعلمي", value: "sci-fi" },
|
||||||
{ label: "Xianxia", value: "xianxia" },
|
|
||||||
|
{ label: "بوليسي", value: "policy" },
|
||||||
{ label: "XUANHUAN", value: "xuanhuan" },
|
|
||||||
|
{ label: "تاريخي", value: "historical" },
|
||||||
{ label: "أكشن", value: "action" },
|
|
||||||
|
{ label: "تحقيقات", value: "%d8%aa%d8%ad%d9%82%d9%8a%d9%82" },
|
||||||
{ label: "إثارة", value: "excitement" },
|
|
||||||
|
{ label: "تقمصشخصيات", value: "rpg" },
|
||||||
{ label: "إنتقالالىعالمأخر", value: "isekai" },
|
|
||||||
|
{ label: "جريمة", value: "crime" },
|
||||||
{ label: "إيتشي", value: "etchi" },
|
|
||||||
|
{ label: "جوسى", value: "josei" },
|
||||||
{ label: "الخيالالعلمي", value: "sci-fi" },
|
|
||||||
|
{ label: "حريم", value: "harem" },
|
||||||
{ label: "بوليسي", value: "policy" },
|
|
||||||
|
{ label: "حياةمدرسية", value: "school-life" },
|
||||||
{ label: "تاريخي", value: "historical" },
|
|
||||||
|
{ label: "خيالي(فانتازيا)", value: "fantasy" },
|
||||||
{ label: "تحقيقات", value: "%d8%aa%d8%ad%d9%82%d9%8a%d9%82" },
|
|
||||||
|
{ label: "دراما", value: "drama" },
|
||||||
{ label: "تقمصشخصيات", value: "rpg" },
|
|
||||||
|
{ label: "رعب", value: "horror" },
|
||||||
{ label: "جريمة", value: "crime" },
|
|
||||||
|
{ label: "رومانسي", value: "romantic" },
|
||||||
{ label: "جوسى", value: "josei" },
|
|
||||||
|
{ label: "سحر", value: "magic" },
|
||||||
{ label: "حريم", value: "harem" },
|
|
||||||
|
{ label: "سينن", value: "senen" },
|
||||||
{ label: "حياةمدرسية", value: "school-life" },
|
|
||||||
|
{ label: "شريحةمنالحياة", value: "slice-of-life" },
|
||||||
{ label: "خيالي(فانتازيا)", value: "fantasy" },
|
|
||||||
|
{ label: "شوجو", value: "shojo" },
|
||||||
{ label: "دراما", value: "drama" },
|
|
||||||
|
{ label: "شونين", value: "shonen" },
|
||||||
{ label: "رعب", value: "horror" },
|
|
||||||
|
{ label: "طبي", value: "medical" },
|
||||||
{ label: "رومانسي", value: "romantic" },
|
|
||||||
|
{ label: "ظواهرخارقةللطبيعة", value: "supernatural" },
|
||||||
{ label: "سحر", value: "magic" },
|
|
||||||
|
{ label: "غموض", value: "mysteries" },
|
||||||
{ label: "سينن", value: "senen" },
|
|
||||||
|
{ label: "فنونالقتال", value: "martial-arts" },
|
||||||
{ label: "شريحةمنالحياة", value: "slice-of-life" },
|
|
||||||
|
{ label: "قوىخارقة", value: "superpower" },
|
||||||
{ label: "شوجو", value: "shojo" },
|
|
||||||
|
{ label: "كوميدي", value: "comedy" },
|
||||||
{ label: "شونين", value: "shonen" },
|
|
||||||
|
{ label: "مأساوي", value: "tragedy" },
|
||||||
{ label: "طبي", value: "medical" },
|
|
||||||
|
{ label: "مابعدالكارثة", value: "after-the-disaster" },
|
||||||
{ label: "ظواهرخارقةللطبيعة", value: "supernatural" },
|
|
||||||
|
{ label: "مغامرة", value: "adventure" },
|
||||||
{ label: "غموض", value: "mysteries" },
|
|
||||||
|
{ label: "ميكا", value: "mechanical" },
|
||||||
{ label: "فنونالقتال", value: "martial-arts" },
|
|
||||||
|
{ label: "ناضج", value: "mature" },
|
||||||
{ label: "قوىخارقة", value: "superpower" },
|
|
||||||
|
{ label: "نفسي", value: "psychological" },
|
||||||
{ label: "كوميدي", value: "comedy" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "مأساوي", value: "tragedy" },
|
},
|
||||||
|
} satisfies Filters;
|
||||||
{ label: "مابعدالكارثة", value: "after-the-disaster" },
|
}
|
||||||
|
|
||||||
{ label: "مغامرة", value: "adventure" },
|
export default new KolNovel();
|
||||||
|
|
||||||
{ label: "ميكا", value: "mechanical" },
|
|
||||||
|
|
||||||
{ label: "ناضج", value: "mature" },
|
|
||||||
|
|
||||||
{ label: "نفسي", value: "psychological" },
|
|
||||||
],
|
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
|
||||||
} satisfies Filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new KolNovel();
|
|
||||||
|
|||||||
+574
-587
File diff suppressed because it is too large
Load Diff
+180
-181
@@ -1,181 +1,180 @@
|
|||||||
import { load as cheerioload } from "cheerio";
|
import { load as cheerioload } from "cheerio";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { defaultCover } from "@libs/defaultCover";
|
import { defaultCover } from "@libs/defaultCover";
|
||||||
import { fetchFile } from "@libs/fetch";
|
import { fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
|
|
||||||
class BLN implements Plugin.PluginBase {
|
class BLN implements Plugin.PluginBase {
|
||||||
id = "BLN.com";
|
id = "BLN.com";
|
||||||
name = "BestLightNovel";
|
name = "BestLightNovel";
|
||||||
icon = "src/en/bestlightnovel/icon.png";
|
icon = "src/en/bestlightnovel/icon.png";
|
||||||
site = "https://bestlightnovel.com/";
|
site = "https://bestlightnovel.com/";
|
||||||
filter?: undefined;
|
filter?: undefined;
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
options: Plugin.PopularNovelsOptions
|
||||||
options: Plugin.PopularNovelsOptions
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const url =
|
||||||
const url =
|
this.site +
|
||||||
this.site +
|
"novel_list?type=topview&category=all&state=all&page=1" +
|
||||||
"novel_list?type=topview&category=all&state=all&page=1" +
|
pageNo;
|
||||||
pageNo;
|
|
||||||
|
const result = await fetch(url);
|
||||||
const result = await fetch(url);
|
if (!result.ok) {
|
||||||
if (!result.ok) {
|
console.error(await result.text());
|
||||||
console.error(await result.text());
|
// TODO: Cloudflare protection or other error
|
||||||
// TODO: Cloudflare protection or other error
|
return [];
|
||||||
return [];
|
}
|
||||||
}
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
const loadedCheerio = cheerioload(body);
|
||||||
const loadedCheerio = cheerioload(body);
|
|
||||||
|
let novels: Plugin.NovelItem[] = [];
|
||||||
let novels: Plugin.NovelItem[] = [];
|
|
||||||
|
loadedCheerio(".update_item.list_category").each(function () {
|
||||||
loadedCheerio(".update_item.list_category").each(function () {
|
const novelName = loadedCheerio(this).find("h3 > a").text();
|
||||||
const novelName = loadedCheerio(this).find("h3 > a").text();
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
const novelCover = loadedCheerio(this).find("img").attr("src");
|
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
|
||||||
|
if (!novelUrl) {
|
||||||
if (!novelUrl) {
|
// TODO: Handle error
|
||||||
// TODO: Handle error
|
console.error("No novel url!");
|
||||||
console.error("No novel url!");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
const novel = {
|
||||||
const novel = {
|
name: novelName,
|
||||||
name: novelName,
|
url: novelUrl,
|
||||||
url: novelUrl,
|
cover: novelCover,
|
||||||
cover: novelCover,
|
};
|
||||||
};
|
|
||||||
|
novels.push(novel);
|
||||||
novels.push(novel);
|
});
|
||||||
});
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const url = novelUrl;
|
||||||
const url = novelUrl;
|
|
||||||
|
const result = await fetch(url);
|
||||||
const result = await fetch(url);
|
if (!result.ok) {
|
||||||
if (!result.ok) {
|
console.error(await result.text());
|
||||||
console.error(await result.text());
|
// TODO: Cloudflare protection
|
||||||
// TODO: Cloudflare protection
|
return { url, chapters: [] };
|
||||||
return { url, chapters: [] };
|
}
|
||||||
}
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
let loadedCheerio = cheerioload(body);
|
||||||
let loadedCheerio = cheerioload(body);
|
|
||||||
|
let novel: Plugin.SourceNovel = {
|
||||||
let novel: Plugin.SourceNovel = {
|
url,
|
||||||
url,
|
name: "",
|
||||||
name: "",
|
cover: "",
|
||||||
cover: "",
|
author: "",
|
||||||
author: "",
|
status: NovelStatus.Unknown,
|
||||||
status: NovelStatus.Unknown,
|
genres: "",
|
||||||
genres: "",
|
summary: "",
|
||||||
summary: "",
|
chapters: [],
|
||||||
chapters: [],
|
};
|
||||||
};
|
|
||||||
|
novel.name = loadedCheerio(".truyen_info_right h1").text().trim();
|
||||||
novel.name = loadedCheerio(".truyen_info_right h1").text().trim();
|
novel.cover =
|
||||||
novel.cover =
|
loadedCheerio(".info_image img").attr("src") || defaultCover;
|
||||||
loadedCheerio(".info_image img").attr("src") || defaultCover;
|
novel.summary = loadedCheerio("#noidungm").text()?.trim();
|
||||||
novel.summary = loadedCheerio("#noidungm").text()?.trim();
|
novel.author = loadedCheerio(
|
||||||
novel.author = 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"
|
||||||
"#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()
|
||||||
.text()
|
?.trim();
|
||||||
?.trim();
|
|
||||||
|
let status = loadedCheerio(
|
||||||
let status = 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"
|
||||||
"#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()
|
||||||
.text()
|
?.trim();
|
||||||
?.trim();
|
|
||||||
|
novel.status =
|
||||||
novel.status =
|
status === "ONGOING"
|
||||||
status === "ONGOING"
|
? NovelStatus.Ongoing
|
||||||
? NovelStatus.Ongoing
|
: status === "COMPLETED"
|
||||||
: status === "COMPLETED"
|
? NovelStatus.Completed
|
||||||
? NovelStatus.Completed
|
: NovelStatus.Unknown;
|
||||||
: NovelStatus.Unknown;
|
|
||||||
|
let novelChapters: Plugin.ChapterItem[] = [];
|
||||||
let novelChapters: Plugin.ChapterItem[] = [];
|
|
||||||
|
loadedCheerio(".chapter-list div.row").each(function () {
|
||||||
loadedCheerio(".chapter-list div.row").each(function () {
|
const chapterName = loadedCheerio(this).find("a").text().trim();
|
||||||
const chapterName = loadedCheerio(this).find("a").text().trim();
|
const releaseDate = loadedCheerio(this)
|
||||||
const releaseDate = loadedCheerio(this)
|
.find("span:nth-child(2)")
|
||||||
.find("span:nth-child(2)")
|
.text()
|
||||||
.text()
|
.trim();
|
||||||
.trim();
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
|
||||||
|
if (!chapterUrl) {
|
||||||
if (!chapterUrl) {
|
// TODO: Handle error
|
||||||
// TODO: Handle error
|
console.error("No chapter url!");
|
||||||
console.error("No chapter url!");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
novelChapters.push({
|
||||||
novelChapters.push({
|
name: chapterName,
|
||||||
name: chapterName,
|
releaseTime: releaseDate,
|
||||||
releaseTime: releaseDate,
|
url: chapterUrl,
|
||||||
url: chapterUrl,
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
novel.chapters = novelChapters.reverse();
|
||||||
novel.chapters = novelChapters.reverse();
|
|
||||||
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const url = chapterUrl;
|
||||||
const url = chapterUrl;
|
|
||||||
|
const result = await fetch(url);
|
||||||
const result = await fetch(url);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
let loadedCheerio = cheerioload(body);
|
||||||
let loadedCheerio = cheerioload(body);
|
|
||||||
|
const chapterText = loadedCheerio("#vung_doc").html() || "";
|
||||||
const chapterText = loadedCheerio("#vung_doc").html() || "";
|
|
||||||
|
return chapterText;
|
||||||
return chapterText;
|
}
|
||||||
}
|
async searchNovels(
|
||||||
async searchNovels(
|
searchTerm: string,
|
||||||
searchTerm: string,
|
pageNo?: number | undefined
|
||||||
pageNo?: number | undefined
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const url = `${this.site}search_novels/${searchTerm}`;
|
||||||
const url = `${this.site}search_novels/${searchTerm}`;
|
|
||||||
|
const result = await fetch(url);
|
||||||
const result = await fetch(url);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
let loadedCheerio = cheerioload(body);
|
||||||
let loadedCheerio = cheerioload(body);
|
|
||||||
|
let novels: Plugin.NovelItem[] = [];
|
||||||
let novels: Plugin.NovelItem[] = [];
|
|
||||||
|
loadedCheerio(".update_item.list_category").each(function () {
|
||||||
loadedCheerio(".update_item.list_category").each(function () {
|
const novelName = loadedCheerio(this).find("h3 > a").text();
|
||||||
const novelName = loadedCheerio(this).find("h3 > a").text();
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
const novelCover = loadedCheerio(this).find("img").attr("src");
|
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
||||||
const novelUrl = loadedCheerio(this).find("h3 > a").attr("href");
|
|
||||||
|
if (!novelUrl) {
|
||||||
if (!novelUrl) {
|
// TODO: Handle error
|
||||||
// TODO: Handle error
|
console.error("No novel url!");
|
||||||
console.error("No novel url!");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
||||||
const novel = { name: novelName, cover: novelCover, url: novelUrl };
|
|
||||||
|
novels.push(novel);
|
||||||
novels.push(novel);
|
});
|
||||||
});
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
return await fetchFile(url);
|
||||||
return await fetchFile(url);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
export default new BLN();
|
||||||
export default new BLN();
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ class FTest implements Plugin.PluginBase {
|
|||||||
icon = "src/en/noblemtl/icon.png";
|
icon = "src/en/noblemtl/icon.png";
|
||||||
site = "https://noblemtl.com/";
|
site = "https://noblemtl.com/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
async popularNovels(
|
async popularNovels(
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
|
|||||||
+103
-104
@@ -1,104 +1,103 @@
|
|||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
|
|
||||||
class FreeWebNovel implements Plugin.PluginBase {
|
class FreeWebNovel implements Plugin.PluginBase {
|
||||||
id = "FWN.com";
|
id = "FWN.com";
|
||||||
name = "Web NOVEL";
|
name = "Web NOVEL";
|
||||||
site = "https://freewebnovel.com";
|
site = "https://freewebnovel.com";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
icon = "src/en/freewebnovel/icon.png";
|
icon = "src/en/freewebnovel/icon.png";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
page: number,
|
||||||
page: number,
|
{ showLatestNovels }: Plugin.PopularNovelsOptions,
|
||||||
{ showLatestNovels }: Plugin.PopularNovelsOptions,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const sort = showLatestNovels
|
||||||
const sort = showLatestNovels
|
? "/latest-release-novels/"
|
||||||
? "/latest-release-novels/"
|
: "/completed-novels/";
|
||||||
: "/completed-novels/";
|
|
||||||
|
const body = await fetchApi(this.site + sort + page).then((res) => res.text());
|
||||||
const body = await fetchApi(this.site + sort + page).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novels: Plugin.NovelItem[] = loadedCheerio(".li-row")
|
||||||
const novels: Plugin.NovelItem[] = loadedCheerio(".li-row")
|
.map((index, element) => ({
|
||||||
.map((index, element) => ({
|
name: loadedCheerio(element).find(".tit").text(),
|
||||||
name: loadedCheerio(element).find(".tit").text(),
|
cover: loadedCheerio(element).find("img").attr("src"),
|
||||||
cover: loadedCheerio(element).find("img").attr("src"),
|
url: this.site + loadedCheerio(element).find("h3 > a").attr("href"),
|
||||||
url: this.site + loadedCheerio(element).find("h3 > a").attr("href"),
|
}))
|
||||||
}))
|
.get();
|
||||||
.get();
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
async parseNovelAndChapters(url: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(url: string): Promise<Plugin.SourceNovel> {
|
const body = await fetchApi(url).then((res) => res.text());
|
||||||
const body = await fetchApi(url).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novel: Plugin.SourceNovel = { url };
|
||||||
const novel: Plugin.SourceNovel = { url };
|
novel.name = loadedCheerio("h1.tit").text();
|
||||||
novel.name = loadedCheerio("h1.tit").text();
|
novel.cover = loadedCheerio(".pic > img").attr("src");
|
||||||
novel.cover = loadedCheerio(".pic > img").attr("src");
|
novel.genres = loadedCheerio("[title=Genre]")
|
||||||
novel.genres = loadedCheerio("[title=Genre]")
|
.next()
|
||||||
.next()
|
.text()
|
||||||
.text()
|
.replace(/[\t\n]/g, "");
|
||||||
.replace(/[\t\n]/g, "");
|
|
||||||
|
novel.author = loadedCheerio("[title=Author]")
|
||||||
novel.author = loadedCheerio("[title=Author]")
|
.next()
|
||||||
.next()
|
.text()
|
||||||
.text()
|
.replace(/[\t\n]/g, "");
|
||||||
.replace(/[\t\n]/g, "");
|
|
||||||
|
novel.status = loadedCheerio("[title=Status]")
|
||||||
novel.status = loadedCheerio("[title=Status]")
|
.next()
|
||||||
.next()
|
.text()
|
||||||
.text()
|
.replace(/[\t\n]/g, "");
|
||||||
.replace(/[\t\n]/g, "");
|
|
||||||
|
novel.summary = loadedCheerio(".inner").text().trim();
|
||||||
novel.summary = loadedCheerio(".inner").text().trim();
|
|
||||||
|
const chapters: Plugin.ChapterItem[] = loadedCheerio("#idData > li > a")
|
||||||
const chapters: Plugin.ChapterItem[] = loadedCheerio("#idData > li > a")
|
.map((index, element) => ({
|
||||||
.map((index, element) => ({
|
name: loadedCheerio(element).attr("title") || "Chapter " + index,
|
||||||
name: loadedCheerio(element).attr("title") || "Chapter " + index,
|
releaseTime: null,
|
||||||
releaseTime: null,
|
url: this.site + loadedCheerio(element).attr("href"),
|
||||||
url: this.site + loadedCheerio(element).attr("href"),
|
}))
|
||||||
}))
|
.get();
|
||||||
.get();
|
|
||||||
|
novel.chapters = chapters;
|
||||||
novel.chapters = chapters;
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
|
||||||
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const body = await fetchApi(chapterUrl).then((res) => res.text());
|
||||||
const body = await fetchApi(chapterUrl).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const chapterText = loadedCheerio("div.txt").html() || "";
|
||||||
const chapterText = loadedCheerio("div.txt").html() || "";
|
return chapterText;
|
||||||
return chapterText;
|
}
|
||||||
}
|
|
||||||
|
async searchNovels(
|
||||||
async searchNovels(
|
searchkey: string,
|
||||||
searchkey: string,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const body = await fetchApi(this.site + "/search/", {
|
||||||
const body = await fetchApi(this.site + "/search/", {
|
method: "POST",
|
||||||
method: "POST",
|
body: JSON.stringify({ searchkey }),
|
||||||
body: JSON.stringify({ searchkey }),
|
}).then((res) => res.text());
|
||||||
}).then((res) => res.text());
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
const novels: Plugin.NovelItem[] = loadedCheerio(".li-row > .li > .con")
|
||||||
const novels: Plugin.NovelItem[] = loadedCheerio(".li-row > .li > .con")
|
.map((index, element) => ({
|
||||||
.map((index, element) => ({
|
name: loadedCheerio(element).find(".tit").text(),
|
||||||
name: loadedCheerio(element).find(".tit").text(),
|
cover: loadedCheerio(element).find(".pic > a > img").attr("data-cfsrc"),
|
||||||
cover: loadedCheerio(element).find(".pic > a > img").attr("data-cfsrc"),
|
url: this.site + loadedCheerio(element).find("h3 > a").attr("href"),
|
||||||
url: this.site + loadedCheerio(element).find("h3 > a").attr("href"),
|
}))
|
||||||
}))
|
.get();
|
||||||
.get();
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
fetchImage = fetchFile;
|
||||||
fetchImage = fetchFile;
|
}
|
||||||
}
|
|
||||||
|
export default new FreeWebNovel();
|
||||||
export default new FreeWebNovel();
|
|
||||||
|
|||||||
+415
-428
@@ -1,428 +1,415 @@
|
|||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
|
|
||||||
class NobleMTL implements Plugin.PluginBase {
|
class NobleMTL implements Plugin.PluginBase {
|
||||||
id = "noblemtl";
|
id = "noblemtl";
|
||||||
name = "NobleMTL";
|
name = "NobleMTL";
|
||||||
icon = "src/en/noblemtl/icon.png";
|
icon = "src/en/noblemtl/icon.png";
|
||||||
site = "https://noblemtl.com/";
|
site = "https://noblemtl.com/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let link = `${this.site}series/?page=${pageNo}`;
|
||||||
let link = `${this.site}series/?page=${pageNo}`;
|
|
||||||
|
if (filters.genres.value.length)
|
||||||
if (filters.genres.value.length)
|
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
||||||
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
|
||||||
|
if (filters.type.value.length)
|
||||||
if (filters.type.value.length)
|
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
||||||
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
|
||||||
|
link += "&status=" + filters.status.value;
|
||||||
link += "&status=" + filters.status.value;
|
|
||||||
|
link += "&order=" + filters.order.value;
|
||||||
link += "&order=" + filters.order.value;
|
|
||||||
|
const headers = new Headers();
|
||||||
const headers = new Headers();
|
const body = await fetchApi(link, { headers }).then((result) =>
|
||||||
if (this.cookieString) {
|
result.text()
|
||||||
headers.append("cookie", this.cookieString);
|
);
|
||||||
}
|
|
||||||
const body = await fetchApi(link, { headers }).then((result) =>
|
const loadedCheerio = parseHTML(body);
|
||||||
result.text()
|
|
||||||
);
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
const novels: Plugin.NovelItem[] = [];
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
loadedCheerio("article.bs").each(function () {
|
|
||||||
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
let image = loadedCheerio(this).find("img");
|
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
if (!novelUrl) return;
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
const novel = {
|
};
|
||||||
name: novelName,
|
|
||||||
cover: novelCover,
|
novels.push(novel);
|
||||||
url: novelUrl,
|
});
|
||||||
};
|
|
||||||
|
return novels;
|
||||||
novels.push(novel);
|
}
|
||||||
});
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
return novels;
|
const url = novelUrl;
|
||||||
}
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await result.text();
|
||||||
const url = novelUrl;
|
|
||||||
const headers = new Headers();
|
let loadedCheerio = parseHTML(body);
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
const novel: Plugin.SourceNovel = {
|
||||||
}
|
url,
|
||||||
const result = await fetchApi(url, { headers });
|
chapters: [],
|
||||||
const body = await result.text();
|
};
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
novel.name = loadedCheerio(".entry-title").text();
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
novel.cover =
|
||||||
url,
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
chapters: [],
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
};
|
|
||||||
|
loadedCheerio("div.spe > span").each(function () {
|
||||||
novel.name = loadedCheerio(".entry-title").text();
|
const detailName = loadedCheerio(this).find("b").text().trim();
|
||||||
|
const detail = loadedCheerio(this)
|
||||||
novel.cover =
|
.find("b")
|
||||||
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
.remove()
|
||||||
loadedCheerio("img.wp-post-image").attr("src");
|
.end()
|
||||||
|
.text()
|
||||||
loadedCheerio("div.spe > span").each(function () {
|
.trim();
|
||||||
const detailName = loadedCheerio(this).find("b").text().trim();
|
|
||||||
const detail = loadedCheerio(this)
|
switch (detailName) {
|
||||||
.find("b")
|
case "Author:":
|
||||||
.remove()
|
novel.author = detail;
|
||||||
.end()
|
break;
|
||||||
.text()
|
case "Status:":
|
||||||
.trim();
|
novel.status = detail;
|
||||||
|
break;
|
||||||
switch (detailName) {
|
}
|
||||||
case "Author:":
|
});
|
||||||
novel.author = detail;
|
|
||||||
break;
|
novel.genres = loadedCheerio(".genxed")
|
||||||
case "Status:":
|
.text()
|
||||||
novel.status = detail;
|
.trim()
|
||||||
break;
|
.replace(/\s/g, ",");
|
||||||
}
|
|
||||||
});
|
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
||||||
|
novel.summary = loadedCheerio('div[itemprop="description"]')
|
||||||
novel.genres = loadedCheerio(".genxed")
|
.find("br")
|
||||||
.text()
|
.replaceWith("\n")
|
||||||
.trim()
|
.end()
|
||||||
.replace(/\s/g, ",");
|
.text();
|
||||||
|
|
||||||
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
let chapter: Plugin.ChapterItem[] = [];
|
||||||
novel.summary = loadedCheerio('div[itemprop="description"]')
|
|
||||||
.find("br")
|
loadedCheerio(".eplister")
|
||||||
.replaceWith("\n")
|
.find("li")
|
||||||
.end()
|
.each(function () {
|
||||||
.text();
|
const chapterName =
|
||||||
|
loadedCheerio(this).find(".epl-num").text() +
|
||||||
let chapter: Plugin.ChapterItem[] = [];
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
loadedCheerio(".eplister")
|
|
||||||
.find("li")
|
const releaseDate = loadedCheerio(this)
|
||||||
.each(function () {
|
.find(".epl-date")
|
||||||
const chapterName =
|
.text()
|
||||||
loadedCheerio(this).find(".epl-num").text() +
|
.trim();
|
||||||
" - " +
|
|
||||||
loadedCheerio(this).find(".epl-title").text();
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
|
||||||
const releaseDate = loadedCheerio(this)
|
if (!chapterUrl) return;
|
||||||
.find(".epl-date")
|
|
||||||
.text()
|
chapter.push({
|
||||||
.trim();
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
url: chapterUrl,
|
||||||
|
});
|
||||||
if (!chapterUrl) return;
|
});
|
||||||
|
|
||||||
chapter.push({
|
novel.chapters = chapter.reverse();
|
||||||
name: chapterName,
|
|
||||||
releaseTime: releaseDate,
|
return novel;
|
||||||
url: chapterUrl,
|
}
|
||||||
});
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
});
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(chapterUrl, { headers });
|
||||||
novel.chapters = chapter.reverse();
|
const body = await result.text();
|
||||||
|
|
||||||
return novel;
|
const loadedCheerio = parseHTML(body);
|
||||||
}
|
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
let chapterText = loadedCheerio(".epcontent").html() || "";
|
||||||
const headers = new Headers();
|
|
||||||
if (this.cookieString) {
|
return chapterText;
|
||||||
headers.append("cookie", this.cookieString);
|
}
|
||||||
}
|
|
||||||
const result = await fetchApi(chapterUrl, { headers });
|
async searchNovels(
|
||||||
const body = await result.text();
|
searchTerm: string,
|
||||||
|
pageNo?: number | undefined
|
||||||
const loadedCheerio = parseHTML(body);
|
): Promise<Plugin.NovelItem[]> {
|
||||||
|
const url = `${this.site}?s=${searchTerm}`;
|
||||||
let chapterText = loadedCheerio(".epcontent").html() || "";
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
return chapterText;
|
const body = await result.text();
|
||||||
}
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
async searchNovels(
|
|
||||||
searchTerm: string,
|
const novels: Plugin.NovelItem[] = [];
|
||||||
pageNo?: number | undefined
|
|
||||||
): Promise<Plugin.NovelItem[]> {
|
loadedCheerio("article.bs").each(function () {
|
||||||
const url = `${this.site}?s=${searchTerm}`;
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
const headers = new Headers();
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
if (this.cookieString) {
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
headers.append("cookie", this.cookieString);
|
if (!novelUrl) return;
|
||||||
}
|
|
||||||
const result = await fetchApi(url, { headers });
|
novels.push({
|
||||||
const body = await result.text();
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
const loadedCheerio = parseHTML(body);
|
cover: novelCover,
|
||||||
|
});
|
||||||
const novels: Plugin.NovelItem[] = [];
|
});
|
||||||
|
|
||||||
loadedCheerio("article.bs").each(function () {
|
return novels;
|
||||||
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
}
|
||||||
const novelCover = loadedCheerio(this).find("img").attr("src");
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
return await fetchFile(url);
|
||||||
if (!novelUrl) return;
|
}
|
||||||
|
|
||||||
novels.push({
|
filters = {
|
||||||
name: novelName,
|
order: {
|
||||||
url: novelUrl,
|
label: "Sort By",
|
||||||
cover: novelCover,
|
type: FilterTypes.Picker,
|
||||||
});
|
options: [
|
||||||
});
|
{ label: "Default", value: "" },
|
||||||
|
|
||||||
return novels;
|
{ label: "A-Z", value: "title" },
|
||||||
}
|
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
return await fetchFile(url);
|
|
||||||
}
|
{ label: "Latest Update", value: "update" },
|
||||||
|
|
||||||
filters = {
|
{ label: "Latest Added", value: "latest" },
|
||||||
order: {
|
|
||||||
label: "Sort By",
|
{ label: "Popular", value: "popular" },
|
||||||
type: FilterTypes.Picker,
|
],
|
||||||
options: [
|
value: "",
|
||||||
{ label: "Default", value: "" },
|
},
|
||||||
|
|
||||||
{ label: "A-Z", value: "title" },
|
status: {
|
||||||
|
label: "Status",
|
||||||
{ label: "Z-A", value: "titlereverse" },
|
options: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
{ label: "Latest Update", value: "update" },
|
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
{ label: "Latest Added", value: "latest" },
|
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
{ label: "Popular", value: "popular" },
|
|
||||||
],
|
{ label: "Completed", value: "completed" },
|
||||||
value: "",
|
],
|
||||||
},
|
type: FilterTypes.Picker,
|
||||||
|
value: "",
|
||||||
status: {
|
},
|
||||||
label: "Status",
|
type: {
|
||||||
options: [
|
label: "Type",
|
||||||
{ label: "All", value: "" },
|
options: [
|
||||||
|
{ label: "Chinese novel", value: "chinese-novel" },
|
||||||
{ label: "Ongoing", value: "ongoing" },
|
|
||||||
|
{ label: "habyeol", value: "habyeol" },
|
||||||
{ label: "Hiatus", value: "hiatus" },
|
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
{ label: "Completed", value: "completed" },
|
|
||||||
],
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
type: FilterTypes.Picker,
|
|
||||||
value: "",
|
{ label: "삼심", value: "%ec%82%bc%ec%8b%ac" },
|
||||||
},
|
|
||||||
type: {
|
{ label: "호곡", value: "%ed%98%b8%ea%b3%a1" },
|
||||||
label: "Type",
|
],
|
||||||
options: [
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Chinese novel", value: "chinese-novel" },
|
value: [],
|
||||||
|
},
|
||||||
{ label: "habyeol", value: "habyeol" },
|
genres: {
|
||||||
|
label: "Genres",
|
||||||
{ label: "korean novel", value: "korean-novel" },
|
value: [],
|
||||||
|
options: [
|
||||||
{ label: "Web Novel", value: "web-novel" },
|
{ label: "A.I", value: "a.i" },
|
||||||
|
|
||||||
{ label: "삼심", value: "%ec%82%bc%ec%8b%ac" },
|
{ label: "Academy", value: "academy" },
|
||||||
|
|
||||||
{ label: "호곡", value: "%ed%98%b8%ea%b3%a1" },
|
{ label: "Action", value: "action" },
|
||||||
],
|
|
||||||
type: FilterTypes.CheckboxGroup,
|
{ label: "Adult", value: "adult" },
|
||||||
value: [],
|
|
||||||
},
|
{ label: "Adventure", value: "adventure" },
|
||||||
genres: {
|
|
||||||
label: "Genres",
|
{ label: "Alternative History", value: "alternative-history" },
|
||||||
value: [],
|
|
||||||
options: [
|
{ label: "Another World", value: "another-world" },
|
||||||
{ label: "A.I", value: "a.i" },
|
|
||||||
|
{ label: "Apocalypse", value: "apocalypse" },
|
||||||
{ label: "Academy", value: "academy" },
|
|
||||||
|
{ label: "Bromance", value: "bromance" },
|
||||||
{ label: "Action", value: "action" },
|
|
||||||
|
{ label: "Comedy", value: "comedy" },
|
||||||
{ label: "Adult", value: "adult" },
|
|
||||||
|
{ label: "Dark fantasy", value: "dark-fantasy" },
|
||||||
{ label: "Adventure", value: "adventure" },
|
|
||||||
|
{ label: "Demons", value: "demons" },
|
||||||
{ label: "Alternative History", value: "alternative-history" },
|
|
||||||
|
{ label: "Drama", value: "drama" },
|
||||||
{ label: "Another World", value: "another-world" },
|
|
||||||
|
{ label: "Dystopia", value: "dystopia" },
|
||||||
{ label: "Apocalypse", value: "apocalypse" },
|
|
||||||
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
{ label: "Bromance", value: "bromance" },
|
|
||||||
|
{ label: "Entertainment", value: "entertainment" },
|
||||||
{ label: "Comedy", value: "comedy" },
|
|
||||||
|
{ label: "Exhaustion", value: "exhaustion" },
|
||||||
{ label: "Dark fantasy", value: "dark-fantasy" },
|
|
||||||
|
{ label: "Fanfiction", value: "fanfiction" },
|
||||||
{ label: "Demons", value: "demons" },
|
|
||||||
|
{ label: "fantasy", value: "fantasy" },
|
||||||
{ label: "Drama", value: "drama" },
|
|
||||||
|
{ label: "finance", value: "finance" },
|
||||||
{ label: "Dystopia", value: "dystopia" },
|
|
||||||
|
{ label: "Full color", value: "full-color" },
|
||||||
{ label: "Ecchi", value: "ecchi" },
|
|
||||||
|
{ label: "Game", value: "game" },
|
||||||
{ label: "Entertainment", value: "entertainment" },
|
|
||||||
|
{ label: "Gender Bender", value: "gender-bender" },
|
||||||
{ label: "Exhaustion", value: "exhaustion" },
|
|
||||||
|
{ label: "Genius", value: "genius" },
|
||||||
{ label: "Fanfiction", value: "fanfiction" },
|
|
||||||
|
{ label: "Harem", value: "harem" },
|
||||||
{ label: "fantasy", value: "fantasy" },
|
|
||||||
|
{ label: "Hero", value: "hero" },
|
||||||
{ label: "finance", value: "finance" },
|
|
||||||
|
{ label: "Historical", value: "historical" },
|
||||||
{ label: "Full color", value: "full-color" },
|
|
||||||
|
{ label: "Hunter", value: "hunter" },
|
||||||
{ label: "Game", value: "game" },
|
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
{ label: "Gender Bender", value: "gender-bender" },
|
|
||||||
|
{ label: "Light Novel", value: "light-novel" },
|
||||||
{ label: "Genius", value: "genius" },
|
|
||||||
|
{
|
||||||
{ label: "Harem", value: "harem" },
|
label: "List Adventure Manga Genres",
|
||||||
|
value: "list-adventure-manga-genres",
|
||||||
{ label: "Hero", value: "hero" },
|
},
|
||||||
|
|
||||||
{ label: "Historical", value: "historical" },
|
{ label: "Long Strip", value: "long-strip" },
|
||||||
|
|
||||||
{ label: "Hunter", value: "hunter" },
|
{ label: "Love comedy", value: "love-comedy" },
|
||||||
|
|
||||||
{ label: "korean novel", value: "korean-novel" },
|
{ label: "magic", value: "magic" },
|
||||||
|
|
||||||
{ label: "Light Novel", value: "light-novel" },
|
{ label: "Manhua", value: "manhua" },
|
||||||
|
|
||||||
{
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
label: "List Adventure Manga Genres",
|
|
||||||
value: "list-adventure-manga-genres",
|
{ label: "Mature", value: "mature" },
|
||||||
},
|
|
||||||
|
{ label: "Medieval", value: "medieval" },
|
||||||
{ label: "Long Strip", value: "long-strip" },
|
|
||||||
|
{ label: "Misunderstanding", value: "misunderstanding" },
|
||||||
{ label: "Love comedy", value: "love-comedy" },
|
|
||||||
|
{ label: "Modern", value: "modern" },
|
||||||
{ label: "magic", value: "magic" },
|
|
||||||
|
{ label: "modern fantasy", value: "modern-fantasy" },
|
||||||
{ label: "Manhua", value: "manhua" },
|
|
||||||
|
{ label: "music", value: "music" },
|
||||||
{ label: "Martial Arts", value: "martial-arts" },
|
|
||||||
|
{ label: "Mystery", value: "mystery" },
|
||||||
{ label: "Mature", value: "mature" },
|
|
||||||
|
{ label: "Necromancy", value: "necromancy" },
|
||||||
{ label: "Medieval", value: "medieval" },
|
|
||||||
|
{ label: "No Romance", value: "no-romance" },
|
||||||
{ label: "Misunderstanding", value: "misunderstanding" },
|
|
||||||
|
{ label: "NTL", value: "ntl" },
|
||||||
{ label: "Modern", value: "modern" },
|
|
||||||
|
{ label: "o", value: "o" },
|
||||||
{ label: "modern fantasy", value: "modern-fantasy" },
|
|
||||||
|
{ label: "Obsession", value: "obsession" },
|
||||||
{ label: "music", value: "music" },
|
|
||||||
|
{ label: "Politics", value: "politics" },
|
||||||
{ label: "Mystery", value: "mystery" },
|
|
||||||
|
{ label: "Possession", value: "possession" },
|
||||||
{ label: "Necromancy", value: "necromancy" },
|
|
||||||
|
{ label: "Programming", value: "programming" },
|
||||||
{ label: "No Romance", value: "no-romance" },
|
|
||||||
|
{ label: "Psychological", value: "psychological" },
|
||||||
{ label: "NTL", value: "ntl" },
|
|
||||||
|
{ label: "Pure Love", value: "pure-love" },
|
||||||
{ label: "o", value: "o" },
|
|
||||||
|
{ label: "Redemption", value: "redemption" },
|
||||||
{ label: "Obsession", value: "obsession" },
|
|
||||||
|
{ label: "Regression", value: "regression" },
|
||||||
{ label: "Politics", value: "politics" },
|
|
||||||
|
{ label: "Regret", value: "regret" },
|
||||||
{ label: "Possession", value: "possession" },
|
|
||||||
|
{ label: "Reincarnation", value: "reincarnation" },
|
||||||
{ label: "Programming", value: "programming" },
|
|
||||||
|
{ label: "Revenge", value: "revenge" },
|
||||||
{ label: "Psychological", value: "psychological" },
|
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
{ label: "Pure Love", value: "pure-love" },
|
|
||||||
|
{ label: "Romance Fanrasy", value: "romance-fanrasy" },
|
||||||
{ label: "Redemption", value: "redemption" },
|
|
||||||
|
{ label: "Salvation", value: "salvation" },
|
||||||
{ label: "Regression", value: "regression" },
|
|
||||||
|
{ label: "School Life", value: "school-life" },
|
||||||
{ label: "Regret", value: "regret" },
|
|
||||||
|
{ label: "Sci-fi", value: "sci-fi" },
|
||||||
{ label: "Reincarnation", value: "reincarnation" },
|
|
||||||
|
{ label: "Science fiction", value: "science-fiction" },
|
||||||
{ label: "Revenge", value: "revenge" },
|
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
{ label: "Romance", value: "romance" },
|
|
||||||
|
{ label: "Shounen", value: "shounen" },
|
||||||
{ label: "Romance Fanrasy", value: "romance-fanrasy" },
|
|
||||||
|
{ label: "Slice of Life", value: "slice-of-life" },
|
||||||
{ label: "Salvation", value: "salvation" },
|
|
||||||
|
{ label: "Soft yandere", value: "soft-yandere" },
|
||||||
{ label: "School Life", value: "school-life" },
|
|
||||||
|
{ label: "Sports", value: "sports" },
|
||||||
{ label: "Sci-fi", value: "sci-fi" },
|
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
{ label: "Science fiction", value: "science-fiction" },
|
|
||||||
|
{ label: "Survival", value: "survival" },
|
||||||
{ label: "Seinen", value: "seinen" },
|
|
||||||
|
{ label: "system", value: "system" },
|
||||||
{ label: "Shounen", value: "shounen" },
|
|
||||||
|
{ label: "Time limit", value: "time-limit" },
|
||||||
{ label: "Slice of Life", value: "slice-of-life" },
|
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
{ label: "Soft yandere", value: "soft-yandere" },
|
|
||||||
|
{ label: "Transmigration", value: "transmigration" },
|
||||||
{ label: "Sports", value: "sports" },
|
|
||||||
|
{ label: "TS", value: "ts" },
|
||||||
{ label: "Supernatural", value: "supernatural" },
|
|
||||||
|
{ label: "Tsundere", value: "tsundere" },
|
||||||
{ label: "Survival", value: "survival" },
|
|
||||||
|
{ label: "Unique", value: "unique" },
|
||||||
{ label: "system", value: "system" },
|
|
||||||
|
{ label: "Wholesome", value: "wholesome" },
|
||||||
{ label: "Time limit", value: "time-limit" },
|
|
||||||
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
{ label: "Tragedy", value: "tragedy" },
|
|
||||||
|
{ label: "Xuanhuan", value: "xuanhuan" },
|
||||||
{ label: "Transmigration", value: "transmigration" },
|
|
||||||
|
{ label: "Yandere", value: "yandere" },
|
||||||
{ label: "TS", value: "ts" },
|
|
||||||
|
{ label: "Yuri", value: "yuri" },
|
||||||
{ label: "Tsundere", value: "tsundere" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Unique", value: "unique" },
|
},
|
||||||
|
} satisfies Filters;
|
||||||
{ label: "Wholesome", value: "wholesome" },
|
}
|
||||||
|
|
||||||
{ label: "Wuxia", value: "wuxia" },
|
const Noble = new NobleMTL();
|
||||||
|
|
||||||
{ label: "Xuanhuan", value: "xuanhuan" },
|
export default new NobleMTL();
|
||||||
|
|
||||||
{ label: "Yandere", value: "yandere" },
|
|
||||||
|
|
||||||
{ label: "Yuri", value: "yuri" },
|
|
||||||
],
|
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
|
||||||
} satisfies Filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Noble = new NobleMTL();
|
|
||||||
|
|
||||||
export default new NobleMTL();
|
|
||||||
|
|||||||
+267
-280
@@ -1,280 +1,267 @@
|
|||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
|
|
||||||
class PandaMTL implements Plugin.PluginBase {
|
class PandaMTL implements Plugin.PluginBase {
|
||||||
id = "pandamtl";
|
id = "pandamtl";
|
||||||
name = "PandaMTL";
|
name = "PandaMTL";
|
||||||
icon = "src/en/wordpress/icon.png";
|
icon = "src/en/wordpress/icon.png";
|
||||||
site = "https://pandamtl.com/";
|
site = "https://pandamtl.com/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let link = `${this.site}series/?page=${pageNo}`;
|
||||||
let link = `${this.site}series/?page=${pageNo}`;
|
|
||||||
|
if (filters.genres.value.length) {
|
||||||
if (filters.genres.value.length) {
|
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
||||||
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
}
|
||||||
}
|
|
||||||
|
if (filters.type.value.length)
|
||||||
if (filters.type.value.length)
|
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
||||||
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
|
||||||
|
link += "&status=" + (filters?.status ? filters.status : "");
|
||||||
link += "&status=" + (filters?.status ? filters.status : "");
|
|
||||||
|
link += "&order=" + (filters?.order ? filters.order : "popular");
|
||||||
link += "&order=" + (filters?.order ? filters.order : "popular");
|
|
||||||
|
const headers = new Headers();
|
||||||
const headers = new Headers();
|
const body = await fetchApi(link, { headers }).then((result) =>
|
||||||
if (this.cookieString) {
|
result.text()
|
||||||
headers.append("cookie", this.cookieString);
|
);
|
||||||
}
|
|
||||||
const body = await fetchApi(link, { headers }).then((result) =>
|
const loadedCheerio = parseHTML(body);
|
||||||
result.text()
|
|
||||||
);
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
loadedCheerio("article.maindet").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
const novels: Plugin.NovelItem[] = [];
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
loadedCheerio("article.maindet").each(function () {
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
const novelName = loadedCheerio(this).find("h2").text();
|
|
||||||
let image = loadedCheerio(this).find("img");
|
if (!novelUrl) return;
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
|
||||||
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
if (!novelUrl) return;
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
const novel = {
|
};
|
||||||
name: novelName,
|
|
||||||
cover: novelCover,
|
novels.push(novel);
|
||||||
url: novelUrl,
|
});
|
||||||
};
|
|
||||||
|
return novels;
|
||||||
novels.push(novel);
|
}
|
||||||
});
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
|
const url = novelUrl;
|
||||||
return novels;
|
const headers = new Headers();
|
||||||
}
|
const result = await fetchApi(url, { headers });
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await result.text();
|
||||||
const url = novelUrl;
|
|
||||||
const headers = new Headers();
|
let loadedCheerio = parseHTML(body);
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
const novel: Plugin.SourceNovel = {
|
||||||
}
|
url,
|
||||||
const result = await fetchApi(url, { headers });
|
chapters: [],
|
||||||
const body = await result.text();
|
};
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
novel.name = loadedCheerio("h1.entry-title").text();
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
novel.cover =
|
||||||
url,
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
chapters: [],
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
};
|
|
||||||
|
loadedCheerio(".serl:nth-child(3) > span").each(function () {
|
||||||
novel.name = loadedCheerio("h1.entry-title").text();
|
const detailName = loadedCheerio(this).text().trim();
|
||||||
|
const detail = loadedCheerio(this).next().text().trim();
|
||||||
novel.cover =
|
|
||||||
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
switch (detailName) {
|
||||||
loadedCheerio("img.wp-post-image").attr("src");
|
case "Author":
|
||||||
|
novel.author = detail;
|
||||||
loadedCheerio(".serl:nth-child(3) > span").each(function () {
|
break;
|
||||||
const detailName = loadedCheerio(this).text().trim();
|
}
|
||||||
const detail = loadedCheerio(this).next().text().trim();
|
});
|
||||||
|
|
||||||
switch (detailName) {
|
novel.status = loadedCheerio(".sertostat > span").attr("class");
|
||||||
case "Author":
|
|
||||||
novel.author = detail;
|
novel.genres = loadedCheerio(".sertogenre")
|
||||||
break;
|
.children("a")
|
||||||
}
|
.map((i, el) => loadedCheerio(el).text())
|
||||||
});
|
.toArray()
|
||||||
|
.join(",");
|
||||||
novel.status = loadedCheerio(".sertostat > span").attr("class");
|
|
||||||
|
novel.summary = loadedCheerio(".sersys")
|
||||||
novel.genres = loadedCheerio(".sertogenre")
|
.find("br")
|
||||||
.children("a")
|
.replaceWith("\n")
|
||||||
.map((i, el) => loadedCheerio(el).text())
|
.end()
|
||||||
.toArray()
|
.text();
|
||||||
.join(",");
|
|
||||||
|
let chapter: Plugin.ChapterItem[] = [];
|
||||||
novel.summary = loadedCheerio(".sersys")
|
|
||||||
.find("br")
|
loadedCheerio(".eplister")
|
||||||
.replaceWith("\n")
|
.find("li")
|
||||||
.end()
|
.each(function () {
|
||||||
.text();
|
const chapterName =
|
||||||
|
loadedCheerio(this).find(".epl-num").text() +
|
||||||
let chapter: Plugin.ChapterItem[] = [];
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
loadedCheerio(".eplister")
|
|
||||||
.find("li")
|
const releaseDate = loadedCheerio(this)
|
||||||
.each(function () {
|
.find(".epl-date")
|
||||||
const chapterName =
|
.text()
|
||||||
loadedCheerio(this).find(".epl-num").text() +
|
.trim();
|
||||||
" - " +
|
|
||||||
loadedCheerio(this).find(".epl-title").text();
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
|
||||||
const releaseDate = loadedCheerio(this)
|
if (!chapterUrl) return;
|
||||||
.find(".epl-date")
|
|
||||||
.text()
|
chapter.push({
|
||||||
.trim();
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
url: chapterUrl,
|
||||||
|
});
|
||||||
if (!chapterUrl) return;
|
});
|
||||||
|
|
||||||
chapter.push({
|
novel.chapters = chapter.reverse();
|
||||||
name: chapterName,
|
|
||||||
releaseTime: releaseDate,
|
return novel;
|
||||||
url: chapterUrl,
|
}
|
||||||
});
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
});
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(chapterUrl, { headers });
|
||||||
novel.chapters = chapter.reverse();
|
const body = await result.text();
|
||||||
|
|
||||||
return novel;
|
const loadedCheerio = parseHTML(body);
|
||||||
}
|
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
let chapterText = loadedCheerio(".epcontent").html() || "";
|
||||||
const headers = new Headers();
|
|
||||||
if (this.cookieString) {
|
return chapterText;
|
||||||
headers.append("cookie", this.cookieString);
|
}
|
||||||
}
|
async searchNovels(
|
||||||
const result = await fetchApi(chapterUrl, { headers });
|
searchTerm: string,
|
||||||
const body = await result.text();
|
pageNo?: number | undefined
|
||||||
|
): Promise<Plugin.NovelItem[]> {
|
||||||
const loadedCheerio = parseHTML(body);
|
const url = `${this.site}?s=${searchTerm}`;
|
||||||
|
const headers = new Headers();
|
||||||
let chapterText = loadedCheerio(".epcontent").html() || "";
|
const result = await fetchApi(url, { headers });
|
||||||
|
const body = await result.text();
|
||||||
return chapterText;
|
|
||||||
}
|
const loadedCheerio = parseHTML(body);
|
||||||
async searchNovels(
|
|
||||||
searchTerm: string,
|
const novels: Plugin.NovelItem[] = [];
|
||||||
pageNo?: number | undefined
|
|
||||||
): Promise<Plugin.NovelItem[]> {
|
loadedCheerio("article.maindet").each(function () {
|
||||||
const url = `${this.site}?s=${searchTerm}`;
|
const novelName = loadedCheerio(this).find("h2").text();
|
||||||
const headers = new Headers();
|
let image = loadedCheerio(this).find("img");
|
||||||
if (this.cookieString) {
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
headers.append("cookie", this.cookieString);
|
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
||||||
}
|
|
||||||
const result = await fetchApi(url, { headers });
|
if (!novelUrl) return;
|
||||||
const body = await result.text();
|
|
||||||
|
novels.push({
|
||||||
const loadedCheerio = parseHTML(body);
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
const novels: Plugin.NovelItem[] = [];
|
cover: novelCover,
|
||||||
|
});
|
||||||
loadedCheerio("article.maindet").each(function () {
|
});
|
||||||
const novelName = loadedCheerio(this).find("h2").text();
|
|
||||||
let image = loadedCheerio(this).find("img");
|
return novels;
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
}
|
||||||
const novelUrl = loadedCheerio(this).find("h2 a").attr("href");
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
|
return await fetchFile(url);
|
||||||
if (!novelUrl) return;
|
}
|
||||||
|
|
||||||
novels.push({
|
filters = {
|
||||||
name: novelName,
|
order: {
|
||||||
url: novelUrl,
|
label: "Sort By",
|
||||||
cover: novelCover,
|
value: "",
|
||||||
});
|
options: [
|
||||||
});
|
{ label: "Default", value: "" },
|
||||||
|
|
||||||
return novels;
|
{ label: "A-Z", value: "title" },
|
||||||
}
|
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
return await fetchFile(url);
|
|
||||||
}
|
{ label: "Latest Update", value: "update" },
|
||||||
|
|
||||||
filters = {
|
{ label: "Latest Added", value: "latest" },
|
||||||
order: {
|
|
||||||
label: "Sort By",
|
{ label: "Popular", value: "popular" },
|
||||||
value: "",
|
],
|
||||||
options: [
|
type: FilterTypes.Picker,
|
||||||
{ label: "Default", value: "" },
|
},
|
||||||
|
status: {
|
||||||
{ label: "A-Z", value: "title" },
|
label: "Status",
|
||||||
|
value: "",
|
||||||
{ label: "Z-A", value: "titlereverse" },
|
options: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
{ label: "Latest Update", value: "update" },
|
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
{ label: "Latest Added", value: "latest" },
|
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
{ label: "Popular", value: "popular" },
|
|
||||||
],
|
{ label: "Completed", value: "completed" },
|
||||||
type: FilterTypes.Picker,
|
],
|
||||||
},
|
type: FilterTypes.Picker,
|
||||||
status: {
|
},
|
||||||
label: "Status",
|
type: {
|
||||||
value: "",
|
value: [],
|
||||||
options: [
|
label: "Type",
|
||||||
{ label: "All", value: "" },
|
options: [
|
||||||
|
{ label: "Light Novel (KR)", value: "light-novel-kr" },
|
||||||
{ label: "Ongoing", value: "ongoing" },
|
|
||||||
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
{ label: "Hiatus", value: "hiatus" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Completed", value: "completed" },
|
},
|
||||||
],
|
genres: {
|
||||||
type: FilterTypes.Picker,
|
label: "Genres",
|
||||||
},
|
value: [],
|
||||||
type: {
|
options: [
|
||||||
value: [],
|
{ label: "Action", value: "action" },
|
||||||
label: "Type",
|
|
||||||
options: [
|
{ label: "Adult", value: "adult" },
|
||||||
{ label: "Light Novel (KR)", value: "light-novel-kr" },
|
|
||||||
|
{ label: "Adventure", value: "adventure" },
|
||||||
{ label: "Web Novel", value: "web-novel" },
|
|
||||||
],
|
{ label: "Comedy", value: "comedy" },
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
genres: {
|
|
||||||
label: "Genres",
|
{ label: "Fantasy", value: "fantasy" },
|
||||||
value: [],
|
|
||||||
options: [
|
{ label: "Harem", value: "harem" },
|
||||||
{ label: "Action", value: "action" },
|
|
||||||
|
{ label: "Josei", value: "josei" },
|
||||||
{ label: "Adult", value: "adult" },
|
|
||||||
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
{ label: "Adventure", value: "adventure" },
|
|
||||||
|
{ label: "Mature", value: "mature" },
|
||||||
{ label: "Comedy", value: "comedy" },
|
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
{ label: "Ecchi", value: "ecchi" },
|
|
||||||
|
{ label: "School Life", value: "school-life" },
|
||||||
{ label: "Fantasy", value: "fantasy" },
|
|
||||||
|
{ label: "Sci-fi", value: "sci-fi" },
|
||||||
{ label: "Harem", value: "harem" },
|
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
{ label: "Josei", value: "josei" },
|
|
||||||
|
{ label: "Slice of Life", value: "slice-of-life" },
|
||||||
{ label: "Martial Arts", value: "martial-arts" },
|
|
||||||
|
{ label: "Smut", value: "smut" },
|
||||||
{ label: "Mature", value: "mature" },
|
|
||||||
|
{ label: "Sports", value: "sports" },
|
||||||
{ label: "Romance", value: "romance" },
|
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
{ label: "School Life", value: "school-life" },
|
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
{ label: "Sci-fi", value: "sci-fi" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Seinen", value: "seinen" },
|
},
|
||||||
|
} satisfies Filters;
|
||||||
{ label: "Slice of Life", value: "slice-of-life" },
|
}
|
||||||
|
|
||||||
{ label: "Smut", value: "smut" },
|
export default new PandaMTL();
|
||||||
|
|
||||||
{ label: "Sports", value: "sports" },
|
|
||||||
|
|
||||||
{ label: "Supernatural", value: "supernatural" },
|
|
||||||
|
|
||||||
{ label: "Tragedy", value: "tragedy" },
|
|
||||||
],
|
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
|
||||||
} satisfies Filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new PandaMTL();
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class ChireadsPlugin implements Plugin.PluginBase {
|
|||||||
site: string;
|
site: string;
|
||||||
version: string;
|
version: string;
|
||||||
userAgent: string;
|
userAgent: string;
|
||||||
cookieString: string;
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.id = "chireads.com";
|
this.id = "chireads.com";
|
||||||
this.name = "Chireads";
|
this.name = "Chireads";
|
||||||
@@ -17,7 +17,6 @@ class ChireadsPlugin implements Plugin.PluginBase {
|
|||||||
this.site = "https://chireads.com";
|
this.site = "https://chireads.com";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36";
|
this.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36";
|
||||||
this.cookieString = "''";
|
|
||||||
}
|
}
|
||||||
parseNovels(loadedCheerio: CheerioAPI) {
|
parseNovels(loadedCheerio: CheerioAPI) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class NovelDeGlacePlugin implements Plugin.PluginBase{
|
|||||||
site: string;
|
site: string;
|
||||||
version: string;
|
version: string;
|
||||||
userAgent: string;
|
userAgent: string;
|
||||||
cookieString: string;
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.id = "NDG.com";
|
this.id = "NDG.com";
|
||||||
this.name = "NovelDeGlace";
|
this.name = "NovelDeGlace";
|
||||||
@@ -18,7 +18,6 @@ class NovelDeGlacePlugin implements Plugin.PluginBase{
|
|||||||
this.site = "https://noveldeglace.com/";
|
this.site = "https://noveldeglace.com/";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "''";
|
this.userAgent = "''";
|
||||||
this.cookieString = "''";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async popularNovels(page: number): Promise<Plugin.NovelItem[]> {
|
async popularNovels(page: number): Promise<Plugin.NovelItem[]> {
|
||||||
|
|||||||
@@ -1,426 +1,413 @@
|
|||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
|
|
||||||
class LightNovelBrasil implements Plugin.PluginBase {
|
class LightNovelBrasil implements Plugin.PluginBase {
|
||||||
id = "lightnovelbrasil";
|
id = "lightnovelbrasil";
|
||||||
name = "Light Novel Brasil";
|
name = "Light Novel Brasil";
|
||||||
icon = "multisrc/wpmangastream/icons/lightnovelbrasil.png";
|
icon = "multisrc/wpmangastream/icons/lightnovelbrasil.png";
|
||||||
site = "https://lightnovelbrasil.com/";
|
site = "https://lightnovelbrasil.com/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let link = `${this.site}series/?page=${pageNo}`;
|
||||||
let link = `${this.site}series/?page=${pageNo}`;
|
|
||||||
|
if (filters.genres.value.length)
|
||||||
if (filters.genres.value.length)
|
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
||||||
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
|
||||||
|
if (filters.type.value.length)
|
||||||
if (filters.type.value.length)
|
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
||||||
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
|
||||||
|
link += "&status=" + (filters?.status ? filters.status : "");
|
||||||
link += "&status=" + (filters?.status ? filters.status : "");
|
|
||||||
|
link += "&order=" + (filters?.order ? filters.order : "popular");
|
||||||
link += "&order=" + (filters?.order ? filters.order : "popular");
|
|
||||||
|
const headers = new Headers();
|
||||||
const headers = new Headers();
|
const body = await fetchApi(link, { headers }).then((result) =>
|
||||||
if (this.cookieString) {
|
result.text()
|
||||||
headers.append("cookie", this.cookieString);
|
);
|
||||||
}
|
|
||||||
const body = await fetchApi(link, { headers }).then((result) =>
|
const loadedCheerio = parseHTML(body);
|
||||||
result.text()
|
|
||||||
);
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
const novels: Plugin.NovelItem[] = [];
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
loadedCheerio("article.bs").each(function () {
|
|
||||||
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
let image = loadedCheerio(this).find("img");
|
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
if (!novelUrl) return;
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
const novel = {
|
};
|
||||||
name: novelName,
|
|
||||||
cover: novelCover,
|
novels.push(novel);
|
||||||
url: novelUrl,
|
});
|
||||||
};
|
|
||||||
|
return novels;
|
||||||
novels.push(novel);
|
}
|
||||||
});
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
return novels;
|
const url = novelUrl;
|
||||||
}
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await result.text();
|
||||||
const url = novelUrl;
|
|
||||||
const headers = new Headers();
|
let loadedCheerio = parseHTML(body);
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
const novel: Plugin.SourceNovel = {
|
||||||
}
|
url,
|
||||||
const result = await fetchApi(url, { headers });
|
chapters: [],
|
||||||
const body = await result.text();
|
};
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
novel.name = loadedCheerio(".entry-title").text();
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
novel.cover =
|
||||||
url,
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
chapters: [],
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
};
|
|
||||||
|
loadedCheerio("div.spe > span").each(function () {
|
||||||
novel.name = loadedCheerio(".entry-title").text();
|
const detailName = loadedCheerio(this).find("b").text().trim();
|
||||||
|
const detail = loadedCheerio(this)
|
||||||
novel.cover =
|
.find("b")
|
||||||
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
.remove()
|
||||||
loadedCheerio("img.wp-post-image").attr("src");
|
.end()
|
||||||
|
.text()
|
||||||
loadedCheerio("div.spe > span").each(function () {
|
.trim();
|
||||||
const detailName = loadedCheerio(this).find("b").text().trim();
|
|
||||||
const detail = loadedCheerio(this)
|
switch (detailName) {
|
||||||
.find("b")
|
case "Autor:":
|
||||||
.remove()
|
case "Author:":
|
||||||
.end()
|
novel.author = detail;
|
||||||
.text()
|
break;
|
||||||
.trim();
|
case "Status:":
|
||||||
|
novel.status = detail;
|
||||||
switch (detailName) {
|
break;
|
||||||
case "Autor:":
|
}
|
||||||
case "Author:":
|
});
|
||||||
novel.author = detail;
|
|
||||||
break;
|
novel.genres = loadedCheerio(".genxed")
|
||||||
case "Status:":
|
.text()
|
||||||
novel.status = detail;
|
.trim()
|
||||||
break;
|
.replace(/\s/g, ",");
|
||||||
}
|
|
||||||
});
|
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
||||||
|
novel.summary = loadedCheerio('div[itemprop="description"]')
|
||||||
novel.genres = loadedCheerio(".genxed")
|
.find("br")
|
||||||
.text()
|
.replaceWith("\n")
|
||||||
.trim()
|
.end()
|
||||||
.replace(/\s/g, ",");
|
.text();
|
||||||
|
|
||||||
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
let chapter: Plugin.ChapterItem[] = [];
|
||||||
novel.summary = loadedCheerio('div[itemprop="description"]')
|
|
||||||
.find("br")
|
loadedCheerio(".eplister")
|
||||||
.replaceWith("\n")
|
.find("li")
|
||||||
.end()
|
.each(function () {
|
||||||
.text();
|
const chapterName =
|
||||||
|
loadedCheerio(this).find(".epl-num").text() +
|
||||||
let chapter: Plugin.ChapterItem[] = [];
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
loadedCheerio(".eplister")
|
|
||||||
.find("li")
|
const releaseDate = loadedCheerio(this)
|
||||||
.each(function () {
|
.find(".epl-date")
|
||||||
const chapterName =
|
.text()
|
||||||
loadedCheerio(this).find(".epl-num").text() +
|
.trim();
|
||||||
" - " +
|
|
||||||
loadedCheerio(this).find(".epl-title").text();
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
|
||||||
const releaseDate = loadedCheerio(this)
|
if (!chapterUrl) return;
|
||||||
.find(".epl-date")
|
|
||||||
.text()
|
chapter.push({
|
||||||
.trim();
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
url: chapterUrl,
|
||||||
|
});
|
||||||
if (!chapterUrl) return;
|
});
|
||||||
|
|
||||||
chapter.push({
|
novel.chapters = chapter.reverse();
|
||||||
name: chapterName,
|
|
||||||
releaseTime: releaseDate,
|
return novel;
|
||||||
url: chapterUrl,
|
}
|
||||||
});
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
});
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(chapterUrl, { headers });
|
||||||
novel.chapters = chapter.reverse();
|
const body = await result.text();
|
||||||
|
|
||||||
return novel;
|
const loadedCheerio = parseHTML(body);
|
||||||
}
|
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
let chapterText = loadedCheerio(".epcontent").html() || "";
|
||||||
const headers = new Headers();
|
|
||||||
if (this.cookieString) {
|
return chapterText;
|
||||||
headers.append("cookie", this.cookieString);
|
}
|
||||||
}
|
|
||||||
const result = await fetchApi(chapterUrl, { headers });
|
async searchNovels(
|
||||||
const body = await result.text();
|
searchTerm: string,
|
||||||
|
pageNo?: number | undefined
|
||||||
const loadedCheerio = parseHTML(body);
|
): Promise<Plugin.NovelItem[]> {
|
||||||
|
const url = `${this.site}?s=${searchTerm}`;
|
||||||
let chapterText = loadedCheerio(".epcontent").html() || "";
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
return chapterText;
|
const body = await result.text();
|
||||||
}
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
async searchNovels(
|
|
||||||
searchTerm: string,
|
const novels: Plugin.NovelItem[] = [];
|
||||||
pageNo?: number | undefined
|
|
||||||
): Promise<Plugin.NovelItem[]> {
|
loadedCheerio("article.bs").each(function () {
|
||||||
const url = `${this.site}?s=${searchTerm}`;
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
const headers = new Headers();
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
if (this.cookieString) {
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
headers.append("cookie", this.cookieString);
|
if (!novelUrl) return;
|
||||||
}
|
|
||||||
const result = await fetchApi(url, { headers });
|
novels.push({
|
||||||
const body = await result.text();
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
const loadedCheerio = parseHTML(body);
|
cover: novelCover,
|
||||||
|
});
|
||||||
const novels: Plugin.NovelItem[] = [];
|
});
|
||||||
|
|
||||||
loadedCheerio("article.bs").each(function () {
|
return novels;
|
||||||
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
}
|
||||||
const novelCover = loadedCheerio(this).find("img").attr("src");
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
return await fetchFile(url);
|
||||||
if (!novelUrl) return;
|
}
|
||||||
|
|
||||||
novels.push({
|
filters = {
|
||||||
name: novelName,
|
order: {
|
||||||
url: novelUrl,
|
label: "Sort By",
|
||||||
cover: novelCover,
|
value: "",
|
||||||
});
|
options: [
|
||||||
});
|
{ label: "Default", value: "" },
|
||||||
|
|
||||||
return novels;
|
{ label: "A-Z", value: "title" },
|
||||||
}
|
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
return await fetchFile(url);
|
|
||||||
}
|
{ label: "Latest Update", value: "update" },
|
||||||
|
|
||||||
filters = {
|
{ label: "Latest Added", value: "latest" },
|
||||||
order: {
|
|
||||||
label: "Sort By",
|
{ label: "Popular", value: "popular" },
|
||||||
value: "",
|
],
|
||||||
options: [
|
type: FilterTypes.Picker,
|
||||||
{ label: "Default", value: "" },
|
},
|
||||||
|
status: {
|
||||||
{ label: "A-Z", value: "title" },
|
label: "Status",
|
||||||
|
value: "",
|
||||||
{ label: "Z-A", value: "titlereverse" },
|
options: [
|
||||||
|
{ label: "All", value: "" },
|
||||||
{ label: "Latest Update", value: "update" },
|
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
{ label: "Latest Added", value: "latest" },
|
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
{ label: "Popular", value: "popular" },
|
|
||||||
],
|
{ label: "Completed", value: "completed" },
|
||||||
type: FilterTypes.Picker,
|
],
|
||||||
},
|
type: FilterTypes.Picker,
|
||||||
status: {
|
},
|
||||||
label: "Status",
|
type: {
|
||||||
value: "",
|
label: "Type",
|
||||||
options: [
|
value: [],
|
||||||
{ label: "All", value: "" },
|
options: [
|
||||||
|
{ label: "Chinese novel", value: "chinese-novel" },
|
||||||
{ label: "Ongoing", value: "ongoing" },
|
|
||||||
|
{ label: "habyeol", value: "habyeol" },
|
||||||
{ label: "Hiatus", value: "hiatus" },
|
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
{ label: "Completed", value: "completed" },
|
|
||||||
],
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
type: FilterTypes.Picker,
|
|
||||||
},
|
{ label: "삼심", value: "%ec%82%bc%ec%8b%ac" },
|
||||||
type: {
|
|
||||||
label: "Type",
|
{ label: "호곡", value: "%ed%98%b8%ea%b3%a1" },
|
||||||
value: [],
|
],
|
||||||
options: [
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Chinese novel", value: "chinese-novel" },
|
},
|
||||||
|
genres: {
|
||||||
{ label: "habyeol", value: "habyeol" },
|
value: [],
|
||||||
|
label: "Genres",
|
||||||
{ label: "korean novel", value: "korean-novel" },
|
options: [
|
||||||
|
{ label: "A.I", value: "a.i" },
|
||||||
{ label: "Web Novel", value: "web-novel" },
|
|
||||||
|
{ label: "Academy", value: "academy" },
|
||||||
{ label: "삼심", value: "%ec%82%bc%ec%8b%ac" },
|
|
||||||
|
{ label: "Action", value: "action" },
|
||||||
{ label: "호곡", value: "%ed%98%b8%ea%b3%a1" },
|
|
||||||
],
|
{ label: "Adult", value: "adult" },
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
{ label: "Adventure", value: "adventure" },
|
||||||
genres: {
|
|
||||||
value: [],
|
{ label: "Alternative History", value: "alternative-history" },
|
||||||
label: "Genres",
|
|
||||||
options: [
|
{ label: "Another World", value: "another-world" },
|
||||||
{ label: "A.I", value: "a.i" },
|
|
||||||
|
{ label: "Apocalypse", value: "apocalypse" },
|
||||||
{ label: "Academy", value: "academy" },
|
|
||||||
|
{ label: "Bromance", value: "bromance" },
|
||||||
{ label: "Action", value: "action" },
|
|
||||||
|
{ label: "Comedy", value: "comedy" },
|
||||||
{ label: "Adult", value: "adult" },
|
|
||||||
|
{ label: "Dark fantasy", value: "dark-fantasy" },
|
||||||
{ label: "Adventure", value: "adventure" },
|
|
||||||
|
{ label: "Demons", value: "demons" },
|
||||||
{ label: "Alternative History", value: "alternative-history" },
|
|
||||||
|
{ label: "Drama", value: "drama" },
|
||||||
{ label: "Another World", value: "another-world" },
|
|
||||||
|
{ label: "Dystopia", value: "dystopia" },
|
||||||
{ label: "Apocalypse", value: "apocalypse" },
|
|
||||||
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
{ label: "Bromance", value: "bromance" },
|
|
||||||
|
{ label: "Entertainment", value: "entertainment" },
|
||||||
{ label: "Comedy", value: "comedy" },
|
|
||||||
|
{ label: "Exhaustion", value: "exhaustion" },
|
||||||
{ label: "Dark fantasy", value: "dark-fantasy" },
|
|
||||||
|
{ label: "Fanfiction", value: "fanfiction" },
|
||||||
{ label: "Demons", value: "demons" },
|
|
||||||
|
{ label: "fantasy", value: "fantasy" },
|
||||||
{ label: "Drama", value: "drama" },
|
|
||||||
|
{ label: "finance", value: "finance" },
|
||||||
{ label: "Dystopia", value: "dystopia" },
|
|
||||||
|
{ label: "Full color", value: "full-color" },
|
||||||
{ label: "Ecchi", value: "ecchi" },
|
|
||||||
|
{ label: "Game", value: "game" },
|
||||||
{ label: "Entertainment", value: "entertainment" },
|
|
||||||
|
{ label: "Gender Bender", value: "gender-bender" },
|
||||||
{ label: "Exhaustion", value: "exhaustion" },
|
|
||||||
|
{ label: "Genius", value: "genius" },
|
||||||
{ label: "Fanfiction", value: "fanfiction" },
|
|
||||||
|
{ label: "Harem", value: "harem" },
|
||||||
{ label: "fantasy", value: "fantasy" },
|
|
||||||
|
{ label: "Hero", value: "hero" },
|
||||||
{ label: "finance", value: "finance" },
|
|
||||||
|
{ label: "Historical", value: "historical" },
|
||||||
{ label: "Full color", value: "full-color" },
|
|
||||||
|
{ label: "Hunter", value: "hunter" },
|
||||||
{ label: "Game", value: "game" },
|
|
||||||
|
{ label: "korean novel", value: "korean-novel" },
|
||||||
{ label: "Gender Bender", value: "gender-bender" },
|
|
||||||
|
{ label: "Light Novel", value: "light-novel" },
|
||||||
{ label: "Genius", value: "genius" },
|
|
||||||
|
{
|
||||||
{ label: "Harem", value: "harem" },
|
label: "List Adventure Manga Genres",
|
||||||
|
value: "list-adventure-manga-genres",
|
||||||
{ label: "Hero", value: "hero" },
|
},
|
||||||
|
|
||||||
{ label: "Historical", value: "historical" },
|
{ label: "Long Strip", value: "long-strip" },
|
||||||
|
|
||||||
{ label: "Hunter", value: "hunter" },
|
{ label: "Love comedy", value: "love-comedy" },
|
||||||
|
|
||||||
{ label: "korean novel", value: "korean-novel" },
|
{ label: "magic", value: "magic" },
|
||||||
|
|
||||||
{ label: "Light Novel", value: "light-novel" },
|
{ label: "Manhua", value: "manhua" },
|
||||||
|
|
||||||
{
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
label: "List Adventure Manga Genres",
|
|
||||||
value: "list-adventure-manga-genres",
|
{ label: "Mature", value: "mature" },
|
||||||
},
|
|
||||||
|
{ label: "Medieval", value: "medieval" },
|
||||||
{ label: "Long Strip", value: "long-strip" },
|
|
||||||
|
{ label: "Misunderstanding", value: "misunderstanding" },
|
||||||
{ label: "Love comedy", value: "love-comedy" },
|
|
||||||
|
{ label: "Modern", value: "modern" },
|
||||||
{ label: "magic", value: "magic" },
|
|
||||||
|
{ label: "modern fantasy", value: "modern-fantasy" },
|
||||||
{ label: "Manhua", value: "manhua" },
|
|
||||||
|
{ label: "music", value: "music" },
|
||||||
{ label: "Martial Arts", value: "martial-arts" },
|
|
||||||
|
{ label: "Mystery", value: "mystery" },
|
||||||
{ label: "Mature", value: "mature" },
|
|
||||||
|
{ label: "Necromancy", value: "necromancy" },
|
||||||
{ label: "Medieval", value: "medieval" },
|
|
||||||
|
{ label: "No Romance", value: "no-romance" },
|
||||||
{ label: "Misunderstanding", value: "misunderstanding" },
|
|
||||||
|
{ label: "NTL", value: "ntl" },
|
||||||
{ label: "Modern", value: "modern" },
|
|
||||||
|
{ label: "o", value: "o" },
|
||||||
{ label: "modern fantasy", value: "modern-fantasy" },
|
|
||||||
|
{ label: "Obsession", value: "obsession" },
|
||||||
{ label: "music", value: "music" },
|
|
||||||
|
{ label: "Politics", value: "politics" },
|
||||||
{ label: "Mystery", value: "mystery" },
|
|
||||||
|
{ label: "Possession", value: "possession" },
|
||||||
{ label: "Necromancy", value: "necromancy" },
|
|
||||||
|
{ label: "Programming", value: "programming" },
|
||||||
{ label: "No Romance", value: "no-romance" },
|
|
||||||
|
{ label: "Psychological", value: "psychological" },
|
||||||
{ label: "NTL", value: "ntl" },
|
|
||||||
|
{ label: "Pure Love", value: "pure-love" },
|
||||||
{ label: "o", value: "o" },
|
|
||||||
|
{ label: "Redemption", value: "redemption" },
|
||||||
{ label: "Obsession", value: "obsession" },
|
|
||||||
|
{ label: "Regression", value: "regression" },
|
||||||
{ label: "Politics", value: "politics" },
|
|
||||||
|
{ label: "Regret", value: "regret" },
|
||||||
{ label: "Possession", value: "possession" },
|
|
||||||
|
{ label: "Reincarnation", value: "reincarnation" },
|
||||||
{ label: "Programming", value: "programming" },
|
|
||||||
|
{ label: "Revenge", value: "revenge" },
|
||||||
{ label: "Psychological", value: "psychological" },
|
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
{ label: "Pure Love", value: "pure-love" },
|
|
||||||
|
{ label: "Romance Fanrasy", value: "romance-fanrasy" },
|
||||||
{ label: "Redemption", value: "redemption" },
|
|
||||||
|
{ label: "Salvation", value: "salvation" },
|
||||||
{ label: "Regression", value: "regression" },
|
|
||||||
|
{ label: "School Life", value: "school-life" },
|
||||||
{ label: "Regret", value: "regret" },
|
|
||||||
|
{ label: "Sci-fi", value: "sci-fi" },
|
||||||
{ label: "Reincarnation", value: "reincarnation" },
|
|
||||||
|
{ label: "Science fiction", value: "science-fiction" },
|
||||||
{ label: "Revenge", value: "revenge" },
|
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
{ label: "Romance", value: "romance" },
|
|
||||||
|
{ label: "Shounen", value: "shounen" },
|
||||||
{ label: "Romance Fanrasy", value: "romance-fanrasy" },
|
|
||||||
|
{ label: "Slice of Life", value: "slice-of-life" },
|
||||||
{ label: "Salvation", value: "salvation" },
|
|
||||||
|
{ label: "Soft yandere", value: "soft-yandere" },
|
||||||
{ label: "School Life", value: "school-life" },
|
|
||||||
|
{ label: "Sports", value: "sports" },
|
||||||
{ label: "Sci-fi", value: "sci-fi" },
|
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
{ label: "Science fiction", value: "science-fiction" },
|
|
||||||
|
{ label: "Survival", value: "survival" },
|
||||||
{ label: "Seinen", value: "seinen" },
|
|
||||||
|
{ label: "system", value: "system" },
|
||||||
{ label: "Shounen", value: "shounen" },
|
|
||||||
|
{ label: "Time limit", value: "time-limit" },
|
||||||
{ label: "Slice of Life", value: "slice-of-life" },
|
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
{ label: "Soft yandere", value: "soft-yandere" },
|
|
||||||
|
{ label: "Transmigration", value: "transmigration" },
|
||||||
{ label: "Sports", value: "sports" },
|
|
||||||
|
{ label: "TS", value: "ts" },
|
||||||
{ label: "Supernatural", value: "supernatural" },
|
|
||||||
|
{ label: "Tsundere", value: "tsundere" },
|
||||||
{ label: "Survival", value: "survival" },
|
|
||||||
|
{ label: "Unique", value: "unique" },
|
||||||
{ label: "system", value: "system" },
|
|
||||||
|
{ label: "Wholesome", value: "wholesome" },
|
||||||
{ label: "Time limit", value: "time-limit" },
|
|
||||||
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
{ label: "Tragedy", value: "tragedy" },
|
|
||||||
|
{ label: "Xuanhuan", value: "xuanhuan" },
|
||||||
{ label: "Transmigration", value: "transmigration" },
|
|
||||||
|
{ label: "Yandere", value: "yandere" },
|
||||||
{ label: "TS", value: "ts" },
|
|
||||||
|
{ label: "Yuri", value: "yuri" },
|
||||||
{ label: "Tsundere", value: "tsundere" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Unique", value: "unique" },
|
},
|
||||||
|
} satisfies Filters;
|
||||||
{ label: "Wholesome", value: "wholesome" },
|
}
|
||||||
|
|
||||||
{ label: "Wuxia", value: "wuxia" },
|
export default new LightNovelBrasil();
|
||||||
|
|
||||||
{ label: "Xuanhuan", value: "xuanhuan" },
|
|
||||||
|
|
||||||
{ label: "Yandere", value: "yandere" },
|
|
||||||
|
|
||||||
{ label: "Yuri", value: "yuri" },
|
|
||||||
],
|
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
|
||||||
} satisfies Filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new LightNovelBrasil();
|
|
||||||
|
|||||||
+241
-242
@@ -1,242 +1,241 @@
|
|||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
|
|
||||||
class freedlit implements Plugin.PluginBase {
|
class freedlit implements Plugin.PluginBase {
|
||||||
id = "freedlit.space";
|
id = "freedlit.space";
|
||||||
name = "LitSpace";
|
name = "LitSpace";
|
||||||
site = "https://freedlit.space";
|
site = "https://freedlit.space";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
icon = "src/ru/freedlit/icon.png";
|
icon = "src/ru/freedlit/icon.png";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
page: number,
|
||||||
page: number,
|
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions<typeof this.filters>,
|
||||||
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions<typeof this.filters>,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let url = this.site + "/get-books/all/list/" + page + "?sort=";
|
||||||
let url = this.site + "/get-books/all/list/" + page + "?sort=";
|
url += showLatestNovels ? "recent" : filters?.sort?.value || "popular";
|
||||||
url += showLatestNovels ? "recent" : filters?.sort?.value || "popular";
|
url += "&status=" + (filters?.status?.value || "all");
|
||||||
url += "&status=" + (filters?.status?.value || "all");
|
url += "&access=" + (filters?.access?.value || "all");
|
||||||
url += "&access=" + (filters?.access?.value || "all");
|
url += "&adult=" + (filters?.adult?.value || "hide");
|
||||||
url += "&adult=" + (filters?.adult?.value || "hide");
|
|
||||||
|
if (filters?.genre?.value?.include?.length) {
|
||||||
if (filters?.genre?.value?.include?.length) {
|
url += filters.genre.value.include
|
||||||
url += filters.genre.value.include
|
.map(id => '&genres_included[]=' + id).join("");
|
||||||
.map(id => '&genres_included[]=' + id).join("");
|
}
|
||||||
}
|
|
||||||
|
if (filters?.genre?.value?.exclude?.length) {
|
||||||
if (filters?.genre?.value?.exclude?.length) {
|
url += filters.genre.value.exclude
|
||||||
url += filters.genre.value.exclude
|
.map(id => '&genres_excluded[]=' + id).join("");
|
||||||
.map(id => '&genres_excluded[]=' + id).join("");
|
}
|
||||||
}
|
|
||||||
|
const body = await fetchApi(url).then((res) => res.text());
|
||||||
const body = await fetchApi(url).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
loadedCheerio("#bookListBlock > div > div").each(function () {
|
||||||
loadedCheerio("#bookListBlock > div > div").each(function () {
|
const name = loadedCheerio(this).find("div > h4 > a").text()?.trim();
|
||||||
const name = loadedCheerio(this).find("div > h4 > a").text()?.trim();
|
const cover = loadedCheerio(this)
|
||||||
const cover = loadedCheerio(this)
|
.find("div > a > img")
|
||||||
.find("div > a > img")
|
.attr("src")
|
||||||
.attr("src")
|
?.trim();
|
||||||
?.trim();
|
const url = loadedCheerio(this).find("div > h4 > a").attr("href")?.trim();
|
||||||
const url = loadedCheerio(this).find("div > h4 > a").attr("href")?.trim();
|
if (!name || !url) return;
|
||||||
if (!name || !url) return;
|
|
||||||
|
novels.push({ name, cover, url });
|
||||||
novels.push({ name, cover, url });
|
});
|
||||||
});
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await fetchApi(novelUrl).then((res) => res.text());
|
||||||
const body = await fetchApi(novelUrl).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novel: Plugin.SourceNovel = {
|
||||||
const novel: Plugin.SourceNovel = {
|
url: novelUrl,
|
||||||
url: novelUrl,
|
name: loadedCheerio(".book-info h4").text(),
|
||||||
name: loadedCheerio(".book-info h4").text(),
|
cover: loadedCheerio(".book-cover > div > img").attr("src")?.trim(),
|
||||||
cover: loadedCheerio(".book-cover > div > img").attr("src")?.trim(),
|
summary: loadedCheerio("#nav-home").text()?.trim(),
|
||||||
summary: loadedCheerio("#nav-home").text()?.trim(),
|
author: loadedCheerio(".book-info h5 > a").text(),
|
||||||
author: loadedCheerio(".book-info h5 > a").text(),
|
genres: loadedCheerio(".genre-list > a")
|
||||||
genres: loadedCheerio(".genre-list > a")
|
.map((index, element) => loadedCheerio(element).text())
|
||||||
.map((index, element) => loadedCheerio(element).text())
|
.get()
|
||||||
.get()
|
.join(","),
|
||||||
.join(","),
|
};
|
||||||
};
|
|
||||||
|
const chapters: Plugin.ChapterItem[] = [];
|
||||||
const chapters: Plugin.ChapterItem[] = [];
|
|
||||||
|
loadedCheerio("a.chapter-line").each(function () {
|
||||||
loadedCheerio("a.chapter-line").each(function () {
|
const name = loadedCheerio(this).find("h6").text();
|
||||||
const name = loadedCheerio(this).find("h6").text();
|
const releaseTime = loadedCheerio(this).find('span[class="date"]').text();
|
||||||
const releaseTime = loadedCheerio(this).find('span[class="date"]').text();
|
const url = loadedCheerio(this).attr("href");
|
||||||
const url = loadedCheerio(this).attr("href");
|
if (!name || !url) return;
|
||||||
if (!name || !url) return;
|
|
||||||
|
chapters.push({ name, releaseTime, url });
|
||||||
chapters.push({ name, releaseTime, url });
|
});
|
||||||
});
|
|
||||||
|
novel.chapters = chapters;
|
||||||
novel.chapters = chapters;
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
|
||||||
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const body = await fetchApi(chapterUrl).then((res) => res.text());
|
||||||
const body = await fetchApi(chapterUrl).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
loadedCheerio("div.mobile-block").remove();
|
||||||
loadedCheerio("div.mobile-block").remove();
|
loadedCheerio("div.standart-block").remove();
|
||||||
loadedCheerio("div.standart-block").remove();
|
|
||||||
|
const chapterText = loadedCheerio('div[class="chapter"]').html() || "";
|
||||||
const chapterText = loadedCheerio('div[class="chapter"]').html() || "";
|
return chapterText;
|
||||||
return chapterText;
|
}
|
||||||
}
|
|
||||||
|
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {
|
||||||
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {
|
const url = `${this.site}/search?query=${searchTerm}&type=all`;
|
||||||
const url = `${this.site}/search?query=${searchTerm}&type=all`;
|
const body = await fetchApi(url).then((res) => res.text());
|
||||||
const body = await fetchApi(url).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
loadedCheerio("#bookListBlock > div").each(function () {
|
||||||
loadedCheerio("#bookListBlock > div").each(function () {
|
const name = loadedCheerio(this).find("h4 > a").text()?.trim();
|
||||||
const name = loadedCheerio(this).find("h4 > a").text()?.trim();
|
const cover = loadedCheerio(this).find("a > img").attr("src")?.trim();
|
||||||
const cover = loadedCheerio(this).find("a > img").attr("src")?.trim();
|
const url = loadedCheerio(this).find("h4 > a").attr("href")?.trim();
|
||||||
const url = loadedCheerio(this).find("h4 > a").attr("href")?.trim();
|
if (!name || !url) return;
|
||||||
if (!name || !url) return;
|
|
||||||
|
novels.push({ name, cover, url });
|
||||||
novels.push({ name, cover, url });
|
});
|
||||||
});
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
fetchImage = fetchFile;
|
||||||
fetchImage = fetchFile;
|
|
||||||
|
filters = {
|
||||||
filters = {
|
sort: {
|
||||||
sort: {
|
label: "Сортировка:",
|
||||||
label: "Сортировка:",
|
value: "",
|
||||||
value: "",
|
options: [
|
||||||
options: [
|
{ label: "По популярности", value: "popular" },
|
||||||
{ label: "По популярности", value: "popular" },
|
{ label: "По количеству комментариев", value: "comments" },
|
||||||
{ label: "По количеству комментариев", value: "comments" },
|
{ label: "По количеству лайков", value: "likes" },
|
||||||
{ label: "По количеству лайков", value: "likes" },
|
{ label: "По новизне", value: "recent" },
|
||||||
{ label: "По новизне", value: "recent" },
|
{ label: "По просмотрам", value: "views" },
|
||||||
{ label: "По просмотрам", value: "views" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
genre: {
|
||||||
genre: {
|
label: "Жанры:",
|
||||||
label: "Жанры:",
|
value: { include: [], exclude: [] },
|
||||||
value: { include: [], exclude: [] },
|
options: [
|
||||||
options: [
|
{ label: "Любой жанр", value: "all" },
|
||||||
{ label: "Любой жанр", value: "all" },
|
{ label: "Альтернативная история", value: "alternative-history" },
|
||||||
{ label: "Альтернативная история", value: "alternative-history" },
|
{ label: "Антиутопия", value: "dystopia" },
|
||||||
{ label: "Антиутопия", value: "dystopia" },
|
{ label: "Бизнес-литература", value: "business-literature" },
|
||||||
{ label: "Бизнес-литература", value: "business-literature" },
|
{ label: "Боевая фантастика", value: "combat-fiction" },
|
||||||
{ label: "Боевая фантастика", value: "combat-fiction" },
|
{ label: "Боевик", value: "action" },
|
||||||
{ label: "Боевик", value: "action" },
|
{ label: "Боевое фэнтези", value: "combat-fantasy" },
|
||||||
{ label: "Боевое фэнтези", value: "combat-fantasy" },
|
{ label: "Бояръ-Аниме", value: "boyar-anime" },
|
||||||
{ label: "Бояръ-Аниме", value: "boyar-anime" },
|
{ label: "Героическая фантастика", value: "heroic-fiction" },
|
||||||
{ label: "Героическая фантастика", value: "heroic-fiction" },
|
{ label: "Героическое фэнтези", value: "heroic-fantasy" },
|
||||||
{ label: "Героическое фэнтези", value: "heroic-fantasy" },
|
{ label: "Городское фэнтези", value: "urban-fantasy" },
|
||||||
{ label: "Городское фэнтези", value: "urban-fantasy" },
|
{ label: "Гримдарк", value: "grimdark" },
|
||||||
{ label: "Гримдарк", value: "grimdark" },
|
{ label: "Детектив", value: "mystery" },
|
||||||
{ label: "Детектив", value: "mystery" },
|
{ label: "Детская литература", value: "kids-literature" },
|
||||||
{ label: "Детская литература", value: "kids-literature" },
|
{ label: "Документальная проза", value: "biography" },
|
||||||
{ label: "Документальная проза", value: "biography" },
|
{ label: "Историческая проза", value: "historical-fiction" },
|
||||||
{ label: "Историческая проза", value: "historical-fiction" },
|
{ label: "Исторический детектив", value: "historical-mystery" },
|
||||||
{ label: "Исторический детектив", value: "historical-mystery" },
|
{ label: "Исторический любовный роман", value: "historical-romantic-novel" },
|
||||||
{ label: "Исторический любовный роман", value: "historical-romantic-novel" },
|
{ label: "Историческое фэнтези", value: "historical-fantasy" },
|
||||||
{ label: "Историческое фэнтези", value: "historical-fantasy" },
|
{ label: "Киберпанк", value: "cyberpunk" },
|
||||||
{ label: "Киберпанк", value: "cyberpunk" },
|
{ label: "Космическая фантастика", value: "cosmic-fiction" },
|
||||||
{ label: "Космическая фантастика", value: "cosmic-fiction" },
|
{ label: "ЛитРПГ", value: "litrpg" },
|
||||||
{ label: "ЛитРПГ", value: "litrpg" },
|
{ label: "Лоу / Низкое фэнтези", value: "low-fantasy" },
|
||||||
{ label: "Лоу / Низкое фэнтези", value: "low-fantasy" },
|
{ label: "Любовное фэнтези", value: "romantic-fantasy" },
|
||||||
{ label: "Любовное фэнтези", value: "romantic-fantasy" },
|
{ label: "Любовный роман", value: "romantic-novel" },
|
||||||
{ label: "Любовный роман", value: "romantic-novel" },
|
{ label: "Мистика", value: "mystic" },
|
||||||
{ label: "Мистика", value: "mystic" },
|
{ label: "Мистический детектив", value: "mystic-detective" },
|
||||||
{ label: "Мистический детектив", value: "mystic-detective" },
|
{ label: "Научная фантастика", value: "science-fiction" },
|
||||||
{ label: "Научная фантастика", value: "science-fiction" },
|
{ label: "Подростковая проза", value: "young-adult" },
|
||||||
{ label: "Подростковая проза", value: "young-adult" },
|
{ label: "Политический роман", value: "political-romance" },
|
||||||
{ label: "Политический роман", value: "political-romance" },
|
{ label: "Попаданцы", value: "accidental-travel" },
|
||||||
{ label: "Попаданцы", value: "accidental-travel" },
|
{ label: "Попаданцы в магические миры", value: "magic-worlds-travel" },
|
||||||
{ label: "Попаданцы в магические миры", value: "magic-worlds-travel" },
|
{ label: "Попаданцы во времени", value: "time-travel" },
|
||||||
{ label: "Попаданцы во времени", value: "time-travel" },
|
{ label: "Порнотика", value: "pornotica" },
|
||||||
{ label: "Порнотика", value: "pornotica" },
|
{ label: "Постапокалипсис", value: "post-apocalypse" },
|
||||||
{ label: "Постапокалипсис", value: "post-apocalypse" },
|
{ label: "Поэзия", value: "poetry" },
|
||||||
{ label: "Поэзия", value: "poetry" },
|
{ label: "Приключения", value: "adventure" },
|
||||||
{ label: "Приключения", value: "adventure" },
|
{ label: "Публицистика", value: "journalism" },
|
||||||
{ label: "Публицистика", value: "journalism" },
|
{ label: "Пьеса", value: "play" },
|
||||||
{ label: "Пьеса", value: "play" },
|
{ label: "Развитие личности", value: "how-to-book" },
|
||||||
{ label: "Развитие личности", value: "how-to-book" },
|
{ label: "Разное", value: "other" },
|
||||||
{ label: "Разное", value: "other" },
|
{ label: "Реализм", value: "Realism" },
|
||||||
{ label: "Реализм", value: "Realism" },
|
{ label: "РеалРПГ", value: "realrpg" },
|
||||||
{ label: "РеалРПГ", value: "realrpg" },
|
{ label: "Репликация", value: "replication" },
|
||||||
{ label: "Репликация", value: "replication" },
|
{ label: "Романтическая эротика", value: "romantic-erotic-fiction" },
|
||||||
{ label: "Романтическая эротика", value: "romantic-erotic-fiction" },
|
{ label: "Сказка", value: "fairy-tale" },
|
||||||
{ label: "Сказка", value: "fairy-tale" },
|
{ label: "Слэш", value: "slash" },
|
||||||
{ label: "Слэш", value: "slash" },
|
{ label: "Современная проза", value: "modern-prose" },
|
||||||
{ label: "Современная проза", value: "modern-prose" },
|
{ label: "Современный любовный роман", value: "modern-romantic-novel" },
|
||||||
{ label: "Современный любовный роман", value: "modern-romantic-novel" },
|
{ label: "Социальная фантастика", value: "social-fiction" },
|
||||||
{ label: "Социальная фантастика", value: "social-fiction" },
|
{ label: "Стимпанк", value: "steampunk" },
|
||||||
{ label: "Стимпанк", value: "steampunk" },
|
{ label: "Сценарий", value: "scenario" },
|
||||||
{ label: "Сценарий", value: "scenario" },
|
{ label: "Сюаньхуань", value: "xuanhuan" },
|
||||||
{ label: "Сюаньхуань", value: "xuanhuan" },
|
{ label: "Сянься", value: "xianxia" },
|
||||||
{ label: "Сянься", value: "xianxia" },
|
{ label: "Тёмное фэнтези", value: "dark-fantasy" },
|
||||||
{ label: "Тёмное фэнтези", value: "dark-fantasy" },
|
{ label: "Триллер", value: "thriller" },
|
||||||
{ label: "Триллер", value: "thriller" },
|
{ label: "Уся", value: "wuxia" },
|
||||||
{ label: "Уся", value: "wuxia" },
|
{ label: "Фантастика", value: "fiction" },
|
||||||
{ label: "Фантастика", value: "fiction" },
|
{ label: "Фантастический детектив", value: "mystery-fiction" },
|
||||||
{ label: "Фантастический детектив", value: "mystery-fiction" },
|
{ label: "Фанфик", value: "fan-fiction" },
|
||||||
{ label: "Фанфик", value: "fan-fiction" },
|
{ label: "Фемслэш", value: "femslash" },
|
||||||
{ label: "Фемслэш", value: "femslash" },
|
{ label: "Фэнтези", value: "fantasy" },
|
||||||
{ label: "Фэнтези", value: "fantasy" },
|
{ label: "Хоррор", value: "horror" },
|
||||||
{ label: "Хоррор", value: "horror" },
|
{ label: "Шпионский детектив", value: "spy-crime" },
|
||||||
{ label: "Шпионский детектив", value: "spy-crime" },
|
{ label: "Эпическое фэнтези", value: "epic-fantasy" },
|
||||||
{ label: "Эпическое фэнтези", value: "epic-fantasy" },
|
{ label: "Эротика", value: "erotic-fiction" },
|
||||||
{ label: "Эротика", value: "erotic-fiction" },
|
{ label: "Эротическая фантастика", value: "erotic-fiction" },
|
||||||
{ label: "Эротическая фантастика", value: "erotic-fiction" },
|
{ label: "Эротический фанфик", value: "erotic-fan-fiction" },
|
||||||
{ label: "Эротический фанфик", value: "erotic-fan-fiction" },
|
{ label: "Эротическое фэнтези", value: "erotic-fantasy" },
|
||||||
{ label: "Эротическое фэнтези", value: "erotic-fantasy" },
|
{ label: "Этническое фэнтези", value: "ethnic-fantasy" },
|
||||||
{ label: "Этническое фэнтези", value: "ethnic-fantasy" },
|
{ label: "Юмор", value: "humor" },
|
||||||
{ label: "Юмор", value: "humor" },
|
{ label: "Юмористическая фантастика", value: "humor-fiction" },
|
||||||
{ label: "Юмористическая фантастика", value: "humor-fiction" },
|
{ label: "Юмористическое фэнтези", value: "humor-fantasy" },
|
||||||
{ label: "Юмористическое фэнтези", value: "humor-fantasy" },
|
{ label: "RPS", value: "rps" },
|
||||||
{ label: "RPS", value: "rps" },
|
],
|
||||||
],
|
type: FilterTypes.ExcludableCheckboxGroup,
|
||||||
type: FilterTypes.ExcludableCheckboxGroup,
|
},
|
||||||
},
|
status: {
|
||||||
status: {
|
label: "Статус:",
|
||||||
label: "Статус:",
|
value: "",
|
||||||
value: "",
|
options: [
|
||||||
options: [
|
{ label: "Любой статус", value: "all" },
|
||||||
{ label: "Любой статус", value: "all" },
|
{ label: "В процессе", value: "in-process" },
|
||||||
{ label: "В процессе", value: "in-process" },
|
{ label: "Завершено", value: "finished" },
|
||||||
{ label: "Завершено", value: "finished" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
access: {
|
||||||
access: {
|
label: "Доступ:",
|
||||||
label: "Доступ:",
|
value: "",
|
||||||
value: "",
|
options: [
|
||||||
options: [
|
{ label: "Любой доступ", value: "all" },
|
||||||
{ label: "Любой доступ", value: "all" },
|
{ label: "Бесплатные", value: "free" },
|
||||||
{ label: "Бесплатные", value: "free" },
|
{ label: "Платные", value: "paid" },
|
||||||
{ label: "Платные", value: "paid" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
adult: {
|
||||||
adult: {
|
label: "Возрастные ограничения:",
|
||||||
label: "Возрастные ограничения:",
|
value: "",
|
||||||
value: "",
|
options: [
|
||||||
options: [
|
{ label: "Скрыть 18+", value: "hide" },
|
||||||
{ label: "Скрыть 18+", value: "hide" },
|
{ label: "Показать +18", value: "show" },
|
||||||
{ label: "Показать +18", value: "show" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
} satisfies Filters;
|
||||||
} satisfies Filters;
|
}
|
||||||
}
|
|
||||||
|
export default new freedlit();
|
||||||
export default new freedlit();
|
|
||||||
|
|||||||
+538
-539
File diff suppressed because it is too large
Load Diff
+258
-259
@@ -1,259 +1,258 @@
|
|||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
class Bookriver implements Plugin.PluginBase {
|
class Bookriver implements Plugin.PluginBase {
|
||||||
id = "bookriver";
|
id = "bookriver";
|
||||||
name = "Bookriver";
|
name = "Bookriver";
|
||||||
site = "https://bookriver.ru";
|
site = "https://bookriver.ru";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
icon = "src/ru/bookriver/icon.png";
|
icon = "src/ru/bookriver/icon.png";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions,
|
||||||
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let url = this.site + `/genre?page=${pageNo}&perPage=24&sortingType=`;
|
||||||
let url = this.site + `/genre?page=${pageNo}&perPage=24&sortingType=`;
|
url += showLatestNovels
|
||||||
url += showLatestNovels
|
? "last-update"
|
||||||
? "last-update"
|
: filters?.sort?.value || "bestseller";
|
||||||
: filters?.sort?.value || "bestseller";
|
|
||||||
|
if (filters?.genres?.value instanceof Array && filters?.genres?.value.length) {
|
||||||
if (filters?.genres?.value instanceof Array && filters?.genres?.value.length) {
|
url += "&g=" + filters.genres.value.join(",");
|
||||||
url += "&g=" + filters.genres.value.join(",");
|
}
|
||||||
}
|
|
||||||
|
const result = await fetchApi(url);
|
||||||
const result = await fetchApi(url);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
|
||||||
|
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
||||||
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
if (jsonRaw) {
|
||||||
if (jsonRaw) {
|
const json: response = JSON.parse(jsonRaw);
|
||||||
const json: response = JSON.parse(jsonRaw);
|
json.props.pageProps.state.pagesFilter?.genre?.books?.forEach((novel) =>
|
||||||
json.props.pageProps.state.pagesFilter?.genre?.books?.forEach((novel) =>
|
novels.push({
|
||||||
novels.push({
|
name: novel.name,
|
||||||
name: novel.name,
|
cover: novel.coverImages[0].url,
|
||||||
cover: novel.coverImages[0].url,
|
url: this.site + "/book/" + novel.slug,
|
||||||
url: this.site + "/book/" + novel.slug,
|
}),
|
||||||
}),
|
);
|
||||||
);
|
}
|
||||||
}
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const result = await fetchApi(novelUrl);
|
||||||
const result = await fetchApi(novelUrl);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
||||||
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
const json: response = JSON.parse(jsonRaw || "{}");
|
||||||
const json: response = JSON.parse(jsonRaw || "{}");
|
const book = json.props.pageProps.state.book?.bookPage;
|
||||||
const book = json.props.pageProps.state.book?.bookPage;
|
const novel: Plugin.SourceNovel = {
|
||||||
const novel: Plugin.SourceNovel = {
|
url: novelUrl,
|
||||||
url: novelUrl,
|
name: book?.name,
|
||||||
name: book?.name,
|
cover: book?.coverImages[0].url,
|
||||||
cover: book?.coverImages[0].url,
|
summary: book?.annotation,
|
||||||
summary: book?.annotation,
|
author: book?.author?.name,
|
||||||
author: book?.author?.name,
|
genres: book?.tags?.map((item) => item.name).join(", "),
|
||||||
genres: book?.tags?.map((item) => item.name).join(", "),
|
status:
|
||||||
status:
|
book?.statusComplete === "writing"
|
||||||
book?.statusComplete === "writing"
|
? NovelStatus.Ongoing
|
||||||
? NovelStatus.Ongoing
|
: NovelStatus.Completed,
|
||||||
: NovelStatus.Completed,
|
};
|
||||||
};
|
|
||||||
|
const chapters: Plugin.ChapterItem[] = [];
|
||||||
const chapters: Plugin.ChapterItem[] = [];
|
book?.ebook?.chapters?.forEach((chapter) => {
|
||||||
book?.ebook?.chapters?.forEach((chapter) => {
|
if (chapter.available) {
|
||||||
if (chapter.available) {
|
chapters.push({
|
||||||
chapters.push({
|
name: chapter.name,
|
||||||
name: chapter.name,
|
releaseTime: dayjs(
|
||||||
releaseTime: dayjs(
|
chapter?.firstPublishedAt || chapter.createdAt,
|
||||||
chapter?.firstPublishedAt || chapter.createdAt,
|
).format("LLL"),
|
||||||
).format("LLL"),
|
url: this.site + "/reader/" + book?.slug + "/" + chapter.chapterId,
|
||||||
url: this.site + "/reader/" + book?.slug + "/" + chapter.chapterId,
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
novel.chapters = chapters;
|
||||||
novel.chapters = chapters;
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
|
||||||
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const url = "https://api.bookriver.ru/api/v1/books/chapter/text/";
|
||||||
const url = "https://api.bookriver.ru/api/v1/books/chapter/text/";
|
const result = await fetchApi(url + chapterUrl.split("/").pop());
|
||||||
const result = await fetchApi(url + chapterUrl.split("/").pop());
|
const json = (await result.json()) as responseChapter;
|
||||||
const json = (await result.json()) as responseChapter;
|
|
||||||
|
let chapterText = json.data.content || "Конец произведения";
|
||||||
let chapterText = json.data.content || "Конец произведения";
|
if (json.data?.audio?.available) {
|
||||||
if (json.data?.audio?.available) {
|
chapterText += "\n" + json.data.audio.url;
|
||||||
chapterText += "\n" + json.data.audio.url;
|
}
|
||||||
}
|
|
||||||
|
return chapterText;
|
||||||
return chapterText;
|
}
|
||||||
}
|
|
||||||
|
async searchNovels(
|
||||||
async searchNovels(
|
searchTerm: string,
|
||||||
searchTerm: string,
|
pageNo: number | undefined = 1,
|
||||||
pageNo: number | undefined = 1,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const url = `https://api.bookriver.ru/api/v1/search/autocomplete?keyword=${searchTerm}&page=${pageNo}&perPage=10`;
|
||||||
const url = `https://api.bookriver.ru/api/v1/search/autocomplete?keyword=${searchTerm}&page=${pageNo}&perPage=10`;
|
const result = await fetchApi(url);
|
||||||
const result = await fetchApi(url);
|
const json = (await result.json()) as responseSearch;
|
||||||
const json = (await result.json()) as responseSearch;
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
json?.data?.books?.forEach((novel) =>
|
||||||
json?.data?.books?.forEach((novel) =>
|
novels.push({
|
||||||
novels.push({
|
name: novel.name,
|
||||||
name: novel.name,
|
cover: novel.coverImages[0].url,
|
||||||
cover: novel.coverImages[0].url,
|
url: this.site + "/book/" + novel.slug,
|
||||||
url: this.site + "/book/" + novel.slug,
|
}),
|
||||||
}),
|
);
|
||||||
);
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
fetchImage = fetchFile;
|
||||||
fetchImage = fetchFile;
|
|
||||||
|
filters = {
|
||||||
filters = {
|
sort: {
|
||||||
sort: {
|
label: "Сортировка",
|
||||||
label: "Сортировка",
|
value: "",
|
||||||
value: "",
|
options: [
|
||||||
options: [
|
{ label: "Бестселлеры", value: "bestseller" },
|
||||||
{ label: "Бестселлеры", value: "bestseller" },
|
{ label: "Дате добавления", value: "newest" },
|
||||||
{ label: "Дате добавления", value: "newest" },
|
{ label: "Дате обновления", value: "last-update" },
|
||||||
{ label: "Дате обновления", value: "last-update" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
genres: {
|
||||||
genres: {
|
label: "жанры",
|
||||||
label: "жанры",
|
value: [],
|
||||||
value: [],
|
options: [
|
||||||
options: [
|
{ label: "Альтернативная история", value: "alternativnaya-istoriya" },
|
||||||
{ label: "Альтернативная история", value: "alternativnaya-istoriya" },
|
{ label: "Боевая фантастика", value: "boevaya-fantastika" },
|
||||||
{ label: "Боевая фантастика", value: "boevaya-fantastika" },
|
{ label: "Боевое фэнтези", value: "boevoe-fentezi" },
|
||||||
{ label: "Боевое фэнтези", value: "boevoe-fentezi" },
|
{ label: "Бытовое фэнтези", value: "bytovoe-fentezi" },
|
||||||
{ label: "Бытовое фэнтези", value: "bytovoe-fentezi" },
|
{ label: "Героическая фантастика", value: "geroicheskaya-fantastika" },
|
||||||
{ label: "Героическая фантастика", value: "geroicheskaya-fantastika" },
|
{ label: "Героическое фэнтези", value: "geroicheskoe-fentezi" },
|
||||||
{ label: "Героическое фэнтези", value: "geroicheskoe-fentezi" },
|
{ label: "Городское фэнтези", value: "gorodskoe-fentezi" },
|
||||||
{ label: "Городское фэнтези", value: "gorodskoe-fentezi" },
|
{ label: "Детектив", value: "detektiv" },
|
||||||
{ label: "Детектив", value: "detektiv" },
|
{ label: "Детективная фантастика", value: "detektivnaya-fantastika" },
|
||||||
{ label: "Детективная фантастика", value: "detektivnaya-fantastika" },
|
{ label: "Жёсткая эротика", value: "zhyostkaya-erotika" },
|
||||||
{ label: "Жёсткая эротика", value: "zhyostkaya-erotika" },
|
{ label: "Исторический детектив", value: "istoricheskii-detektiv" },
|
||||||
{ label: "Исторический детектив", value: "istoricheskii-detektiv" },
|
{ label: "Исторический любовный роман", value: "istoricheskii-lyubovnyi-roman" },
|
||||||
{ label: "Исторический любовный роман", value: "istoricheskii-lyubovnyi-roman" },
|
{ label: "Историческое фэнтези", value: "istoricheskoe-fentezi" },
|
||||||
{ label: "Историческое фэнтези", value: "istoricheskoe-fentezi" },
|
{ label: "Киберпанк", value: "kiberpank" },
|
||||||
{ label: "Киберпанк", value: "kiberpank" },
|
{ label: "Классический детектив", value: "klassicheskii-detektiv" },
|
||||||
{ label: "Классический детектив", value: "klassicheskii-detektiv" },
|
{ label: "Короткий любовный роман", value: "korotkii-lyubovnyi-roman" },
|
||||||
{ label: "Короткий любовный роман", value: "korotkii-lyubovnyi-roman" },
|
{ label: "Космическая фантастика", value: "kosmicheskaya-fantastika" },
|
||||||
{ label: "Космическая фантастика", value: "kosmicheskaya-fantastika" },
|
{ label: "Криминальный детектив", value: "kriminalnyi-detektiv" },
|
||||||
{ label: "Криминальный детектив", value: "kriminalnyi-detektiv" },
|
{ label: "ЛитРПГ", value: "litrpg" },
|
||||||
{ label: "ЛитРПГ", value: "litrpg" },
|
{ label: "Любовная фантастика", value: "lyubovnaya-fantastika" },
|
||||||
{ label: "Любовная фантастика", value: "lyubovnaya-fantastika" },
|
{ label: "Любовное фэнтези", value: "lyubovnoe-fentezi" },
|
||||||
{ label: "Любовное фэнтези", value: "lyubovnoe-fentezi" },
|
{ label: "Любовный роман", value: "lyubovnyi-roman" },
|
||||||
{ label: "Любовный роман", value: "lyubovnyi-roman" },
|
{ label: "Мистика", value: "mistika" },
|
||||||
{ label: "Мистика", value: "mistika" },
|
{ label: "Молодежная проза", value: "molodezhnaya-proza" },
|
||||||
{ label: "Молодежная проза", value: "molodezhnaya-proza" },
|
{ label: "Научная фантастика", value: "nauchnaya-fantastika" },
|
||||||
{ label: "Научная фантастика", value: "nauchnaya-fantastika" },
|
{ label: "Остросюжетный любовный роман", value: "ostrosyuzhetnyi-lyubovnyi-roman" },
|
||||||
{ label: "Остросюжетный любовный роман", value: "ostrosyuzhetnyi-lyubovnyi-roman" },
|
{ label: "Политический детектив", value: "politicheskii-detektiv" },
|
||||||
{ label: "Политический детектив", value: "politicheskii-detektiv" },
|
{ label: "Попаданцы", value: "popadantsy" },
|
||||||
{ label: "Попаданцы", value: "popadantsy" },
|
{ label: "Постапокалипсис", value: "postapokalipsis" },
|
||||||
{ label: "Постапокалипсис", value: "postapokalipsis" },
|
{ label: "Приключенческое фэнтези", value: "priklyuchencheskoe-fentezi" },
|
||||||
{ label: "Приключенческое фэнтези", value: "priklyuchencheskoe-fentezi" },
|
{ label: "Романтическая эротика", value: "romanticheskaya-erotika" },
|
||||||
{ label: "Романтическая эротика", value: "romanticheskaya-erotika" },
|
{ label: "С элементами эротики", value: "s-elementami-erotiki" },
|
||||||
{ label: "С элементами эротики", value: "s-elementami-erotiki" },
|
{ label: "Славянское фэнтези", value: "slavyanskoe-fentezi" },
|
||||||
{ label: "Славянское фэнтези", value: "slavyanskoe-fentezi" },
|
{ label: "Современный любовный роман", value: "sovremennyi-lyubovnyi-roman" },
|
||||||
{ label: "Современный любовный роман", value: "sovremennyi-lyubovnyi-roman" },
|
{ label: "Социальная фантастика", value: "sotsialnaya-fantastika" },
|
||||||
{ label: "Социальная фантастика", value: "sotsialnaya-fantastika" },
|
{ label: "Тёмное фэнтези", value: "temnoe-fentezi" },
|
||||||
{ label: "Тёмное фэнтези", value: "temnoe-fentezi" },
|
{ label: "Фантастика", value: "fantastika" },
|
||||||
{ label: "Фантастика", value: "fantastika" },
|
{ label: "Фэнтези", value: "fentezi" },
|
||||||
{ label: "Фэнтези", value: "fentezi" },
|
{ label: "Шпионский детектив", value: "shpionskii-detektiv" },
|
||||||
{ label: "Шпионский детектив", value: "shpionskii-detektiv" },
|
{ label: "Эпическое фэнтези", value: "epicheskoe-fentezi" },
|
||||||
{ label: "Эпическое фэнтези", value: "epicheskoe-fentezi" },
|
{ label: "Эротика", value: "erotika" },
|
||||||
{ label: "Эротика", value: "erotika" },
|
{ label: "Эротическая фантастика", value: "eroticheskaya-fantastika" },
|
||||||
{ label: "Эротическая фантастика", value: "eroticheskaya-fantastika" },
|
{ label: "Эротический фанфик", value: "eroticheskii-fanfik" },
|
||||||
{ label: "Эротический фанфик", value: "eroticheskii-fanfik" },
|
{ label: "Эротическое фэнтези", value: "eroticheskoe-fentezi" },
|
||||||
{ label: "Эротическое фэнтези", value: "eroticheskoe-fentezi" },
|
{ label: "Юмористический детектив", value: "yumoristicheskii-detektiv" },
|
||||||
{ label: "Юмористический детектив", value: "yumoristicheskii-detektiv" },
|
{ label: "Юмористическое фэнтези", value: "yumoristicheskoe-fentezi" },
|
||||||
{ label: "Юмористическое фэнтези", value: "yumoristicheskoe-fentezi" },
|
],
|
||||||
],
|
type: FilterTypes.CheckboxGroup,
|
||||||
type: FilterTypes.CheckboxGroup,
|
},
|
||||||
},
|
} satisfies Filters;
|
||||||
} satisfies Filters;
|
}
|
||||||
}
|
export default new Bookriver();
|
||||||
export default new Bookriver();
|
|
||||||
|
interface response {
|
||||||
interface response {
|
props: {
|
||||||
props: {
|
pageProps: {
|
||||||
pageProps: {
|
state: {
|
||||||
state: {
|
book?: {
|
||||||
book?: {
|
bookPage: BooksEntity;
|
||||||
bookPage: BooksEntity;
|
};
|
||||||
};
|
pagesFilter?: {
|
||||||
pagesFilter?: {
|
genre: {
|
||||||
genre: {
|
books: BooksEntity[];
|
||||||
books: BooksEntity[];
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
}
|
|
||||||
|
interface BooksEntity {
|
||||||
interface BooksEntity {
|
name: string;
|
||||||
name: string;
|
coverImages: { url: string }[];
|
||||||
coverImages: { url: string }[];
|
slug: string;
|
||||||
slug: string;
|
annotation?: string;
|
||||||
annotation?: string;
|
author?: {
|
||||||
author?: {
|
name: string;
|
||||||
name: string;
|
};
|
||||||
};
|
tags?: { name: string }[];
|
||||||
tags?: { name: string }[];
|
ebook?: {
|
||||||
ebook?: {
|
chapters: Chapter[];
|
||||||
chapters: Chapter[];
|
};
|
||||||
};
|
statusComplete: string;
|
||||||
statusComplete: string;
|
}
|
||||||
}
|
|
||||||
|
interface Chapter {
|
||||||
interface Chapter {
|
name: string;
|
||||||
name: string;
|
available: boolean;
|
||||||
available: boolean;
|
firstPublishedAt?: Date | null;
|
||||||
firstPublishedAt?: Date | null;
|
createdAt?: Date | null;
|
||||||
createdAt?: Date | null;
|
chapterId: number | string;
|
||||||
chapterId: number | string;
|
}
|
||||||
}
|
|
||||||
|
interface responseChapter {
|
||||||
interface responseChapter {
|
data: {
|
||||||
data: {
|
id: number;
|
||||||
id: number;
|
bookId: number;
|
||||||
bookId: number;
|
name: string;
|
||||||
name: string;
|
content: string;
|
||||||
content: string;
|
symbols: number;
|
||||||
symbols: number;
|
number: number;
|
||||||
number: number;
|
authorPages: number;
|
||||||
authorPages: number;
|
createdAt: string;
|
||||||
createdAt: string;
|
updatedAt: string;
|
||||||
updatedAt: string;
|
firstPublishedAt: string;
|
||||||
firstPublishedAt: string;
|
status: string;
|
||||||
status: string;
|
protected: boolean;
|
||||||
protected: boolean;
|
free: boolean;
|
||||||
free: boolean;
|
audio?: {
|
||||||
audio?: {
|
available: boolean;
|
||||||
available: boolean;
|
url: string;
|
||||||
url: string;
|
duration: number;
|
||||||
duration: number;
|
};
|
||||||
};
|
publicationScheduledFor?: null;
|
||||||
publicationScheduledFor?: null;
|
};
|
||||||
};
|
}
|
||||||
}
|
|
||||||
|
interface responseSearch {
|
||||||
interface responseSearch {
|
data: Data;
|
||||||
data: Data;
|
total: number;
|
||||||
total: number;
|
}
|
||||||
}
|
interface Data {
|
||||||
interface Data {
|
books?: BooksEntity[] | null;
|
||||||
books?: BooksEntity[] | null;
|
}
|
||||||
}
|
|
||||||
|
|||||||
+2643
-2644
File diff suppressed because it is too large
Load Diff
+264
-265
@@ -1,265 +1,264 @@
|
|||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
|
|
||||||
class Jaomix implements Plugin.PluginBase {
|
class Jaomix implements Plugin.PluginBase {
|
||||||
id = "jaomix.ru";
|
id = "jaomix.ru";
|
||||||
name = "Jaomix";
|
name = "Jaomix";
|
||||||
site = "https://jaomix.ru";
|
site = "https://jaomix.ru";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
icon = "src/ru/jaomix/icon.png";
|
icon = "src/ru/jaomix/icon.png";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{
|
||||||
{
|
showLatestNovels,
|
||||||
showLatestNovels,
|
filters,
|
||||||
filters,
|
}: Plugin.PopularNovelsOptions<typeof this.filters>,
|
||||||
}: Plugin.PopularNovelsOptions<typeof this.filters>,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let url = this.site + "/?searchrn";
|
||||||
let url = this.site + "/?searchrn";
|
|
||||||
|
if (filters?.lang?.value?.length) {
|
||||||
if (filters?.lang?.value?.length) {
|
url += filters.lang.value
|
||||||
url += filters.lang.value
|
.map((lang, idx) => `&lang[${idx}]=${lang}`).join("");
|
||||||
.map((lang, idx) => `&lang[${idx}]=${lang}`).join("");
|
}
|
||||||
}
|
|
||||||
|
if (filters?.genre?.value?.include?.length) {
|
||||||
if (filters?.genre?.value?.include?.length) {
|
url += filters.genre.value.include
|
||||||
url += filters.genre.value.include
|
.map((genre, idx) => `&genre[${idx}]=${genre}`).join("");
|
||||||
.map((genre, idx) => `&genre[${idx}]=${genre}`).join("");
|
}
|
||||||
}
|
|
||||||
|
if (filters?.genre?.value?.exclude?.length) {
|
||||||
if (filters?.genre?.value?.exclude?.length) {
|
url += filters.genre.value.exclude
|
||||||
url += filters.genre.value.exclude
|
.map((genre, idx) => `&delgenre[${idx}]=del ${genre}`).join("");
|
||||||
.map((genre, idx) => `&delgenre[${idx}]=del ${genre}`).join("");
|
}
|
||||||
}
|
|
||||||
|
url += "&sortcountchapt=" + (filters?.sortcountchapt?.value || "1");
|
||||||
url += "&sortcountchapt=" + (filters?.sortcountchapt?.value || "1");
|
url += "&sortdaycreate=" + (filters?.sortdaycreate?.value || "1");
|
||||||
url += "&sortdaycreate=" + (filters?.sortdaycreate?.value || "1");
|
url +=
|
||||||
url +=
|
"&sortby=" + (showLatestNovels ? "upd" : filters?.sortby?.value || "topweek");
|
||||||
"&sortby=" + (showLatestNovels ? "upd" : filters?.sortby?.value || "topweek");
|
url += "&gpage=" + pageNo;
|
||||||
url += "&gpage=" + pageNo;
|
|
||||||
|
const body = await fetchApi(url).then((res) => res.text());
|
||||||
const body = await fetchApi(url).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
loadedCheerio('div[class="block-home"] > div[class="one"]').each(
|
||||||
loadedCheerio('div[class="block-home"] > div[class="one"]').each(
|
function () {
|
||||||
function () {
|
const name = loadedCheerio(this)
|
||||||
const name = loadedCheerio(this)
|
.find('div[class="img-home"] > a')
|
||||||
.find('div[class="img-home"] > a')
|
.attr("title");
|
||||||
.attr("title");
|
const cover = loadedCheerio(this)
|
||||||
const cover = loadedCheerio(this)
|
.find('div[class="img-home"] > a > img')
|
||||||
.find('div[class="img-home"] > a > img')
|
.attr("src")
|
||||||
.attr("src")
|
?.replace("-150x150", "");
|
||||||
?.replace("-150x150", "");
|
const url = loadedCheerio(this)
|
||||||
const url = loadedCheerio(this)
|
.find('div[class="img-home"] > a')
|
||||||
.find('div[class="img-home"] > a')
|
.attr("href");
|
||||||
.attr("href");
|
|
||||||
|
if (!name || !url) return;
|
||||||
if (!name || !url) return;
|
|
||||||
|
novels.push({ name, cover, url });
|
||||||
novels.push({ name, cover, url });
|
},
|
||||||
},
|
);
|
||||||
);
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await fetchApi(novelUrl).then((res) => res.text());
|
||||||
const body = await fetchApi(novelUrl).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novel: Plugin.SourceNovel = {
|
||||||
const novel: Plugin.SourceNovel = {
|
url: novelUrl,
|
||||||
url: novelUrl,
|
name: loadedCheerio('div[class="desc-book"] > h1').text().trim(),
|
||||||
name: loadedCheerio('div[class="desc-book"] > h1').text().trim(),
|
cover: loadedCheerio('div[class="img-book"] > img').attr("src"),
|
||||||
cover: loadedCheerio('div[class="img-book"] > img').attr("src"),
|
summary: loadedCheerio('div[id="desc-tab"]').text().trim()
|
||||||
summary: loadedCheerio('div[id="desc-tab"]').text().trim()
|
};
|
||||||
};
|
|
||||||
|
loadedCheerio("#info-book > p").each(function () {
|
||||||
loadedCheerio("#info-book > p").each(function () {
|
let text = loadedCheerio(this).text().replace(/,/g, "").split(" ");
|
||||||
let text = loadedCheerio(this).text().replace(/,/g, "").split(" ");
|
if (text[0] === "Автор:") {
|
||||||
if (text[0] === "Автор:") {
|
novel.author = text.splice(1).join(" ");
|
||||||
novel.author = text.splice(1).join(" ");
|
} else if (text[0] === "Жанры:") {
|
||||||
} else if (text[0] === "Жанры:") {
|
novel.genres = text.splice(1).join(",");
|
||||||
novel.genres = text.splice(1).join(",");
|
} else if (text[0] === "Статус:") {
|
||||||
} else if (text[0] === "Статус:") {
|
novel.status = text.includes("продолжается")
|
||||||
novel.status = text.includes("продолжается")
|
? NovelStatus.Ongoing
|
||||||
? NovelStatus.Ongoing
|
: NovelStatus.Completed;
|
||||||
: NovelStatus.Completed;
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
const chapters: Plugin.ChapterItem[] = [];
|
||||||
const chapters: Plugin.ChapterItem[] = [];
|
|
||||||
|
loadedCheerio(".download-chapter div.title").each(function () {
|
||||||
loadedCheerio(".download-chapter div.title").each(function () {
|
const name = loadedCheerio(this).find("a").attr("title");
|
||||||
const name = loadedCheerio(this).find("a").attr("title");
|
const releaseTime = loadedCheerio(this).find("time").text();
|
||||||
const releaseTime = loadedCheerio(this).find("time").text();
|
const url = loadedCheerio(this).find("a").attr("href");
|
||||||
const url = loadedCheerio(this).find("a").attr("href");
|
if (!name || !url) return;
|
||||||
if (!name || !url) return;
|
|
||||||
|
chapters.push({ name, releaseTime, url });
|
||||||
chapters.push({ name, releaseTime, url });
|
});
|
||||||
});
|
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
novel.chapters = chapters.reverse();
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
|
||||||
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const body = await fetchApi(chapterUrl).then((res) => res.text());
|
||||||
const body = await fetchApi(chapterUrl).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
loadedCheerio('div[class="adblock-service"]').remove();
|
||||||
loadedCheerio('div[class="adblock-service"]').remove();
|
const chapterText = loadedCheerio('div[class="entry-content"]').html();
|
||||||
const chapterText = loadedCheerio('div[class="entry-content"]').html();
|
|
||||||
|
return chapterText || "";
|
||||||
return chapterText || "";
|
}
|
||||||
}
|
|
||||||
|
async searchNovels(
|
||||||
async searchNovels(
|
searchTerm: string,
|
||||||
searchTerm: string,
|
pageNo: number | undefined = 1,
|
||||||
pageNo: number | undefined = 1,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const url = `${this.site}/?searchrn=${searchTerm}&but=Поиск по названию&sortby=upd&gpage=${pageNo}`;
|
||||||
const url = `${this.site}/?searchrn=${searchTerm}&but=Поиск по названию&sortby=upd&gpage=${pageNo}`;
|
const body = await fetchApi(url).then((res) => res.text());
|
||||||
const body = await fetchApi(url).then((res) => res.text());
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
loadedCheerio('div[class="block-home"] > div[class="one"]').each(
|
||||||
loadedCheerio('div[class="block-home"] > div[class="one"]').each(
|
function () {
|
||||||
function () {
|
const name = loadedCheerio(this)
|
||||||
const name = loadedCheerio(this)
|
.find('div[class="img-home"] > a')
|
||||||
.find('div[class="img-home"] > a')
|
.attr("title");
|
||||||
.attr("title");
|
const cover = loadedCheerio(this)
|
||||||
const cover = loadedCheerio(this)
|
.find('div[class="img-home"] > a > img')
|
||||||
.find('div[class="img-home"] > a > img')
|
.attr("src")
|
||||||
.attr("src")
|
?.replace("-150x150", "");
|
||||||
?.replace("-150x150", "");
|
const url = loadedCheerio(this)
|
||||||
const url = loadedCheerio(this)
|
.find('div[class="img-home"] > a')
|
||||||
.find('div[class="img-home"] > a')
|
.attr("href");
|
||||||
.attr("href");
|
|
||||||
|
if (!name || !url) return;
|
||||||
if (!name || !url) return;
|
|
||||||
|
novels.push({ name, cover, url });
|
||||||
novels.push({ name, cover, url });
|
},
|
||||||
},
|
);
|
||||||
);
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
fetchImage = fetchFile;
|
||||||
fetchImage = fetchFile;
|
|
||||||
|
filters = {
|
||||||
filters = {
|
sortby: {
|
||||||
sortby: {
|
label: "Сортировка:",
|
||||||
label: "Сортировка:",
|
value: "topweek",
|
||||||
value: "topweek",
|
options: [
|
||||||
options: [
|
{ label: "Топ недели", value: "topweek" },
|
||||||
{ label: "Топ недели", value: "topweek" },
|
{ label: "По алфавиту", value: "alphabet" },
|
||||||
{ label: "По алфавиту", value: "alphabet" },
|
{ label: "По дате обновления", value: "upd" },
|
||||||
{ label: "По дате обновления", value: "upd" },
|
{ label: "По дате создания", value: "new" },
|
||||||
{ label: "По дате создания", value: "new" },
|
{ label: "По просмотрам", value: "count" },
|
||||||
{ label: "По просмотрам", value: "count" },
|
{ label: "Топ года", value: "topyear" },
|
||||||
{ label: "Топ года", value: "topyear" },
|
{ label: "Топ дня", value: "topday" },
|
||||||
{ label: "Топ дня", value: "topday" },
|
{ label: "Топ за все время", value: "alltime" },
|
||||||
{ label: "Топ за все время", value: "alltime" },
|
{ label: "Топ месяца", value: "topmonth" },
|
||||||
{ label: "Топ месяца", value: "topmonth" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
sortdaycreate: {
|
||||||
sortdaycreate: {
|
label: "Дата добавления:",
|
||||||
label: "Дата добавления:",
|
value: "1",
|
||||||
value: "1",
|
options: [
|
||||||
options: [
|
{ label: "Любое", value: "1" },
|
||||||
{ label: "Любое", value: "1" },
|
{ label: "От 120 до 180 дней", value: "1218" },
|
||||||
{ label: "От 120 до 180 дней", value: "1218" },
|
{ label: "От 180 до 365 дней", value: "1836" },
|
||||||
{ label: "От 180 до 365 дней", value: "1836" },
|
{ label: "От 30 до 60 дней", value: "3060" },
|
||||||
{ label: "От 30 до 60 дней", value: "3060" },
|
{ label: "От 365 дней", value: "365" },
|
||||||
{ label: "От 365 дней", value: "365" },
|
{ label: "От 60 до 90 дней", value: "6090" },
|
||||||
{ label: "От 60 до 90 дней", value: "6090" },
|
{ label: "От 90 до 120 дней", value: "9012" },
|
||||||
{ label: "От 90 до 120 дней", value: "9012" },
|
{ label: "Послед. 30 дней", value: "30" },
|
||||||
{ label: "Послед. 30 дней", value: "30" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
sortcountchapt: {
|
||||||
sortcountchapt: {
|
label: "Количество глав:",
|
||||||
label: "Количество глав:",
|
value: "1",
|
||||||
value: "1",
|
options: [
|
||||||
options: [
|
{ label: "Любое кол-во глав", value: "1" },
|
||||||
{ label: "Любое кол-во глав", value: "1" },
|
{ label: "До 500", value: "500" },
|
||||||
{ label: "До 500", value: "500" },
|
{ label: "От 1000 до 2000", value: "1020" },
|
||||||
{ label: "От 1000 до 2000", value: "1020" },
|
{ label: "От 2000 до 3000", value: "2030" },
|
||||||
{ label: "От 2000 до 3000", value: "2030" },
|
{ label: "От 3000 до 4000", value: "3040" },
|
||||||
{ label: "От 3000 до 4000", value: "3040" },
|
{ label: "От 4000", value: "400" },
|
||||||
{ label: "От 4000", value: "400" },
|
{ label: "От 500 до 1000", value: "510" },
|
||||||
{ label: "От 500 до 1000", value: "510" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
genre: {
|
||||||
genre: {
|
label: "Жанры:",
|
||||||
label: "Жанры:",
|
value: { include: [], exclude: [] },
|
||||||
value: { include: [], exclude: [] },
|
options: [
|
||||||
options: [
|
{ 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: "Психология", 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: "Adult", value: "Adult" },
|
{ label: "Ecchi", value: "Ecchi" },
|
||||||
{ label: "Ecchi", value: "Ecchi" },
|
{ label: "Josei", value: "Josei" },
|
||||||
{ label: "Josei", value: "Josei" },
|
{ label: "Lolicon", value: "Lolicon" },
|
||||||
{ label: "Lolicon", value: "Lolicon" },
|
{ label: "Mature", value: "Mature" },
|
||||||
{ label: "Mature", value: "Mature" },
|
{ label: "Shoujo", value: "Shoujo" },
|
||||||
{ label: "Shoujo", value: "Shoujo" },
|
{ label: "Wuxia", value: "Wuxia" },
|
||||||
{ label: "Wuxia", value: "Wuxia" },
|
{ label: "Xianxia", value: "Xianxia" },
|
||||||
{ label: "Xianxia", value: "Xianxia" },
|
{ label: "Xuanhuan", value: "Xuanhuan" },
|
||||||
{ label: "Xuanhuan", value: "Xuanhuan" },
|
{ label: "Yaoi", value: "Yaoi" },
|
||||||
{ label: "Yaoi", value: "Yaoi" },
|
],
|
||||||
],
|
type: FilterTypes.ExcludableCheckboxGroup,
|
||||||
type: FilterTypes.ExcludableCheckboxGroup,
|
},
|
||||||
},
|
lang: {
|
||||||
lang: {
|
label: "Выбрать языки:",
|
||||||
label: "Выбрать языки:",
|
value: [],
|
||||||
value: [],
|
options: [
|
||||||
options: [
|
{ label: "Английский", value: "Английский" },
|
||||||
{ label: "Английский", value: "Английский" },
|
{ label: "Китайский", value: "Китайский" },
|
||||||
{ label: "Китайский", value: "Китайский" },
|
{ label: "Корейский", value: "Корейский" },
|
||||||
{ label: "Корейский", value: "Корейский" },
|
{ label: "Японский", value: "Японский" },
|
||||||
{ label: "Японский", value: "Японский" },
|
],
|
||||||
],
|
type: FilterTypes.CheckboxGroup,
|
||||||
type: FilterTypes.CheckboxGroup,
|
},
|
||||||
},
|
} satisfies Filters;
|
||||||
} satisfies Filters;
|
}
|
||||||
}
|
|
||||||
|
export default new Jaomix();
|
||||||
export default new Jaomix();
|
|
||||||
|
|||||||
+957
-958
File diff suppressed because it is too large
Load Diff
+1284
-1285
File diff suppressed because it is too large
Load Diff
+512
-513
File diff suppressed because it is too large
Load Diff
+408
-409
@@ -1,409 +1,408 @@
|
|||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { defaultCover } from "@libs/defaultCover";
|
import { defaultCover } from "@libs/defaultCover";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
class RNRF implements Plugin.PluginBase {
|
class RNRF implements Plugin.PluginBase {
|
||||||
id = "RNRF";
|
id = "RNRF";
|
||||||
name = "РанобэРФ";
|
name = "РанобэРФ";
|
||||||
site = "https://ранобэ.рф";
|
site = "https://ранобэ.рф";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
icon = "src/ru/ranoberf/icon.png";
|
icon = "src/ru/ranoberf/icon.png";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions,
|
||||||
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let url = this.site + "/books?order=";
|
||||||
let url = this.site + "/books?order=";
|
url += showLatestNovels
|
||||||
url += showLatestNovels
|
? "lastPublishedChapter"
|
||||||
? "lastPublishedChapter"
|
: filters?.sort?.value || "popular";
|
||||||
: filters?.sort?.value || "popular";
|
url += "&page=" + pageNo;
|
||||||
url += "&page=" + pageNo;
|
|
||||||
|
const result = await fetchApi(url);
|
||||||
const result = await fetchApi(url);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
||||||
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
const json: response = JSON.parse(jsonRaw || "{}");
|
||||||
const json: response = JSON.parse(jsonRaw || "{}");
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
json.props.pageProps?.totalData?.items?.forEach((novel) =>
|
||||||
json.props.pageProps?.totalData?.items?.forEach((novel) =>
|
novels.push({
|
||||||
novels.push({
|
name: novel.title,
|
||||||
name: novel.title,
|
cover: novel?.verticalImage?.url
|
||||||
cover: novel?.verticalImage?.url
|
? this.site + novel.verticalImage.url
|
||||||
? this.site + novel.verticalImage.url
|
: defaultCover,
|
||||||
: defaultCover,
|
url: this.site + "/" + novel.slug,
|
||||||
url: this.site + "/" + novel.slug,
|
}),
|
||||||
}),
|
);
|
||||||
);
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const result = await fetchApi(novelUrl);
|
||||||
const result = await fetchApi(novelUrl);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
const loadedCheerio = parseHTML(body);
|
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
||||||
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
const book = (JSON.parse(jsonRaw || "{}") as response).props.pageProps.book;
|
||||||
const book = (JSON.parse(jsonRaw || "{}") as response).props.pageProps.book;
|
|
||||||
|
const novel: Plugin.SourceNovel = {
|
||||||
const novel: Plugin.SourceNovel = {
|
url: novelUrl,
|
||||||
url: novelUrl,
|
name: book?.title,
|
||||||
name: book?.title,
|
cover: book?.verticalImage?.url
|
||||||
cover: book?.verticalImage?.url
|
? this.site + book.verticalImage.url
|
||||||
? this.site + book.verticalImage.url
|
: defaultCover,
|
||||||
: defaultCover,
|
summary: book?.description,
|
||||||
summary: book?.description,
|
author: book?.author || "",
|
||||||
author: book?.author || "",
|
genres: book?.genres.map((item) => item.title).join(", "),
|
||||||
genres: book?.genres.map((item) => item.title).join(", "),
|
status: book?.additionalInfo.includes("Активен")
|
||||||
status: book?.additionalInfo.includes("Активен")
|
? NovelStatus.Ongoing
|
||||||
? NovelStatus.Ongoing
|
: NovelStatus.Completed,
|
||||||
: NovelStatus.Completed,
|
};
|
||||||
};
|
|
||||||
|
const chapters: Plugin.ChapterItem[] = [];
|
||||||
const chapters: Plugin.ChapterItem[] = [];
|
|
||||||
|
book?.chapters?.forEach((chapter) => {
|
||||||
book?.chapters?.forEach((chapter) => {
|
if (!chapter.isDonate || chapter.isUserPaid) {
|
||||||
if (!chapter.isDonate || chapter.isUserPaid) {
|
chapters.push({
|
||||||
chapters.push({
|
name: chapter.title,
|
||||||
name: chapter.title,
|
releaseTime: dayjs(chapter.publishedAt).format("LLL"),
|
||||||
releaseTime: dayjs(chapter.publishedAt).format("LLL"),
|
url: this.site + chapter.url,
|
||||||
url: this.site + chapter.url,
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
novel.chapters = chapters.reverse();
|
||||||
novel.chapters = chapters.reverse();
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
|
||||||
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const result = await fetchApi(chapterUrl);
|
||||||
const result = await fetchApi(chapterUrl);
|
const body = await result.text();
|
||||||
const body = await result.text();
|
|
||||||
|
let loadedCheerio = parseHTML(body);
|
||||||
let loadedCheerio = parseHTML(body);
|
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
||||||
const jsonRaw = loadedCheerio("#__NEXT_DATA__").html();
|
const json: response = JSON.parse(jsonRaw || "{}");
|
||||||
const json: response = JSON.parse(jsonRaw || "{}");
|
|
||||||
|
loadedCheerio = parseHTML(
|
||||||
loadedCheerio = parseHTML(
|
json.props.pageProps?.chapter?.content?.text || "",
|
||||||
json.props.pageProps?.chapter?.content?.text || "",
|
);
|
||||||
);
|
|
||||||
|
const baseUrl = this.site;
|
||||||
const baseUrl = this.site;
|
loadedCheerio("img").each(function () {
|
||||||
loadedCheerio("img").each(function () {
|
if (!loadedCheerio(this).attr("src")?.startsWith("http")) {
|
||||||
if (!loadedCheerio(this).attr("src")?.startsWith("http")) {
|
const src = loadedCheerio(this).attr("src");
|
||||||
const src = loadedCheerio(this).attr("src");
|
loadedCheerio(this).attr("src", baseUrl + src);
|
||||||
loadedCheerio(this).attr("src", baseUrl + src);
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
const chapterText = loadedCheerio.html();
|
||||||
const chapterText = loadedCheerio.html();
|
return chapterText;
|
||||||
return chapterText;
|
}
|
||||||
}
|
|
||||||
|
async searchNovels(
|
||||||
async searchNovels(
|
searchTerm: string,
|
||||||
searchTerm: string,
|
//pageNo: number | undefined = 1,
|
||||||
//pageNo: number | undefined = 1,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const url = `${this.site}/v3/books?filter[or][0][title][like]=${searchTerm}&filter[or][1][titleEn][like]=${searchTerm}&filter[or][2][fullTitle][like]=${searchTerm}&filter[status][]=active&filter[status][]=abandoned&filter[status][]=completed&expand=verticalImage`;
|
||||||
const url = `${this.site}/v3/books?filter[or][0][title][like]=${searchTerm}&filter[or][1][titleEn][like]=${searchTerm}&filter[or][2][fullTitle][like]=${searchTerm}&filter[status][]=active&filter[status][]=abandoned&filter[status][]=completed&expand=verticalImage`;
|
const result = await fetchApi(url);
|
||||||
const result = await fetchApi(url);
|
const body = (await result.json()) as { items: Item[] };
|
||||||
const body = (await result.json()) as { items: Item[] };
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
|
||||||
|
body.items.forEach((novel) =>
|
||||||
body.items.forEach((novel) =>
|
novels.push({
|
||||||
novels.push({
|
name: novel.title,
|
||||||
name: novel.title,
|
cover: novel?.verticalImage?.url
|
||||||
cover: novel?.verticalImage?.url
|
? this.site + novel.verticalImage.url
|
||||||
? this.site + novel.verticalImage.url
|
: defaultCover,
|
||||||
: defaultCover,
|
url: this.site + "/" + novel.slug,
|
||||||
url: this.site + "/" + novel.slug,
|
}),
|
||||||
}),
|
);
|
||||||
);
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
fetchImage = fetchFile;
|
||||||
fetchImage = fetchFile;
|
|
||||||
|
filters = {
|
||||||
filters = {
|
sort: {
|
||||||
sort: {
|
label: "Сортировка",
|
||||||
label: "Сортировка",
|
value: "",
|
||||||
value: "",
|
options: [
|
||||||
options: [
|
{ label: "Рейтинг", value: "popular" },
|
||||||
{ label: "Рейтинг", value: "popular" },
|
{ label: "Дате добавления", value: "new" },
|
||||||
{ label: "Дате добавления", value: "new" },
|
{ label: "Дате обновления", value: "lastPublishedChapter" },
|
||||||
{ label: "Дате обновления", value: "lastPublishedChapter" },
|
{ label: "Законченные", value: "completed" },
|
||||||
{ label: "Законченные", value: "completed" },
|
],
|
||||||
],
|
type: FilterTypes.Picker,
|
||||||
type: FilterTypes.Picker,
|
},
|
||||||
},
|
} satisfies Filters;
|
||||||
} satisfies Filters;
|
}
|
||||||
}
|
export default new RNRF();
|
||||||
export default new RNRF();
|
|
||||||
|
interface response {
|
||||||
interface response {
|
props: Props;
|
||||||
props: Props;
|
page: string;
|
||||||
page: string;
|
query: Query;
|
||||||
query: Query;
|
buildId: string;
|
||||||
buildId: string;
|
isFallback: boolean;
|
||||||
isFallback: boolean;
|
gssp: boolean;
|
||||||
gssp: boolean;
|
appGip: boolean;
|
||||||
appGip: boolean;
|
dynamicIds?: string[];
|
||||||
dynamicIds?: string[];
|
}
|
||||||
}
|
|
||||||
|
interface Props {
|
||||||
interface Props {
|
pageProps: PageProps;
|
||||||
pageProps: PageProps;
|
isMobile: boolean;
|
||||||
isMobile: boolean;
|
theme: string;
|
||||||
theme: string;
|
__N_SSP: boolean;
|
||||||
__N_SSP: boolean;
|
}
|
||||||
}
|
|
||||||
|
interface PageProps {
|
||||||
interface PageProps {
|
initialReduxState: InitialReduxState;
|
||||||
initialReduxState: InitialReduxState;
|
book?: PagePropsBook;
|
||||||
book?: PagePropsBook;
|
totalData?: TotalData;
|
||||||
totalData?: TotalData;
|
layoutViewCookies?: string;
|
||||||
layoutViewCookies?: string;
|
displayBanner?: boolean;
|
||||||
displayBanner?: boolean;
|
chapter?: PagePropsChapter;
|
||||||
chapter?: PagePropsChapter;
|
}
|
||||||
}
|
|
||||||
|
interface PagePropsBook {
|
||||||
interface PagePropsBook {
|
id: number;
|
||||||
id: number;
|
countryId: number;
|
||||||
countryId: number;
|
creatorId: number;
|
||||||
creatorId: number;
|
lastChapterId: number;
|
||||||
lastChapterId: number;
|
sourceId: number;
|
||||||
sourceId: number;
|
imgVerticalId: number;
|
||||||
imgVerticalId: number;
|
imgHorizontalId: number;
|
||||||
imgHorizontalId: number;
|
imgSquareId: number;
|
||||||
imgSquareId: number;
|
imageVerticalId: number;
|
||||||
imageVerticalId: number;
|
imageHorizontalId: number;
|
||||||
imageHorizontalId: number;
|
title: string;
|
||||||
title: string;
|
titleEn: string;
|
||||||
titleEn: string;
|
fullTitle: string;
|
||||||
fullTitle: string;
|
fullTitleEn: string;
|
||||||
fullTitleEn: string;
|
description: string;
|
||||||
description: string;
|
slug: string;
|
||||||
slug: string;
|
author: string;
|
||||||
author: string;
|
additionalInfo: string;
|
||||||
additionalInfo: string;
|
importantInfo: string;
|
||||||
importantInfo: string;
|
status: string;
|
||||||
status: string;
|
views: number;
|
||||||
views: number;
|
likes: number;
|
||||||
likes: number;
|
dislikes: number;
|
||||||
dislikes: number;
|
intervalSec: number;
|
||||||
intervalSec: number;
|
intervalForNextFreeChapterSec: number;
|
||||||
intervalForNextFreeChapterSec: number;
|
chapterCost: number;
|
||||||
chapterCost: number;
|
chapterPrice: number;
|
||||||
chapterPrice: number;
|
chapterPriceCollected: number;
|
||||||
chapterPriceCollected: number;
|
maxSubscriptionChapters: number;
|
||||||
maxSubscriptionChapters: number;
|
maxDonateChapters: number;
|
||||||
maxDonateChapters: number;
|
isDisplayOnMainPage: boolean;
|
||||||
isDisplayOnMainPage: boolean;
|
withoutSchedule: boolean;
|
||||||
withoutSchedule: boolean;
|
nextFreeChapterPublishedAt: null;
|
||||||
nextFreeChapterPublishedAt: null;
|
createdAt: Date;
|
||||||
createdAt: Date;
|
updatedAt: Date;
|
||||||
updatedAt: Date;
|
userRating: null;
|
||||||
userRating: null;
|
userBookmark: null;
|
||||||
userBookmark: null;
|
country: Country;
|
||||||
country: Country;
|
genres: Genre[];
|
||||||
genres: Genre[];
|
timer: Timer;
|
||||||
timer: Timer;
|
chapters: ChapterElement[];
|
||||||
chapters: ChapterElement[];
|
verticalImage: Image;
|
||||||
verticalImage: Image;
|
horizontalImage: Image;
|
||||||
horizontalImage: Image;
|
squareImage: Image;
|
||||||
squareImage: Image;
|
}
|
||||||
}
|
|
||||||
|
interface ChapterElement {
|
||||||
interface ChapterElement {
|
id: number;
|
||||||
id: number;
|
bookId: number;
|
||||||
bookId: number;
|
title: string;
|
||||||
title: string;
|
url: string;
|
||||||
url: string;
|
numberChapter: string;
|
||||||
numberChapter: string;
|
tom: number | null;
|
||||||
tom: number | null;
|
chapterShortNumber: number | null;
|
||||||
chapterShortNumber: number | null;
|
isDonate: boolean;
|
||||||
isDonate: boolean;
|
isSponsored: boolean;
|
||||||
isSponsored: boolean;
|
isSubscription: boolean;
|
||||||
isSubscription: boolean;
|
isEdited: boolean;
|
||||||
isEdited: boolean;
|
publishedAt: Date;
|
||||||
publishedAt: Date;
|
price: number;
|
||||||
price: number;
|
views: number;
|
||||||
views: number;
|
isUserPaid?: boolean;
|
||||||
isUserPaid?: boolean;
|
}
|
||||||
}
|
|
||||||
|
interface Country {
|
||||||
interface Country {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
code: string;
|
||||||
code: string;
|
}
|
||||||
}
|
|
||||||
|
interface Genre {
|
||||||
interface Genre {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
slug: string;
|
||||||
slug: string;
|
}
|
||||||
}
|
|
||||||
|
interface Image {
|
||||||
interface Image {
|
id: number;
|
||||||
id: number;
|
alt: string;
|
||||||
alt: string;
|
path: string;
|
||||||
path: string;
|
name: string;
|
||||||
name: string;
|
url: string;
|
||||||
url: string;
|
}
|
||||||
}
|
|
||||||
|
interface Timer {
|
||||||
interface Timer {
|
value: null;
|
||||||
value: null;
|
for: null;
|
||||||
for: null;
|
message: string;
|
||||||
message: string;
|
}
|
||||||
}
|
|
||||||
|
interface PagePropsChapter {
|
||||||
interface PagePropsChapter {
|
id: number;
|
||||||
id: number;
|
bookId: number;
|
||||||
bookId: number;
|
editorId: null;
|
||||||
editorId: null;
|
translatorId: number;
|
||||||
translatorId: number;
|
parserChapterId: null;
|
||||||
parserChapterId: null;
|
title: string;
|
||||||
title: string;
|
slug: string;
|
||||||
slug: string;
|
status: string;
|
||||||
status: string;
|
tom: null;
|
||||||
tom: null;
|
views: number;
|
||||||
views: number;
|
isSponsored: boolean;
|
||||||
isSponsored: boolean;
|
isSubscription: boolean;
|
||||||
isSubscription: boolean;
|
isDonate: boolean;
|
||||||
isDonate: boolean;
|
isIndexing: boolean;
|
||||||
isIndexing: boolean;
|
publishedAt: Date;
|
||||||
publishedAt: Date;
|
changeAvailabilityAt: null;
|
||||||
changeAvailabilityAt: null;
|
createdAt: Date;
|
||||||
createdAt: Date;
|
updatedAt: Date;
|
||||||
updatedAt: Date;
|
numberChapter: string;
|
||||||
numberChapter: string;
|
price: number;
|
||||||
price: number;
|
content: Content;
|
||||||
content: Content;
|
book: ChapterBook;
|
||||||
book: ChapterBook;
|
userBookmark: null;
|
||||||
userBookmark: null;
|
isUserPaid: boolean;
|
||||||
isUserPaid: boolean;
|
nextChapter: null;
|
||||||
nextChapter: null;
|
previousChapter: PreviousChapter;
|
||||||
previousChapter: PreviousChapter;
|
corrections: null;
|
||||||
corrections: null;
|
}
|
||||||
}
|
|
||||||
|
interface ChapterBook {
|
||||||
interface ChapterBook {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
titleEn: string;
|
||||||
titleEn: string;
|
url: string;
|
||||||
url: string;
|
}
|
||||||
}
|
|
||||||
|
interface Content {
|
||||||
interface Content {
|
id: number;
|
||||||
id: number;
|
text: string;
|
||||||
text: string;
|
symbolsCount: number;
|
||||||
symbolsCount: number;
|
}
|
||||||
}
|
|
||||||
|
interface PreviousChapter {
|
||||||
interface PreviousChapter {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
views: number;
|
||||||
views: number;
|
publishedAt: Date;
|
||||||
publishedAt: Date;
|
url: string;
|
||||||
url: string;
|
numberChapter: string;
|
||||||
numberChapter: string;
|
}
|
||||||
}
|
|
||||||
|
interface InitialReduxState {
|
||||||
interface InitialReduxState {
|
data?: Data;
|
||||||
data?: Data;
|
auth: Auth;
|
||||||
auth: Auth;
|
banners?: Banners;
|
||||||
banners?: Banners;
|
corrections?: Corrections;
|
||||||
corrections?: Corrections;
|
readerSettings?: ReaderSettings;
|
||||||
readerSettings?: ReaderSettings;
|
}
|
||||||
}
|
|
||||||
|
interface Auth {
|
||||||
interface Auth {
|
isAuth: boolean;
|
||||||
isAuth: boolean;
|
user: null;
|
||||||
user: null;
|
}
|
||||||
}
|
|
||||||
|
interface Banners {
|
||||||
interface Banners {
|
displaySale: boolean;
|
||||||
displaySale: boolean;
|
}
|
||||||
}
|
|
||||||
|
interface Corrections {
|
||||||
interface Corrections {
|
items: null;
|
||||||
items: null;
|
data: null;
|
||||||
data: null;
|
}
|
||||||
}
|
|
||||||
|
interface Data {
|
||||||
interface Data {
|
bookPage: BookPage | null;
|
||||||
bookPage: BookPage | null;
|
chapterPage: ChapterPage | null;
|
||||||
chapterPage: ChapterPage | null;
|
}
|
||||||
}
|
|
||||||
|
interface BookPage {
|
||||||
interface BookPage {
|
bookId: number;
|
||||||
bookId: number;
|
bookmark: null;
|
||||||
bookmark: null;
|
}
|
||||||
}
|
|
||||||
|
interface ChapterPage {
|
||||||
interface ChapterPage {
|
chapterId: number;
|
||||||
chapterId: number;
|
bookId: number;
|
||||||
bookId: number;
|
bookmark: null;
|
||||||
bookmark: null;
|
}
|
||||||
}
|
|
||||||
|
interface ReaderSettings {
|
||||||
interface ReaderSettings {
|
fontSize: number;
|
||||||
fontSize: number;
|
lineHeight: number;
|
||||||
lineHeight: number;
|
textIndent: number;
|
||||||
textIndent: number;
|
sidebarHide: number;
|
||||||
sidebarHide: number;
|
textAlign: string;
|
||||||
textAlign: string;
|
}
|
||||||
}
|
|
||||||
|
interface TotalData {
|
||||||
interface TotalData {
|
items: Item[];
|
||||||
items: Item[];
|
_links: Links;
|
||||||
_links: Links;
|
pagesData: PagesData;
|
||||||
pagesData: PagesData;
|
}
|
||||||
}
|
|
||||||
|
interface Links {
|
||||||
interface Links {
|
self: First;
|
||||||
self: First;
|
first: First;
|
||||||
first: First;
|
last: First;
|
||||||
last: First;
|
next: First;
|
||||||
next: First;
|
}
|
||||||
}
|
|
||||||
|
interface First {
|
||||||
interface First {
|
href: string;
|
||||||
href: string;
|
}
|
||||||
}
|
|
||||||
|
interface Item {
|
||||||
interface Item {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
description: string;
|
||||||
description: string;
|
slug: string;
|
||||||
slug: string;
|
url: string;
|
||||||
url: string;
|
status: string;
|
||||||
status: string;
|
dislikes: number;
|
||||||
dislikes: number;
|
likes: number;
|
||||||
likes: number;
|
userRating: null;
|
||||||
userRating: null;
|
lastChapter: ChapterElement;
|
||||||
lastChapter: ChapterElement;
|
verticalImage: Image;
|
||||||
verticalImage: Image;
|
horizontalImage: Image;
|
||||||
horizontalImage: Image;
|
squareImage: Image;
|
||||||
squareImage: Image;
|
}
|
||||||
}
|
|
||||||
|
interface PagesData {
|
||||||
interface PagesData {
|
totalCount: number;
|
||||||
totalCount: number;
|
pageCount: number;
|
||||||
pageCount: number;
|
currentPage: number;
|
||||||
currentPage: number;
|
perPage: number;
|
||||||
perPage: number;
|
}
|
||||||
}
|
|
||||||
|
interface Query {
|
||||||
interface Query {
|
book?: string;
|
||||||
book?: string;
|
chapter?: string;
|
||||||
chapter?: string;
|
}
|
||||||
}
|
|
||||||
|
|||||||
+1105
-1106
File diff suppressed because it is too large
Load Diff
+375
-385
@@ -1,385 +1,375 @@
|
|||||||
import { CheerioAPI, load as parseHTML } from "cheerio";
|
import { CheerioAPI, load as parseHTML } from "cheerio";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { showToast } from "@libs/showToast";
|
import { showToast } from "@libs/showToast";
|
||||||
import { defaultCover } from "@libs/defaultCover";
|
import { defaultCover } from "@libs/defaultCover";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
|
|
||||||
class TuNovelaLigera implements Plugin.PluginBase {
|
class TuNovelaLigera implements Plugin.PluginBase {
|
||||||
id = "tunovelaligera";
|
id = "tunovelaligera";
|
||||||
name = "TuNovelaLigera";
|
name = "TuNovelaLigera";
|
||||||
icon = "src/es/tunovelaligera/icon.png";
|
icon = "src/es/tunovelaligera/icon.png";
|
||||||
site = "https://tunovelaligera.com/";
|
site = "https://tunovelaligera.com/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let link = `${this.site}`;
|
||||||
let link = `${this.site}`;
|
|
||||||
|
link += filters.genres ? `genero/` + filters.genres : "novelas";
|
||||||
link += filters.genres ? `genero/` + filters.genres : "novelas";
|
|
||||||
|
link += `/page/${pageNo}`;
|
||||||
link += `/page/${pageNo}`;
|
|
||||||
|
link += filters.order;
|
||||||
link += filters.order;
|
|
||||||
|
const headers = new Headers();
|
||||||
const headers = new Headers();
|
const result = await fetchApi(link, { headers });
|
||||||
if (this.cookieString) {
|
const body = await result.text();
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
const loadedCheerio = parseHTML(body);
|
||||||
const result = await fetchApi(link, { headers });
|
|
||||||
const body = await result.text();
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
loadedCheerio(".page-item-detail").each((i, el) => {
|
||||||
|
const novelName = loadedCheerio(el).find(".h5 > a").text();
|
||||||
const novels: Plugin.NovelItem[] = [];
|
const novelCover = loadedCheerio(el).find("img").attr("src");
|
||||||
|
const novelUrl = loadedCheerio(el).find(".h5 > a").attr("href");
|
||||||
loadedCheerio(".page-item-detail").each((i, el) => {
|
|
||||||
const novelName = loadedCheerio(el).find(".h5 > a").text();
|
if (!novelUrl) return;
|
||||||
const novelCover = loadedCheerio(el).find("img").attr("src");
|
const novel = {
|
||||||
const novelUrl = loadedCheerio(el).find(".h5 > a").attr("href");
|
name: novelName,
|
||||||
|
cover: novelCover,
|
||||||
if (!novelUrl) return;
|
url: novelUrl,
|
||||||
const novel = {
|
};
|
||||||
name: novelName,
|
|
||||||
cover: novelCover,
|
novels.push(novel);
|
||||||
url: novelUrl,
|
});
|
||||||
};
|
|
||||||
|
return novels;
|
||||||
novels.push(novel);
|
}
|
||||||
});
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
return novels;
|
const url = novelUrl;
|
||||||
}
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await result.text();
|
||||||
const url = novelUrl;
|
|
||||||
const headers = new Headers();
|
let loadedCheerio = parseHTML(body);
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
const novel: Plugin.SourceNovel = {
|
||||||
}
|
url,
|
||||||
const result = await fetchApi(url, { headers });
|
chapters: [],
|
||||||
const body = await result.text();
|
};
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
loadedCheerio(".manga-title-badges").remove();
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
novel.name = loadedCheerio(".post-title > h1").text().trim();
|
||||||
url,
|
|
||||||
chapters: [],
|
let novelCover = loadedCheerio(".summary_image > a > img");
|
||||||
};
|
|
||||||
|
novel.cover =
|
||||||
loadedCheerio(".manga-title-badges").remove();
|
novelCover.attr("data-src") ||
|
||||||
|
novelCover.attr("src") ||
|
||||||
novel.name = loadedCheerio(".post-title > h1").text().trim();
|
novelCover.attr("data-cfsrc") ||
|
||||||
|
defaultCover;
|
||||||
let novelCover = loadedCheerio(".summary_image > a > img");
|
|
||||||
|
loadedCheerio(".post-content_item").each(function () {
|
||||||
novel.cover =
|
const detailName = loadedCheerio(this)
|
||||||
novelCover.attr("data-src") ||
|
.find(".summary-heading > h5")
|
||||||
novelCover.attr("src") ||
|
.text()
|
||||||
novelCover.attr("data-cfsrc") ||
|
.trim();
|
||||||
defaultCover;
|
const detail = loadedCheerio(this)
|
||||||
|
.find(".summary-content")
|
||||||
loadedCheerio(".post-content_item").each(function () {
|
.text()
|
||||||
const detailName = loadedCheerio(this)
|
.trim();
|
||||||
.find(".summary-heading > h5")
|
|
||||||
.text()
|
switch (detailName) {
|
||||||
.trim();
|
case "Generos":
|
||||||
const detail = loadedCheerio(this)
|
novel.genres = detail.replace(/, /g, ",");
|
||||||
.find(".summary-content")
|
break;
|
||||||
.text()
|
case "Autores":
|
||||||
.trim();
|
novel.author = detail;
|
||||||
|
break;
|
||||||
switch (detailName) {
|
case "Estado":
|
||||||
case "Generos":
|
novel.status =
|
||||||
novel.genres = detail.replace(/, /g, ",");
|
detail.includes("OnGoing") ||
|
||||||
break;
|
detail.includes("Updating")
|
||||||
case "Autores":
|
? NovelStatus.Ongoing
|
||||||
novel.author = detail;
|
: NovelStatus.Completed;
|
||||||
break;
|
break;
|
||||||
case "Estado":
|
}
|
||||||
novel.status =
|
});
|
||||||
detail.includes("OnGoing") ||
|
|
||||||
detail.includes("Updating")
|
novel.summary = loadedCheerio("div.summary__content > p").text().trim();
|
||||||
? NovelStatus.Ongoing
|
|
||||||
: NovelStatus.Completed;
|
let chapter: Plugin.ChapterItem[] = [];
|
||||||
break;
|
|
||||||
}
|
const delay = (ms: number) => new Promise((res) => setTimeout(res, ms));
|
||||||
});
|
let lastPage = 1;
|
||||||
|
lastPage = +loadedCheerio(".lcp_paginator li:last").prev().text();
|
||||||
novel.summary = loadedCheerio("div.summary__content > p").text().trim();
|
|
||||||
|
const getChapters = async () => {
|
||||||
let chapter: Plugin.ChapterItem[] = [];
|
const n = url.split("/");
|
||||||
|
const novelName = n[4];
|
||||||
const delay = (ms: number) => new Promise((res) => setTimeout(res, ms));
|
showToast("Cargando desde Archivo...");
|
||||||
let lastPage = 1;
|
|
||||||
lastPage = +loadedCheerio(".lcp_paginator li:last").prev().text();
|
const formData = new FormData();
|
||||||
|
formData.append("action", "madara_load_more");
|
||||||
const getChapters = async () => {
|
formData.append("page", "0");
|
||||||
const n = url.split("/");
|
formData.append("template", "html/loop/content");
|
||||||
const novelName = n[4];
|
formData.append("vars[category_name]", novelName);
|
||||||
showToast("Cargando desde Archivo...");
|
formData.append("vars[posts_per_page]", "10000");
|
||||||
|
|
||||||
const formData = new FormData();
|
const result = await fetchApi(
|
||||||
formData.append("action", "madara_load_more");
|
`${this.site}wp-admin/admin-ajax.php`,
|
||||||
formData.append("page", "0");
|
{
|
||||||
formData.append("template", "html/loop/content");
|
method: "POST",
|
||||||
formData.append("vars[category_name]", novelName);
|
body: formData,
|
||||||
formData.append("vars[posts_per_page]", "10000");
|
headers,
|
||||||
|
}
|
||||||
const result = await fetchApi(
|
);
|
||||||
`${this.site}wp-admin/admin-ajax.php`,
|
const text = await result.text();
|
||||||
{
|
|
||||||
method: "POST",
|
loadedCheerio = parseHTML(text);
|
||||||
body: formData,
|
|
||||||
headers,
|
loadedCheerio(".heading").each((i, el) => {
|
||||||
}
|
const chapterName = loadedCheerio(el)
|
||||||
);
|
.text()
|
||||||
const text = await result.text();
|
.replace(/[\t\n]/g, "")
|
||||||
|
.trim();
|
||||||
loadedCheerio = parseHTML(text);
|
const releaseDate = null;
|
||||||
|
const chapterUrl =
|
||||||
loadedCheerio(".heading").each((i, el) => {
|
loadedCheerio(el).find("a").attr("href") || "";
|
||||||
const chapterName = loadedCheerio(el)
|
|
||||||
.text()
|
chapter.push({
|
||||||
.replace(/[\t\n]/g, "")
|
name: chapterName,
|
||||||
.trim();
|
url: chapterUrl,
|
||||||
const releaseDate = null;
|
releaseTime: releaseDate,
|
||||||
const chapterUrl =
|
});
|
||||||
loadedCheerio(el).find("a").attr("href") || "";
|
});
|
||||||
|
return chapter.reverse();
|
||||||
chapter.push({
|
};
|
||||||
name: chapterName,
|
|
||||||
url: chapterUrl,
|
const getPageChapters = async () => {
|
||||||
releaseTime: releaseDate,
|
for (let i = 1; i <= lastPage; i++) {
|
||||||
});
|
const chaptersUrl = `${novelUrl}?lcp_page0=${i}`;
|
||||||
});
|
showToast(`Cargando desde la página ${i}/${lastPage}...`);
|
||||||
return chapter.reverse();
|
const result = await fetchApi(chaptersUrl, { headers });
|
||||||
};
|
const chaptersHTML = await result.text();
|
||||||
|
|
||||||
const getPageChapters = async () => {
|
let chapterCheerio = parseHTML(chaptersHTML);
|
||||||
for (let i = 1; i <= lastPage; i++) {
|
|
||||||
const chaptersUrl = `${novelUrl}?lcp_page0=${i}`;
|
chapterCheerio(".lcp_catlist li").each((i, el) => {
|
||||||
showToast(`Cargando desde la página ${i}/${lastPage}...`);
|
const chapterName = chapterCheerio(el)
|
||||||
const result = await fetchApi(chaptersUrl, { headers });
|
.find("a")
|
||||||
const chaptersHTML = await result.text();
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "")
|
||||||
let chapterCheerio = parseHTML(chaptersHTML);
|
.trim();
|
||||||
|
|
||||||
chapterCheerio(".lcp_catlist li").each((i, el) => {
|
const releaseDate = chapterCheerio(el)
|
||||||
const chapterName = chapterCheerio(el)
|
.find("span")
|
||||||
.find("a")
|
.text()
|
||||||
.text()
|
.trim();
|
||||||
.replace(/[\t\n]/g, "")
|
|
||||||
.trim();
|
const chapterUrl =
|
||||||
|
chapterCheerio(el).find("a").attr("href") || "";
|
||||||
const releaseDate = chapterCheerio(el)
|
|
||||||
.find("span")
|
chapter.push({
|
||||||
.text()
|
name: chapterName,
|
||||||
.trim();
|
releaseTime: releaseDate,
|
||||||
|
url: chapterUrl,
|
||||||
const chapterUrl =
|
});
|
||||||
chapterCheerio(el).find("a").attr("href") || "";
|
});
|
||||||
|
await delay(1000);
|
||||||
chapter.push({
|
}
|
||||||
name: chapterName,
|
return chapter.reverse();
|
||||||
releaseTime: releaseDate,
|
};
|
||||||
url: chapterUrl,
|
|
||||||
});
|
novel.chapters = await getChapters();
|
||||||
});
|
|
||||||
await delay(1000);
|
if (!novel.chapters.length) {
|
||||||
}
|
showToast("¡Archivo no encontrado!");
|
||||||
return chapter.reverse();
|
await delay(1000);
|
||||||
};
|
novel.chapters = await getPageChapters();
|
||||||
|
}
|
||||||
novel.chapters = await getChapters();
|
|
||||||
|
return novel;
|
||||||
if (!novel.chapters.length) {
|
}
|
||||||
showToast("¡Archivo no encontrado!");
|
|
||||||
await delay(1000);
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
novel.chapters = await getPageChapters();
|
const headers = new Headers();
|
||||||
}
|
const result = await fetchApi(chapterUrl);
|
||||||
|
const body = await result.text();
|
||||||
return novel;
|
|
||||||
}
|
const loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
loadedCheerio("#hola_siguiente").next().find("div").remove();
|
||||||
const headers = new Headers();
|
const chapterText =
|
||||||
if (this.cookieString) {
|
loadedCheerio("#hola_siguiente").next().html() || "";
|
||||||
headers.append("cookie", this.cookieString);
|
|
||||||
}
|
return chapterText;
|
||||||
const result = await fetchApi(chapterUrl);
|
}
|
||||||
const body = await result.text();
|
|
||||||
|
async searchNovels(
|
||||||
const loadedCheerio = parseHTML(body);
|
searchTerm: string,
|
||||||
|
pageNo?: number | undefined
|
||||||
loadedCheerio("#hola_siguiente").next().find("div").remove();
|
): Promise<Plugin.NovelItem[]> {
|
||||||
const chapterText =
|
const url = `${this.site}?s=${searchTerm}&post_type=wp-manga`;
|
||||||
loadedCheerio("#hola_siguiente").next().html() || "";
|
|
||||||
|
const result = await fetchApi(url);
|
||||||
return chapterText;
|
const body = await result.text();
|
||||||
}
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
async searchNovels(
|
|
||||||
searchTerm: string,
|
const novels: Plugin.NovelItem[] = [];
|
||||||
pageNo?: number | undefined
|
|
||||||
): Promise<Plugin.NovelItem[]> {
|
loadedCheerio(".c-tabs-item__content").each((i, el) => {
|
||||||
const url = `${this.site}?s=${searchTerm}&post_type=wp-manga`;
|
const novelName = loadedCheerio(el).find(".h4 > a").text();
|
||||||
|
const novelCover = loadedCheerio(el).find("img").attr("src");
|
||||||
const result = await fetchApi(url);
|
const novelUrl = loadedCheerio(el).find(".h4 > a").attr("href");
|
||||||
const body = await result.text();
|
if (!novelUrl) return;
|
||||||
|
novels.push({
|
||||||
const loadedCheerio = parseHTML(body);
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
const novels: Plugin.NovelItem[] = [];
|
cover: novelCover,
|
||||||
|
});
|
||||||
loadedCheerio(".c-tabs-item__content").each((i, el) => {
|
});
|
||||||
const novelName = loadedCheerio(el).find(".h4 > a").text();
|
|
||||||
const novelCover = loadedCheerio(el).find("img").attr("src");
|
return novels;
|
||||||
const novelUrl = loadedCheerio(el).find(".h4 > a").attr("href");
|
}
|
||||||
if (!novelUrl) return;
|
|
||||||
novels.push({
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
name: novelName,
|
return await fetchFile(url);
|
||||||
url: novelUrl,
|
}
|
||||||
cover: novelCover,
|
|
||||||
});
|
filters = {
|
||||||
});
|
order: {
|
||||||
|
value: "?m_orderby=rating",
|
||||||
return novels;
|
label: "Ordenado por",
|
||||||
}
|
options: [
|
||||||
|
{ label: "Lo mas reciente", value: "?m_orderby=latest" },
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
|
||||||
return await fetchFile(url);
|
{ label: "A-Z", value: "?m_orderby=alphabet" },
|
||||||
}
|
|
||||||
|
{ label: "Clasificación", value: "?m_orderby=rating" },
|
||||||
filters = {
|
|
||||||
order: {
|
{ label: "Trending", value: "?m_orderby=trending" },
|
||||||
value: "?m_orderby=rating",
|
|
||||||
label: "Ordenado por",
|
{ label: "Mas visto", value: "?m_orderby=views" },
|
||||||
options: [
|
|
||||||
{ label: "Lo mas reciente", value: "?m_orderby=latest" },
|
{ label: "Nuevo", value: "?m_orderby=new-manga" },
|
||||||
|
],
|
||||||
{ label: "A-Z", value: "?m_orderby=alphabet" },
|
type: FilterTypes.Picker,
|
||||||
|
},
|
||||||
{ label: "Clasificación", value: "?m_orderby=rating" },
|
genres: {
|
||||||
|
value: "",
|
||||||
{ label: "Trending", value: "?m_orderby=trending" },
|
label: "Generos",
|
||||||
|
options: [
|
||||||
{ label: "Mas visto", value: "?m_orderby=views" },
|
{ label: "None", value: "" },
|
||||||
|
{ label: "Acción", value: "accion" },
|
||||||
{ label: "Nuevo", value: "?m_orderby=new-manga" },
|
|
||||||
],
|
{ label: "Adulto", value: "adulto" },
|
||||||
type: FilterTypes.Picker,
|
|
||||||
},
|
{ label: "Artes Marciales", value: "artes-marciales" },
|
||||||
genres: {
|
|
||||||
value: "",
|
{ label: "Aventura", value: "aventura" },
|
||||||
label: "Generos",
|
|
||||||
options: [
|
{ label: "Ciencia Ficción", value: "ciencia-ficcion" },
|
||||||
{ label: "None", value: "" },
|
|
||||||
{ label: "Acción", value: "accion" },
|
{ label: "Comedia", value: "comedia" },
|
||||||
|
|
||||||
{ label: "Adulto", value: "adulto" },
|
{ label: "Deportes", value: "deportes" },
|
||||||
|
|
||||||
{ label: "Artes Marciales", value: "artes-marciales" },
|
{ label: "Drama", value: "drama" },
|
||||||
|
|
||||||
{ label: "Aventura", value: "aventura" },
|
{ label: "Eastern Fantasy", value: "eastern-fantasy" },
|
||||||
|
|
||||||
{ label: "Ciencia Ficción", value: "ciencia-ficcion" },
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
|
|
||||||
{ label: "Comedia", value: "comedia" },
|
{ label: "FanFiction", value: "fan-fiction" },
|
||||||
|
|
||||||
{ label: "Deportes", value: "deportes" },
|
{ label: "Fantasía", value: "fantasia" },
|
||||||
|
|
||||||
{ label: "Drama", value: "drama" },
|
{ label: "Fantasía oriental", value: "fantasia-oriental" },
|
||||||
|
|
||||||
{ label: "Eastern Fantasy", value: "eastern-fantasy" },
|
{ label: "Ficción Romántica", value: "ficcion-romantica" },
|
||||||
|
|
||||||
{ label: "Ecchi", value: "ecchi" },
|
{ label: "Gender Bender", value: "gender-bender" },
|
||||||
|
|
||||||
{ label: "FanFiction", value: "fan-fiction" },
|
{ label: "Harem", value: "harem" },
|
||||||
|
|
||||||
{ label: "Fantasía", value: "fantasia" },
|
{ label: "Histórico", value: "historico" },
|
||||||
|
|
||||||
{ label: "Fantasía oriental", value: "fantasia-oriental" },
|
{ label: "Horror", value: "horror" },
|
||||||
|
|
||||||
{ label: "Ficción Romántica", value: "ficcion-romantica" },
|
{ label: "Josei", value: "josei" },
|
||||||
|
|
||||||
{ label: "Gender Bender", value: "gender-bender" },
|
{ label: "Maduro", value: "maduro" },
|
||||||
|
|
||||||
{ label: "Harem", value: "harem" },
|
{ label: "Mecha", value: "mecha" },
|
||||||
|
|
||||||
{ label: "Histórico", value: "historico" },
|
{ label: "Misterio", value: "misterio" },
|
||||||
|
|
||||||
{ label: "Horror", value: "horror" },
|
{ label: "Novela China", value: "novela-china" },
|
||||||
|
|
||||||
{ label: "Josei", value: "josei" },
|
{ label: "Novela FanFiction", value: "novela-fanfiction" },
|
||||||
|
|
||||||
{ label: "Maduro", value: "maduro" },
|
{ label: "Novela Japonesa", value: "novela-japonesa" },
|
||||||
|
|
||||||
{ label: "Mecha", value: "mecha" },
|
{ label: "Novela Koreana", value: "novela-koreana" },
|
||||||
|
|
||||||
{ label: "Misterio", value: "misterio" },
|
{ label: "Novela ligera", value: "novela-ligera" },
|
||||||
|
|
||||||
{ label: "Novela China", value: "novela-china" },
|
{ label: "Novela original", value: "novela-original" },
|
||||||
|
|
||||||
{ label: "Novela FanFiction", value: "novela-fanfiction" },
|
{ label: "Novela Web", value: "web-novel" },
|
||||||
|
|
||||||
{ label: "Novela Japonesa", value: "novela-japonesa" },
|
{ label: "Psicológico", value: "psicologico" },
|
||||||
|
|
||||||
{ label: "Novela Koreana", value: "novela-koreana" },
|
{ label: "Realismo Mágico", value: "realismo-magico" },
|
||||||
|
|
||||||
{ label: "Novela ligera", value: "novela-ligera" },
|
{ label: "Recuento de vida", value: "recuento-de-vida" },
|
||||||
|
|
||||||
{ label: "Novela original", value: "novela-original" },
|
{ label: "Romance", value: "romance" },
|
||||||
|
|
||||||
{ label: "Novela Web", value: "web-novel" },
|
{
|
||||||
|
label: "Romance contemporáneo",
|
||||||
{ label: "Psicológico", value: "psicologico" },
|
value: "romance-contemporaneo",
|
||||||
|
},
|
||||||
{ label: "Realismo Mágico", value: "realismo-magico" },
|
|
||||||
|
{ label: "Romance Moderno", value: "romance-moderno" },
|
||||||
{ label: "Recuento de vida", value: "recuento-de-vida" },
|
|
||||||
|
{ label: "Seinen", value: "seinen" },
|
||||||
{ label: "Romance", value: "romance" },
|
|
||||||
|
{ label: "Shoujo", value: "shoujo" },
|
||||||
{
|
|
||||||
label: "Romance contemporáneo",
|
{ label: "Shounen", value: "shounen" },
|
||||||
value: "romance-contemporaneo",
|
|
||||||
},
|
{ label: "Sobrenatural", value: "sobrenatural" },
|
||||||
|
|
||||||
{ label: "Romance Moderno", value: "romance-moderno" },
|
{ label: "Tragedia", value: "tragedia" },
|
||||||
|
|
||||||
{ label: "Seinen", value: "seinen" },
|
{ label: "Vampiros", value: "vampiros" },
|
||||||
|
|
||||||
{ label: "Shoujo", value: "shoujo" },
|
{ label: "Vida Escolar", value: "vida-escolar" },
|
||||||
|
|
||||||
{ label: "Shounen", value: "shounen" },
|
{ label: "Western Fantasy", value: "western-fantasy" },
|
||||||
|
|
||||||
{ label: "Sobrenatural", value: "sobrenatural" },
|
{ label: "Wuxia", value: "wuxia" },
|
||||||
|
|
||||||
{ label: "Tragedia", value: "tragedia" },
|
{ label: "Xianxia", value: "xianxia" },
|
||||||
|
|
||||||
{ label: "Vampiros", value: "vampiros" },
|
{ label: "Xuanhuan", value: "xuanhuan" },
|
||||||
|
|
||||||
{ label: "Vida Escolar", value: "vida-escolar" },
|
{ label: "Yaoi", value: "yaoi" },
|
||||||
|
],
|
||||||
{ label: "Western Fantasy", value: "western-fantasy" },
|
type: FilterTypes.Picker,
|
||||||
|
},
|
||||||
{ label: "Wuxia", value: "wuxia" },
|
} satisfies Filters;
|
||||||
|
}
|
||||||
{ label: "Xianxia", value: "xianxia" },
|
|
||||||
|
export default new TuNovelaLigera();
|
||||||
{ label: "Xuanhuan", value: "xuanhuan" },
|
|
||||||
|
|
||||||
{ label: "Yaoi", value: "yaoi" },
|
|
||||||
],
|
|
||||||
type: FilterTypes.Picker,
|
|
||||||
},
|
|
||||||
} satisfies Filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new TuNovelaLigera();
|
|
||||||
|
|||||||
+310
-323
@@ -1,323 +1,310 @@
|
|||||||
import { load as parseHTML } from "cheerio";
|
import { load as parseHTML } from "cheerio";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { FilterTypes, Filters } from "@libs/filterInputs";
|
import { FilterTypes, Filters } from "@libs/filterInputs";
|
||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
|
|
||||||
class LSHNovel implements Plugin.PluginBase {
|
class LSHNovel implements Plugin.PluginBase {
|
||||||
id = "lshnovel";
|
id = "lshnovel";
|
||||||
name = "Liebe Schnee Hiver Novel";
|
name = "Liebe Schnee Hiver Novel";
|
||||||
icon = "multisrc/wpmangastream/icons/lshnovel.png";
|
icon = "multisrc/wpmangastream/icons/lshnovel.png";
|
||||||
site = "https://lshnovel.com/";
|
site = "https://lshnovel.com/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
||||||
{ filters }: Plugin.PopularNovelsOptions<typeof this.filters>
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
let link = `${this.site}series/?page=${pageNo}`;
|
||||||
let link = `${this.site}series/?page=${pageNo}`;
|
|
||||||
|
if (filters.genres.value.length) {
|
||||||
if (filters.genres.value.length) {
|
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
||||||
link += filters.genres.value.map((i) => `&genre[]=${i}`).join("");
|
}
|
||||||
}
|
|
||||||
|
if (filters.type.value.length)
|
||||||
if (filters.type.value.length)
|
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
||||||
link += filters.type.value.map((i) => `&lang[]=${i}`).join("");
|
|
||||||
|
link += "&status=" + filters.status;
|
||||||
link += "&status=" + filters.status;
|
|
||||||
|
link += "&order=" + filters.order;
|
||||||
link += "&order=" + filters.order;
|
|
||||||
|
const headers = new Headers();
|
||||||
const headers = new Headers();
|
const body = await fetchApi(link, { headers }).then((result) =>
|
||||||
if (this.cookieString) {
|
result.text()
|
||||||
headers.append("cookie", this.cookieString);
|
);
|
||||||
}
|
|
||||||
const body = await fetchApi(link, { headers }).then((result) =>
|
const loadedCheerio = parseHTML(body);
|
||||||
result.text()
|
|
||||||
);
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
loadedCheerio("article.bs").each(function () {
|
||||||
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
const novels: Plugin.NovelItem[] = [];
|
let image = loadedCheerio(this).find("img");
|
||||||
|
const novelCover = image.attr("data-src") || image.attr("src");
|
||||||
loadedCheerio("article.bs").each(function () {
|
|
||||||
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
let image = loadedCheerio(this).find("img");
|
|
||||||
const novelCover = image.attr("data-src") || image.attr("src");
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
const novel = {
|
||||||
|
name: novelName,
|
||||||
if (!novelUrl) return;
|
cover: novelCover,
|
||||||
|
url: novelUrl,
|
||||||
const novel = {
|
};
|
||||||
name: novelName,
|
|
||||||
cover: novelCover,
|
novels.push(novel);
|
||||||
url: novelUrl,
|
});
|
||||||
};
|
|
||||||
|
return novels;
|
||||||
novels.push(novel);
|
}
|
||||||
});
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
return novels;
|
const url = novelUrl;
|
||||||
}
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const body = await result.text();
|
||||||
const url = novelUrl;
|
|
||||||
const headers = new Headers();
|
let loadedCheerio = parseHTML(body);
|
||||||
if (this.cookieString) {
|
|
||||||
headers.append("cookie", this.cookieString);
|
const novel: Plugin.SourceNovel = {
|
||||||
}
|
url,
|
||||||
const result = await fetchApi(url, { headers });
|
chapters: [],
|
||||||
const body = await result.text();
|
};
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
novel.name = loadedCheerio(".entry-title").text();
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
novel.cover =
|
||||||
url,
|
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
||||||
chapters: [],
|
loadedCheerio("img.wp-post-image").attr("src");
|
||||||
};
|
|
||||||
|
loadedCheerio("div.spe > span").each(function () {
|
||||||
novel.name = loadedCheerio(".entry-title").text();
|
const detailName = loadedCheerio(this).find("b").text().trim();
|
||||||
|
const detail = loadedCheerio(this)
|
||||||
novel.cover =
|
.find("b")
|
||||||
loadedCheerio("img.wp-post-image").attr("data-src") ||
|
.remove()
|
||||||
loadedCheerio("img.wp-post-image").attr("src");
|
.end()
|
||||||
|
.text()
|
||||||
loadedCheerio("div.spe > span").each(function () {
|
.trim();
|
||||||
const detailName = loadedCheerio(this).find("b").text().trim();
|
|
||||||
const detail = loadedCheerio(this)
|
switch (detailName) {
|
||||||
.find("b")
|
case "Yazar:":
|
||||||
.remove()
|
novel.author = detail;
|
||||||
.end()
|
break;
|
||||||
.text()
|
case "Seviye:":
|
||||||
.trim();
|
novel.status = detail;
|
||||||
|
break;
|
||||||
switch (detailName) {
|
}
|
||||||
case "Yazar:":
|
});
|
||||||
novel.author = detail;
|
|
||||||
break;
|
novel.genres = loadedCheerio(".genxed")
|
||||||
case "Seviye:":
|
.text()
|
||||||
novel.status = detail;
|
.trim()
|
||||||
break;
|
.replace(/\s/g, ",");
|
||||||
}
|
|
||||||
});
|
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
||||||
|
novel.summary = loadedCheerio('div[itemprop="description"]')
|
||||||
novel.genres = loadedCheerio(".genxed")
|
.find("br")
|
||||||
.text()
|
.replaceWith("\n")
|
||||||
.trim()
|
.end()
|
||||||
.replace(/\s/g, ",");
|
.text();
|
||||||
|
|
||||||
loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove();
|
let chapter: Plugin.ChapterItem[] = [];
|
||||||
novel.summary = loadedCheerio('div[itemprop="description"]')
|
|
||||||
.find("br")
|
loadedCheerio(".eplister")
|
||||||
.replaceWith("\n")
|
.find("li")
|
||||||
.end()
|
.each(function () {
|
||||||
.text();
|
const chapterName =
|
||||||
|
loadedCheerio(this).find(".epl-num").text() +
|
||||||
let chapter: Plugin.ChapterItem[] = [];
|
" - " +
|
||||||
|
loadedCheerio(this).find(".epl-title").text();
|
||||||
loadedCheerio(".eplister")
|
|
||||||
.find("li")
|
const releaseDate = loadedCheerio(this)
|
||||||
.each(function () {
|
.find(".epl-date")
|
||||||
const chapterName =
|
.text()
|
||||||
loadedCheerio(this).find(".epl-num").text() +
|
.trim();
|
||||||
" - " +
|
|
||||||
loadedCheerio(this).find(".epl-title").text();
|
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
|
|
||||||
const releaseDate = loadedCheerio(this)
|
if (!chapterUrl) return;
|
||||||
.find(".epl-date")
|
|
||||||
.text()
|
chapter.push({
|
||||||
.trim();
|
name: chapterName,
|
||||||
|
releaseTime: releaseDate,
|
||||||
const chapterUrl = loadedCheerio(this).find("a").attr("href");
|
url: chapterUrl,
|
||||||
|
});
|
||||||
if (!chapterUrl) return;
|
});
|
||||||
|
|
||||||
chapter.push({
|
novel.chapters = chapter.reverse();
|
||||||
name: chapterName,
|
|
||||||
releaseTime: releaseDate,
|
return novel;
|
||||||
url: chapterUrl,
|
}
|
||||||
});
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
});
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(chapterUrl, { headers });
|
||||||
novel.chapters = chapter.reverse();
|
const body = await result.text();
|
||||||
|
|
||||||
return novel;
|
const loadedCheerio = parseHTML(body);
|
||||||
}
|
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
let chapterText = loadedCheerio(".epcontent").html() || "";
|
||||||
const headers = new Headers();
|
|
||||||
if (this.cookieString) {
|
return chapterText;
|
||||||
headers.append("cookie", this.cookieString);
|
}
|
||||||
}
|
|
||||||
const result = await fetchApi(chapterUrl, { headers });
|
async searchNovels(
|
||||||
const body = await result.text();
|
searchTerm: string,
|
||||||
|
pageNo?: number | undefined
|
||||||
const loadedCheerio = parseHTML(body);
|
): Promise<Plugin.NovelItem[]> {
|
||||||
|
const url = `${this.site}?s=${searchTerm}`;
|
||||||
let chapterText = loadedCheerio(".epcontent").html() || "";
|
const headers = new Headers();
|
||||||
|
const result = await fetchApi(url, { headers });
|
||||||
return chapterText;
|
const body = await result.text();
|
||||||
}
|
|
||||||
|
const loadedCheerio = parseHTML(body);
|
||||||
async searchNovels(
|
|
||||||
searchTerm: string,
|
const novels: Plugin.NovelItem[] = [];
|
||||||
pageNo?: number | undefined
|
|
||||||
): Promise<Plugin.NovelItem[]> {
|
loadedCheerio("article.bs").each(function () {
|
||||||
const url = `${this.site}?s=${searchTerm}`;
|
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
||||||
const headers = new Headers();
|
const novelCover = loadedCheerio(this).find("img").attr("src");
|
||||||
if (this.cookieString) {
|
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
||||||
headers.append("cookie", this.cookieString);
|
if (!novelUrl) return;
|
||||||
}
|
|
||||||
const result = await fetchApi(url, { headers });
|
novels.push({
|
||||||
const body = await result.text();
|
name: novelName,
|
||||||
|
url: novelUrl,
|
||||||
const loadedCheerio = parseHTML(body);
|
cover: novelCover,
|
||||||
|
});
|
||||||
const novels: Plugin.NovelItem[] = [];
|
});
|
||||||
|
|
||||||
loadedCheerio("article.bs").each(function () {
|
return novels;
|
||||||
const novelName = loadedCheerio(this).find(".ntitle").text().trim();
|
}
|
||||||
const novelCover = loadedCheerio(this).find("img").attr("src");
|
async fetchImage(url: string): Promise<string | undefined> {
|
||||||
const novelUrl = loadedCheerio(this).find("a").attr("href");
|
return await fetchFile(url);
|
||||||
if (!novelUrl) return;
|
}
|
||||||
|
|
||||||
novels.push({
|
filters = {
|
||||||
name: novelName,
|
order: {
|
||||||
url: novelUrl,
|
value: "popular",
|
||||||
cover: novelCover,
|
label: "Önerilen",
|
||||||
});
|
options: [
|
||||||
});
|
{ label: "Varsayılan", value: "" },
|
||||||
|
|
||||||
return novels;
|
{ label: "A-Z", value: "title" },
|
||||||
}
|
|
||||||
async fetchImage(url: string): Promise<string | undefined> {
|
{ label: "Z-A", value: "titlereverse" },
|
||||||
return await fetchFile(url);
|
|
||||||
}
|
{ label: "Son Yüklemeler", value: "update" },
|
||||||
|
|
||||||
filters = {
|
{ label: "Son Eklenenler", value: "latest" },
|
||||||
order: {
|
|
||||||
value: "popular",
|
{ label: "Bestimiz", value: "popular" },
|
||||||
label: "Önerilen",
|
],
|
||||||
options: [
|
type: FilterTypes.Picker,
|
||||||
{ label: "Varsayılan", value: "" },
|
},
|
||||||
|
status: {
|
||||||
{ label: "A-Z", value: "title" },
|
label: "Statü",
|
||||||
|
value: "",
|
||||||
{ label: "Z-A", value: "titlereverse" },
|
options: [
|
||||||
|
{ label: "Tümü", value: "" },
|
||||||
{ label: "Son Yüklemeler", value: "update" },
|
|
||||||
|
{ label: "Ongoing", value: "ongoing" },
|
||||||
{ label: "Son Eklenenler", value: "latest" },
|
|
||||||
|
{ label: "Hiatus", value: "hiatus" },
|
||||||
{ label: "Bestimiz", value: "popular" },
|
|
||||||
],
|
{ label: "Completed", value: "completed" },
|
||||||
type: FilterTypes.Picker,
|
],
|
||||||
},
|
type: FilterTypes.Picker,
|
||||||
status: {
|
},
|
||||||
label: "Statü",
|
type: {
|
||||||
value: "",
|
value: [],
|
||||||
options: [
|
label: "Tür",
|
||||||
{ label: "Tümü", value: "" },
|
options: [
|
||||||
|
{ label: "Çeviri Novel", value: "ceviri-novel" },
|
||||||
{ label: "Ongoing", value: "ongoing" },
|
|
||||||
|
{ label: "Liz-Chan", value: "liz-chan" },
|
||||||
{ label: "Hiatus", value: "hiatus" },
|
|
||||||
|
{ label: "Manhwa", value: "manhwa" },
|
||||||
{ label: "Completed", value: "completed" },
|
|
||||||
],
|
{ label: "Orijinal Novel", value: "orijinal-novel" },
|
||||||
type: FilterTypes.Picker,
|
|
||||||
},
|
{ label: "Web Novel", value: "web-novel" },
|
||||||
type: {
|
],
|
||||||
value: [],
|
type: FilterTypes.CheckboxGroup,
|
||||||
label: "Tür",
|
},
|
||||||
options: [
|
genres: {
|
||||||
{ label: "Çeviri Novel", value: "ceviri-novel" },
|
value: [],
|
||||||
|
label: "Kategori",
|
||||||
{ label: "Liz-Chan", value: "liz-chan" },
|
options: [
|
||||||
|
{ label: "+18", value: "18" },
|
||||||
{ label: "Manhwa", value: "manhwa" },
|
|
||||||
|
{ label: "Action", value: "action" },
|
||||||
{ label: "Orijinal Novel", value: "orijinal-novel" },
|
|
||||||
|
{ label: "Adult", value: "adult" },
|
||||||
{ label: "Web Novel", value: "web-novel" },
|
|
||||||
],
|
{ label: "Aksiyon", value: "aksiyon" },
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
{ label: "BL", value: "bl" },
|
||||||
genres: {
|
|
||||||
value: [],
|
{ label: "Comedy", value: "comedy" },
|
||||||
label: "Kategori",
|
|
||||||
options: [
|
{ label: "Doğaüstü", value: "dogaustu" },
|
||||||
{ label: "+18", value: "18" },
|
|
||||||
|
{ label: "Dram", value: "dram" },
|
||||||
{ label: "Action", value: "action" },
|
|
||||||
|
{ label: "Drama", value: "drama" },
|
||||||
{ label: "Adult", value: "adult" },
|
|
||||||
|
{ label: "Ecchi", value: "ecchi" },
|
||||||
{ label: "Aksiyon", value: "aksiyon" },
|
|
||||||
|
{ label: "Fantastik", value: "fantastik" },
|
||||||
{ label: "BL", value: "bl" },
|
|
||||||
|
{ label: "Fantasy", value: "fantasy" },
|
||||||
{ label: "Comedy", value: "comedy" },
|
|
||||||
|
{ label: "Gizem", value: "gizem" },
|
||||||
{ label: "Doğaüstü", value: "dogaustu" },
|
|
||||||
|
{ label: "Harem", value: "harem" },
|
||||||
{ label: "Dram", value: "dram" },
|
|
||||||
|
{ label: "Historical", value: "historical" },
|
||||||
{ label: "Drama", value: "drama" },
|
|
||||||
|
{ label: "Josei", value: "josei" },
|
||||||
{ label: "Ecchi", value: "ecchi" },
|
|
||||||
|
{ label: "Macera", value: "macera" },
|
||||||
{ label: "Fantastik", value: "fantastik" },
|
|
||||||
|
{ label: "Manhwa", value: "manhwa" },
|
||||||
{ label: "Fantasy", value: "fantasy" },
|
|
||||||
|
{ label: "Martial Arts", value: "martial-arts" },
|
||||||
{ label: "Gizem", value: "gizem" },
|
|
||||||
|
{ label: "Mature", value: "mature" },
|
||||||
{ label: "Harem", value: "harem" },
|
|
||||||
|
{ label: "Novel", value: "novel" },
|
||||||
{ label: "Historical", value: "historical" },
|
|
||||||
|
{ label: "Okul", value: "okul" },
|
||||||
{ label: "Josei", value: "josei" },
|
|
||||||
|
{ label: "Psikolojik", value: "psikolojik" },
|
||||||
{ label: "Macera", value: "macera" },
|
|
||||||
|
{ label: "Psychological", value: "psychological" },
|
||||||
{ label: "Manhwa", value: "manhwa" },
|
|
||||||
|
{ label: "Reverse Harem", value: "reverse-harem" },
|
||||||
{ label: "Martial Arts", value: "martial-arts" },
|
|
||||||
|
{ label: "Romance", value: "romance" },
|
||||||
{ label: "Mature", value: "mature" },
|
|
||||||
|
{ label: "Romantik", value: "romantik" },
|
||||||
{ label: "Novel", value: "novel" },
|
|
||||||
|
{ label: "Shoujo", value: "shoujo" },
|
||||||
{ label: "Okul", value: "okul" },
|
|
||||||
|
{ label: "Slice Of Life", value: "slice-of-life" },
|
||||||
{ label: "Psikolojik", value: "psikolojik" },
|
|
||||||
|
{ label: "Smut", value: "smut" },
|
||||||
{ label: "Psychological", value: "psychological" },
|
|
||||||
|
{ label: "Supernatural", value: "supernatural" },
|
||||||
{ label: "Reverse Harem", value: "reverse-harem" },
|
|
||||||
|
{ label: "Tarihi", value: "tarihi" },
|
||||||
{ label: "Romance", value: "romance" },
|
|
||||||
|
{ label: "Tragedy", value: "tragedy" },
|
||||||
{ label: "Romantik", value: "romantik" },
|
|
||||||
|
{ label: "Yaoi", value: "yaoi" },
|
||||||
{ label: "Shoujo", value: "shoujo" },
|
],
|
||||||
|
type: FilterTypes.CheckboxGroup,
|
||||||
{ label: "Slice Of Life", value: "slice-of-life" },
|
},
|
||||||
|
} satisfies Filters;
|
||||||
{ label: "Smut", value: "smut" },
|
}
|
||||||
|
|
||||||
{ label: "Supernatural", value: "supernatural" },
|
export default new LSHNovel();
|
||||||
|
|
||||||
{ label: "Tarihi", value: "tarihi" },
|
|
||||||
|
|
||||||
{ label: "Tragedy", value: "tragedy" },
|
|
||||||
|
|
||||||
{ label: "Yaoi", value: "yaoi" },
|
|
||||||
],
|
|
||||||
type: FilterTypes.CheckboxGroup,
|
|
||||||
},
|
|
||||||
} satisfies Filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new LSHNovel();
|
|
||||||
|
|||||||
+255
-256
@@ -1,256 +1,255 @@
|
|||||||
import { Plugin } from "@typings/plugin";
|
import { Plugin } from "@typings/plugin";
|
||||||
import { fetchApi, fetchFile } from "@libs/fetch";
|
import { fetchApi, fetchFile } from "@libs/fetch";
|
||||||
import { NovelStatus } from "@libs/novelStatus";
|
import { NovelStatus } from "@libs/novelStatus";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
class Smakolykytl implements Plugin.PluginBase {
|
class Smakolykytl implements Plugin.PluginBase {
|
||||||
id = "smakolykytl";
|
id = "smakolykytl";
|
||||||
name = "Смаколики";
|
name = "Смаколики";
|
||||||
site = "https://smakolykytl.site/";
|
site = "https://smakolykytl.site/";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
icon = "src/ua/smakolykytl/icon.png";
|
icon = "src/ua/smakolykytl/icon.png";
|
||||||
userAgent = "";
|
userAgent = "";
|
||||||
cookieString = "";
|
|
||||||
|
async popularNovels(
|
||||||
async popularNovels(
|
pageNo: number,
|
||||||
pageNo: number,
|
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions,
|
||||||
{ showLatestNovels, filters }: Plugin.PopularNovelsOptions,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const url = showLatestNovels
|
||||||
const url = showLatestNovels
|
? "https://api.smakolykytl.site/api/user/updates"
|
||||||
? "https://api.smakolykytl.site/api/user/updates"
|
: "https://api.smakolykytl.site/api/user/projects";
|
||||||
: "https://api.smakolykytl.site/api/user/projects";
|
|
||||||
|
const result = await fetchApi(url);
|
||||||
const result = await fetchApi(url);
|
const json = (await result.json()) as response;
|
||||||
const json = (await result.json()) as response;
|
|
||||||
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
(json?.projects || json?.updates)?.forEach((novel) =>
|
||||||
(json?.projects || json?.updates)?.forEach((novel) =>
|
novels.push({
|
||||||
novels.push({
|
name: novel.title,
|
||||||
name: novel.title,
|
cover: novel.image.url,
|
||||||
cover: novel.image.url,
|
url: this.site + "titles/" + novel.id,
|
||||||
url: this.site + "titles/" + novel.id,
|
}),
|
||||||
}),
|
);
|
||||||
);
|
|
||||||
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
const id = novelUrl.split("/").pop();
|
||||||
const id = novelUrl.split("/").pop();
|
const result = await fetchApi(
|
||||||
const result = await fetchApi(
|
"https://api.smakolykytl.site/api/user/projects/" + id,
|
||||||
"https://api.smakolykytl.site/api/user/projects/" + id,
|
);
|
||||||
);
|
const book = (await result.json()) as response;
|
||||||
const book = (await result.json()) as response;
|
|
||||||
|
const novel: Plugin.SourceNovel = {
|
||||||
const novel: Plugin.SourceNovel = {
|
url: novelUrl,
|
||||||
url: novelUrl,
|
name: book?.project?.title,
|
||||||
name: book?.project?.title,
|
cover: book?.project?.image?.url,
|
||||||
cover: book?.project?.image?.url,
|
summary: book?.project?.description,
|
||||||
summary: book?.project?.description,
|
author: book?.project?.author,
|
||||||
author: book?.project?.author,
|
status: book?.project?.status_translate.includes("Триває")
|
||||||
status: book?.project?.status_translate.includes("Триває")
|
? NovelStatus.Ongoing
|
||||||
? NovelStatus.Ongoing
|
: NovelStatus.Completed,
|
||||||
: NovelStatus.Completed,
|
};
|
||||||
};
|
const tags = [book?.project?.genres, book?.project?.tags]
|
||||||
const tags = [book?.project?.genres, book?.project?.tags]
|
.flat()
|
||||||
.flat()
|
.map((tags) => tags?.title)
|
||||||
.map((tags) => tags?.title)
|
.filter((tags) => tags);
|
||||||
.filter((tags) => tags);
|
|
||||||
|
if (tags.length) {
|
||||||
if (tags.length) {
|
novel.genres = tags.join(", ");
|
||||||
novel.genres = tags.join(", ");
|
}
|
||||||
}
|
|
||||||
|
const chapters: Plugin.ChapterItem[] = [];
|
||||||
const chapters: Plugin.ChapterItem[] = [];
|
const res = await fetchApi(
|
||||||
const res = await fetchApi(
|
"https://api.smakolykytl.site/api/user/projects/" + id + "/books",
|
||||||
"https://api.smakolykytl.site/api/user/projects/" + id + "/books",
|
);
|
||||||
);
|
const data = (await res.json()) as response;
|
||||||
const data = (await res.json()) as response;
|
data?.books?.forEach(
|
||||||
data?.books?.forEach(
|
(volume) =>
|
||||||
(volume) =>
|
volume?.chapters?.map((chapter) =>
|
||||||
volume?.chapters?.map((chapter) =>
|
chapters.push({
|
||||||
chapters.push({
|
name: volume.title + " " + chapter.title,
|
||||||
name: volume.title + " " + chapter.title,
|
releaseTime: dayjs(chapter.modifiedAt).format("LLL"),
|
||||||
releaseTime: dayjs(chapter.modifiedAt).format("LLL"),
|
url: this.site + "read/" + chapter.id,
|
||||||
url: this.site + "read/" + chapter.id,
|
}),
|
||||||
}),
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
|
novel.chapters = chapters;
|
||||||
novel.chapters = chapters;
|
return novel;
|
||||||
return novel;
|
}
|
||||||
}
|
|
||||||
|
async parseChapter(chapterUrl: string): Promise<string> {
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
const id = chapterUrl.split("/").pop();
|
||||||
const id = chapterUrl.split("/").pop();
|
const result = await fetchApi(
|
||||||
const result = await fetchApi(
|
"https://api.smakolykytl.site/api/user/chapters/" + id,
|
||||||
"https://api.smakolykytl.site/api/user/chapters/" + id,
|
);
|
||||||
);
|
const json = (await result.json()) as response;
|
||||||
const json = (await result.json()) as response;
|
const chapterRaw: HTML[] = JSON.parse(json?.chapter?.content || "[]");
|
||||||
const chapterRaw: HTML[] = JSON.parse(json?.chapter?.content || "[]");
|
|
||||||
|
const chapterText = jsonToHtml(chapterRaw);
|
||||||
const chapterText = jsonToHtml(chapterRaw);
|
return chapterText;
|
||||||
return chapterText;
|
}
|
||||||
}
|
|
||||||
|
async searchNovels(
|
||||||
async searchNovels(
|
searchTerm: string,
|
||||||
searchTerm: string,
|
//pageNo: number | undefined = 1,
|
||||||
//pageNo: number | undefined = 1,
|
): Promise<Plugin.NovelItem[]> {
|
||||||
): Promise<Plugin.NovelItem[]> {
|
const result = await fetchApi(
|
||||||
const result = await fetchApi(
|
"https://api.smakolykytl.site/api/user/projects",
|
||||||
"https://api.smakolykytl.site/api/user/projects",
|
);
|
||||||
);
|
const json = (await result.json()) as response;
|
||||||
const json = (await result.json()) as response;
|
const novels: Plugin.NovelItem[] = [];
|
||||||
const novels: Plugin.NovelItem[] = [];
|
|
||||||
|
json?.projects
|
||||||
json?.projects
|
?.filter(
|
||||||
?.filter(
|
(novel) =>
|
||||||
(novel) =>
|
novel.title.includes(searchTerm) || String(novel.id) === searchTerm,
|
||||||
novel.title.includes(searchTerm) || String(novel.id) === searchTerm,
|
)
|
||||||
)
|
?.forEach((novel) =>
|
||||||
?.forEach((novel) =>
|
novels.push({
|
||||||
novels.push({
|
name: novel.title,
|
||||||
name: novel.title,
|
cover: novel.image.url,
|
||||||
cover: novel.image.url,
|
url: this.site + "titles/" + novel.id,
|
||||||
url: this.site + "titles/" + novel.id,
|
}),
|
||||||
}),
|
);
|
||||||
);
|
return novels;
|
||||||
return novels;
|
}
|
||||||
}
|
|
||||||
|
fetchImage = fetchFile;
|
||||||
fetchImage = fetchFile;
|
}
|
||||||
}
|
|
||||||
|
export default new Smakolykytl();
|
||||||
export default new Smakolykytl();
|
|
||||||
|
function jsonToHtml(json: HTML[], html: string = "") {
|
||||||
function jsonToHtml(json: HTML[], html: string = "") {
|
json.forEach((element) => {
|
||||||
json.forEach((element) => {
|
switch (element.type) {
|
||||||
switch (element.type) {
|
case "hardBreak":
|
||||||
case "hardBreak":
|
html += "<br>";
|
||||||
html += "<br>";
|
break;
|
||||||
break;
|
case "horizontalRule":
|
||||||
case "horizontalRule":
|
html += "<hr>";
|
||||||
html += "<hr>";
|
break;
|
||||||
break;
|
case "image":
|
||||||
case "image":
|
if (element.attrs) {
|
||||||
if (element.attrs) {
|
const attrs = Object.entries(element.attrs)
|
||||||
const attrs = Object.entries(element.attrs)
|
.filter((attr) => attr?.[1])
|
||||||
.filter((attr) => attr?.[1])
|
.map((attr) => `${attr[0]}="${attr[1]}"`);
|
||||||
.map((attr) => `${attr[0]}="${attr[1]}"`);
|
html += "<img " + attrs.join("; ") + ">";
|
||||||
html += "<img " + attrs.join("; ") + ">";
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case "paragraph":
|
||||||
case "paragraph":
|
html +=
|
||||||
html +=
|
"<p>" +
|
||||||
"<p>" +
|
(element.content ? jsonToHtml(element.content) : "<br>") +
|
||||||
(element.content ? jsonToHtml(element.content) : "<br>") +
|
"</p>";
|
||||||
"</p>";
|
break;
|
||||||
break;
|
case "text":
|
||||||
case "text":
|
html += element.text;
|
||||||
html += element.text;
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
html += JSON.stringify(element, null, "\t"); //maybe I missed something.
|
||||||
html += JSON.stringify(element, null, "\t"); //maybe I missed something.
|
break;
|
||||||
break;
|
}
|
||||||
}
|
});
|
||||||
});
|
return html;
|
||||||
return html;
|
}
|
||||||
}
|
|
||||||
|
interface response {
|
||||||
interface response {
|
projects?: TopLevelProject[];
|
||||||
projects?: TopLevelProject[];
|
updates?: Update[];
|
||||||
updates?: Update[];
|
project?: TopLevelProject;
|
||||||
project?: TopLevelProject;
|
books?: BookElement[];
|
||||||
books?: BookElement[];
|
chapter?: TopLevelChapter;
|
||||||
chapter?: TopLevelChapter;
|
}
|
||||||
}
|
|
||||||
|
interface BookElement {
|
||||||
interface BookElement {
|
id: number;
|
||||||
id: number;
|
rank: number;
|
||||||
rank: number;
|
title: string;
|
||||||
title: string;
|
chapters: PurpleChapter[];
|
||||||
chapters: PurpleChapter[];
|
}
|
||||||
}
|
|
||||||
|
interface PurpleChapter {
|
||||||
interface PurpleChapter {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
rank: string;
|
||||||
rank: string;
|
modifiedAt: Date;
|
||||||
modifiedAt: Date;
|
}
|
||||||
}
|
|
||||||
|
interface TopLevelChapter {
|
||||||
interface TopLevelChapter {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
rank: string;
|
||||||
rank: string;
|
content: string;
|
||||||
content: string;
|
modifiedAt: Date;
|
||||||
modifiedAt: Date;
|
book: ChapterBook;
|
||||||
book: ChapterBook;
|
}
|
||||||
}
|
|
||||||
|
interface ChapterBook {
|
||||||
interface ChapterBook {
|
id: number;
|
||||||
id: number;
|
rank: number;
|
||||||
rank: number;
|
title: string;
|
||||||
title: string;
|
chapters: FluffyChapter[];
|
||||||
chapters: FluffyChapter[];
|
project: BookProject;
|
||||||
project: BookProject;
|
}
|
||||||
}
|
|
||||||
|
interface FluffyChapter {
|
||||||
interface FluffyChapter {
|
id: number;
|
||||||
id: number;
|
rank: string;
|
||||||
rank: string;
|
}
|
||||||
}
|
|
||||||
|
interface BookProject {
|
||||||
interface BookProject {
|
id: number;
|
||||||
id: number;
|
}
|
||||||
}
|
|
||||||
|
interface TopLevelProject {
|
||||||
interface TopLevelProject {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
description: string;
|
||||||
description: string;
|
author: string;
|
||||||
author: string;
|
translator: string;
|
||||||
translator: string;
|
modifiedAt: Date;
|
||||||
modifiedAt: Date;
|
alternatives: string;
|
||||||
alternatives: string;
|
release: string;
|
||||||
release: string;
|
nation: string;
|
||||||
nation: string;
|
status: string;
|
||||||
status: string;
|
status_translate: string;
|
||||||
status_translate: string;
|
image: Image;
|
||||||
image: Image;
|
tags?: Genre[];
|
||||||
tags?: Genre[];
|
genres?: Genre[];
|
||||||
genres?: Genre[];
|
}
|
||||||
}
|
|
||||||
|
interface Genre {
|
||||||
interface Genre {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
}
|
||||||
}
|
|
||||||
|
interface Image {
|
||||||
interface Image {
|
id: number;
|
||||||
id: number;
|
url: string;
|
||||||
url: string;
|
name: string;
|
||||||
name: string;
|
}
|
||||||
}
|
|
||||||
|
interface Update {
|
||||||
interface Update {
|
id: number;
|
||||||
id: number;
|
title: string;
|
||||||
title: string;
|
author: string;
|
||||||
author: string;
|
translator: string;
|
||||||
translator: string;
|
modifiedAt: Date;
|
||||||
modifiedAt: Date;
|
image: Image;
|
||||||
image: Image;
|
}
|
||||||
}
|
|
||||||
|
interface HTML {
|
||||||
interface HTML {
|
type: string;
|
||||||
type: string;
|
content?: HTML[];
|
||||||
content?: HTML[];
|
attrs?: Attrs;
|
||||||
attrs?: Attrs;
|
text?: string;
|
||||||
text?: string;
|
}
|
||||||
}
|
|
||||||
|
interface Attrs {
|
||||||
interface Attrs {
|
src: string;
|
||||||
src: string;
|
alt: string | null;
|
||||||
alt: string | null;
|
title: string | null;
|
||||||
title: string | null;
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class HakoPlugin implements Plugin.PluginBase {
|
|||||||
site: string;
|
site: string;
|
||||||
version: string;
|
version: string;
|
||||||
userAgent: string;
|
userAgent: string;
|
||||||
cookieString: string;
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.id = "ln.hako";
|
this.id = "ln.hako";
|
||||||
this.name = "Hako";
|
this.name = "Hako";
|
||||||
@@ -17,7 +17,6 @@ class HakoPlugin implements Plugin.PluginBase {
|
|||||||
this.site = "https://ln.hako.vn";
|
this.site = "https://ln.hako.vn";
|
||||||
this.version = "1.0.0";
|
this.version = "1.0.0";
|
||||||
this.userAgent = "";
|
this.userAgent = "";
|
||||||
this.cookieString = "";
|
|
||||||
}
|
}
|
||||||
parseNovels(loadedCheerio: CheerioAPI) {
|
parseNovels(loadedCheerio: CheerioAPI) {
|
||||||
const novels: Plugin.NovelItem[] = [];
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user