From e959ddb7996640a3efe6b148dc108ee0639df22d Mon Sep 17 00:00:00 2001 From: Aidan Juma Date: Thu, 10 Nov 2022 16:29:02 +0000 Subject: [PATCH] =?UTF-8?q?R.I.P.=20Z-Library=20=F0=9F=92=80=20(#105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/models/index.d.ts | 6 +- dist/models/index.js | 3 +- dist/models/index.js.map | 2 +- dist/models/news-parser.js.map | 2 +- dist/models/type-objects.d.ts | 21 +-- dist/models/type-objects.js | 24 +-- dist/models/type-objects.js.map | 2 +- dist/models/types.d.ts | 7 - dist/models/types.js.map | 2 +- dist/providers/books/index.d.ts | 2 - dist/providers/books/index.js | 3 +- dist/providers/books/index.js.map | 2 +- dist/providers/index.js.map | 2 +- dist/providers/news/animenewsnetwork.js | 15 +- dist/providers/news/animenewsnetwork.js.map | 2 +- dist/providers/news/index.js.map | 2 +- dist/utils/index.d.ts | 3 +- dist/utils/index.js | 4 +- dist/utils/index.js.map | 2 +- dist/utils/providers-list.d.ts | 2 +- dist/utils/providers-list.js | 8 +- dist/utils/providers-list.js.map | 2 +- dist/utils/utils.js | 9 +- dist/utils/utils.js.map | 2 +- docs/guides/books.md | 1 - docs/providers/zLibrary.md | 37 ----- src/models/index.ts | 5 +- src/models/news-parser.ts | 4 +- src/models/type-objects.ts | 22 +-- src/models/types.ts | 8 - src/providers/books/index.ts | 3 +- src/providers/books/zLibrary.ts | 113 -------------- src/providers/index.ts | 4 +- src/providers/news/animenewsnetwork.ts | 160 +++++++++++--------- src/providers/news/index.ts | 4 +- src/utils/index.ts | 2 - src/utils/providers-list.ts | 8 +- src/utils/utils.ts | 58 ++++--- src/utils/zLibrary.ts | 7 - test/books/zLibrary.test.ts | 9 -- 40 files changed, 172 insertions(+), 402 deletions(-) delete mode 100644 docs/providers/zLibrary.md delete mode 100644 src/providers/books/zLibrary.ts delete mode 100644 src/utils/zLibrary.ts delete mode 100644 test/books/zLibrary.test.ts diff --git a/dist/models/index.d.ts b/dist/models/index.d.ts index e9fbb9972..6527c6ea5 100644 --- a/dist/models/index.d.ts +++ b/dist/models/index.d.ts @@ -8,6 +8,6 @@ import MangaParser from './manga-parser'; import LightNovelParser from './lightnovel-parser'; import MovieParser from './movie-parser'; import NewsParser from './news-parser'; -import { IProviderStats, ISearch, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, LibgenBook, StreamingServers, MediaStatus, SubOrSub, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, GetComicsComics, ComicRes, ZLibrary, IMangaChapterPage, TvType, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, INewsFeed, Topics, INewsInfo, FuzzyDate, ITitle, MediaFormat, ProxyConfig } from './types'; -import { LibgenBookObject, GetComicsComicsObject, ZLibraryObject } from './type-objects'; -export { BaseProvider, IProviderStats, BaseParser, AnimeParser, BookParser, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, VideoExtractor, LibgenBook, LibgenBookObject, StreamingServers, MediaStatus, SubOrSub, LightNovelParser, MangaParser, NewsParser, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, ComicParser, GetComicsComics, GetComicsComicsObject, ComicRes, ZLibrary, ZLibraryObject, ISearch, IMangaChapterPage, TvType, MovieParser, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, INewsFeed, Topics, INewsInfo, FuzzyDate, ITitle, MediaFormat, ProxyConfig, }; +import { IProviderStats, ISearch, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, LibgenBook, StreamingServers, MediaStatus, SubOrSub, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, GetComicsComics, ComicRes, IMangaChapterPage, TvType, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, INewsFeed, Topics, INewsInfo, FuzzyDate, ITitle, MediaFormat, ProxyConfig } from './types'; +import { LibgenBookObject, GetComicsComicsObject } from './type-objects'; +export { BaseProvider, IProviderStats, BaseParser, AnimeParser, BookParser, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, VideoExtractor, LibgenBook, LibgenBookObject, StreamingServers, MediaStatus, SubOrSub, LightNovelParser, MangaParser, NewsParser, IMangaResult, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, ComicParser, GetComicsComics, GetComicsComicsObject, ComicRes, ISearch, IMangaChapterPage, TvType, MovieParser, IMovieEpisode, IMovieInfo, ISource, ISubtitle, IMovieResult, Intro, Genres, INewsFeed, Topics, INewsInfo, FuzzyDate, ITitle, MediaFormat, ProxyConfig, }; diff --git a/dist/models/index.js b/dist/models/index.js index c60c1de7a..619fe1fc0 100644 --- a/dist/models/index.js +++ b/dist/models/index.js @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.MediaFormat = exports.Topics = exports.Genres = exports.MovieParser = exports.TvType = exports.ZLibraryObject = exports.GetComicsComicsObject = exports.ComicParser = exports.NewsParser = exports.MangaParser = exports.LightNovelParser = exports.SubOrSub = exports.MediaStatus = exports.StreamingServers = exports.LibgenBookObject = exports.VideoExtractor = exports.BookParser = exports.AnimeParser = exports.BaseParser = exports.BaseProvider = void 0; +exports.MediaFormat = exports.Topics = exports.Genres = exports.MovieParser = exports.TvType = exports.GetComicsComicsObject = exports.ComicParser = exports.NewsParser = exports.MangaParser = exports.LightNovelParser = exports.SubOrSub = exports.MediaStatus = exports.StreamingServers = exports.LibgenBookObject = exports.VideoExtractor = exports.BookParser = exports.AnimeParser = exports.BaseParser = exports.BaseProvider = void 0; const base_provider_1 = __importDefault(require("./base-provider")); exports.BaseProvider = base_provider_1.default; const base_parser_1 = __importDefault(require("./base-parser")); @@ -35,5 +35,4 @@ Object.defineProperty(exports, "MediaFormat", { enumerable: true, get: function const type_objects_1 = require("./type-objects"); Object.defineProperty(exports, "LibgenBookObject", { enumerable: true, get: function () { return type_objects_1.LibgenBookObject; } }); Object.defineProperty(exports, "GetComicsComicsObject", { enumerable: true, get: function () { return type_objects_1.GetComicsComicsObject; } }); -Object.defineProperty(exports, "ZLibraryObject", { enumerable: true, get: function () { return type_objects_1.ZLibraryObject; } }); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/models/index.js.map b/dist/models/index.js.map index 5e3ffaaaa..d2b9a9995 100644 --- a/dist/models/index.js.map +++ b/dist/models/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA2C;AAoDzC,uBApDK,uBAAY,CAoDL;AAnDd,gEAAuC;AAqDrC,qBArDK,qBAAU,CAqDL;AApDZ,kEAAyC;AAqDvC,sBArDK,sBAAW,CAqDL;AApDb,gEAAuC;AAqDrC,qBArDK,qBAAU,CAqDL;AApDZ,kEAAyC;AA0EvC,sBA1EK,sBAAW,CA0EL;AAzEb,wEAA+C;AAyD7C,yBAzDK,yBAAc,CAyDL;AAxDhB,kEAAyC;AA+DvC,sBA/DK,sBAAW,CA+DL;AA9Db,4EAAmD;AA6DjD,2BA7DK,2BAAgB,CA6DL;AA5DlB,kEAAyC;AA+EvC,sBA/EK,sBAAW,CA+EL;AA9Eb,gEAAuC;AA6DrC,qBA7DK,qBAAU,CA6DL;AA5DZ,mCAsCiB;AAiBf,iGA9CA,wBAAgB,OA8CA;AAChB,4FA9CA,mBAAW,OA8CA;AACX,yFA9CA,gBAAQ,OA8CA;AAmBR,uFArDA,cAAM,OAqDA;AAQN,uFAtDA,cAAM,OAsDA;AAEN,uFAtDA,cAAM,OAsDA;AAIN,4FAtDA,mBAAW,OAsDA;AAnDb,iDAAyF;AAevF,iGAfO,+BAAgB,OAeP;AAgBhB,sGA/ByB,oCAAqB,OA+BzB;AAGrB,+FAlCgD,6BAAc,OAkChD"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA2C;AAmDzC,uBAnDK,uBAAY,CAmDL;AAlDd,gEAAuC;AAoDrC,qBApDK,qBAAU,CAoDL;AAnDZ,kEAAyC;AAoDvC,sBApDK,sBAAW,CAoDL;AAnDb,gEAAuC;AAoDrC,qBApDK,qBAAU,CAoDL;AAnDZ,kEAAyC;AAyEvC,sBAzEK,sBAAW,CAyEL;AAxEb,wEAA+C;AAwD7C,yBAxDK,yBAAc,CAwDL;AAvDhB,kEAAyC;AA8DvC,sBA9DK,sBAAW,CA8DL;AA7Db,4EAAmD;AA4DjD,2BA5DK,2BAAgB,CA4DL;AA3DlB,kEAAyC;AA4EvC,sBA5EK,sBAAW,CA4EL;AA3Eb,gEAAuC;AA4DrC,qBA5DK,qBAAU,CA4DL;AA3DZ,mCAqCiB;AAiBf,iGA7CA,wBAAgB,OA6CA;AAChB,4FA7CA,mBAAW,OA6CA;AACX,yFA7CA,gBAAQ,OA6CA;AAiBR,uFAnDA,cAAM,OAmDA;AAQN,uFApDA,cAAM,OAoDA;AAEN,uFApDA,cAAM,OAoDA;AAIN,4FApDA,mBAAW,OAoDA;AAjDb,iDAAyE;AAevE,iGAfO,+BAAgB,OAeP;AAgBhB,sGA/ByB,oCAAqB,OA+BzB"} \ No newline at end of file diff --git a/dist/models/news-parser.js.map b/dist/models/news-parser.js.map index 627d07d97..e8c72fb2d 100644 --- a/dist/models/news-parser.js.map +++ b/dist/models/news-parser.js.map @@ -1 +1 @@ -{"version":3,"file":"news-parser.js","sourceRoot":"","sources":["../../src/models/news-parser.ts"],"names":[],"mappings":";;AAAA,wBAAgC;AAEhC,MAAe,UAAW,SAAQ,eAAY;CAAG;AACjD,kBAAe,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"news-parser.js","sourceRoot":"","sources":["../../src/models/news-parser.ts"],"names":[],"mappings":";;AAAA,wBAAiC;AAEjC,MAAe,UAAW,SAAQ,eAAY;CAAG;AACjD,kBAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/dist/models/type-objects.d.ts b/dist/models/type-objects.d.ts index bf478ec10..f68c7d41b 100644 --- a/dist/models/type-objects.d.ts +++ b/dist/models/type-objects.d.ts @@ -1,5 +1,5 @@ import { Hashes } from './base-types'; -import { GetComicsComics, LibgenBook, ZLibrary } from './types'; +import { GetComicsComics, LibgenBook } from './types'; export declare class LibgenBookObject implements LibgenBook { title: string; authors: never[]; @@ -45,23 +45,4 @@ export declare class GetComicsComicsObject implements GetComicsComics { zippyshare: string; readOnline: string; } -export declare class ZLibraryObject implements ZLibrary { - bookRating: string; - bookQuality: string; - description: string; - title: string; - authors: string[]; - publisher: string; - year: string; - edition: string; - volume: string; - series: string; - isbn: never[]; - link: string; - id: string; - language: string; - size: string; - pages: string; - image: string; -} export {}; diff --git a/dist/models/type-objects.js b/dist/models/type-objects.js index 0ebdc7c8d..f0c630bc7 100644 --- a/dist/models/type-objects.js +++ b/dist/models/type-objects.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ZLibraryObject = exports.GetComicsComicsObject = exports.LibgenBookObject = void 0; +exports.GetComicsComicsObject = exports.LibgenBookObject = void 0; class LibgenBookObject { constructor() { this.title = ''; @@ -54,26 +54,4 @@ class GetComicsComicsObject { } } exports.GetComicsComicsObject = GetComicsComicsObject; -class ZLibraryObject { - constructor() { - this.bookRating = ''; - this.bookQuality = ''; - this.description = ''; - this.title = ''; - this.authors = []; - this.publisher = ''; - this.year = ''; - this.edition = ''; - this.volume = ''; - this.series = ''; - this.isbn = []; - this.link = ''; - this.id = ''; - this.language = ''; - this.size = ''; - this.pages = ''; - this.image = ''; - } -} -exports.ZLibraryObject = ZLibraryObject; //# sourceMappingURL=type-objects.js.map \ No newline at end of file diff --git a/dist/models/type-objects.js.map b/dist/models/type-objects.js.map index 1b425ac98..7fe98a07a 100644 --- a/dist/models/type-objects.js.map +++ b/dist/models/type-objects.js.map @@ -1 +1 @@ -{"version":3,"file":"type-objects.js","sourceRoot":"","sources":["../../src/models/type-objects.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAA7B;QACE,UAAK,GAAG,EAAE,CAAC;QACX,YAAO,GAAG,EAAE,CAAC;QACb,cAAS,GAAG,EAAE,CAAC;QACf,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG,EAAE,CAAC;QACb,WAAM,GAAG,EAAE,CAAC;QACZ,WAAM,GAAG,EAAE,CAAC;QACZ,SAAI,GAAG,EAAE,CAAC;QACV,SAAI,GAAG,EAAE,CAAC;QACV,OAAE,GAAG,EAAE,CAAC;QACR,aAAQ,GAAG,EAAE,CAAC;QACd,WAAM,GAAG,EAAE,CAAC;QACZ,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,EAAE,CAAC;QACjB,oBAAe,GAAG,EAAE,CAAC;QACrB,UAAK,GAAG,EAAE,CAAC;QACX,WAAM,GAAG,IAAI,YAAY,EAAE,CAAC;IAC9B,CAAC;CAAA;AApBD,4CAoBC;AAED,MAAM,YAAY;IAAlB;QACE,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,YAAO,GAAG,EAAE,CAAC;QACb,QAAG,GAAG,EAAE,CAAC;QACT,SAAI,GAAG,EAAE,CAAC;QACV,WAAM,GAAG,EAAE,CAAC;QACZ,QAAG,GAAG,EAAE,CAAC;IACX,CAAC;CAAA;AAED,MAAa,qBAAqB;IAAlC;QACE,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;QACX,SAAI,GAAG,EAAE,CAAC;QACV,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG,EAAE,CAAC;QACb,gBAAW,GAAG,EAAE,CAAC;QACjB,aAAQ,GAAG,EAAE,CAAC;QACd,aAAQ,GAAG,EAAE,CAAC;QACd,UAAK,GAAG,EAAE,CAAC;QACX,SAAI,GAAG,EAAE,CAAC;QACV,cAAS,GAAG,EAAE,CAAC;QACf,eAAU,GAAG,EAAE,CAAC;QAChB,eAAU,GAAG,EAAE,CAAC;IAClB,CAAC;CAAA;AAdD,sDAcC;AAED,MAAa,cAAc;IAA3B;QACE,eAAU,GAAG,EAAE,CAAC;QAChB,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAAG,EAAE,CAAC;QACjB,UAAK,GAAG,EAAE,CAAC;QACX,YAAO,GAAa,EAAE,CAAC;QACvB,cAAS,GAAG,EAAE,CAAC;QACf,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG,EAAE,CAAC;QACb,WAAM,GAAG,EAAE,CAAC;QACZ,WAAM,GAAG,EAAE,CAAC;QACZ,SAAI,GAAG,EAAE,CAAC;QACV,SAAI,GAAG,EAAE,CAAC;QACV,OAAE,GAAG,EAAE,CAAC;QACR,aAAQ,GAAG,EAAE,CAAC;QACd,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;IACb,CAAC;CAAA;AAlBD,wCAkBC"} \ No newline at end of file +{"version":3,"file":"type-objects.js","sourceRoot":"","sources":["../../src/models/type-objects.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAA7B;QACE,UAAK,GAAG,EAAE,CAAC;QACX,YAAO,GAAG,EAAE,CAAC;QACb,cAAS,GAAG,EAAE,CAAC;QACf,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG,EAAE,CAAC;QACb,WAAM,GAAG,EAAE,CAAC;QACZ,WAAM,GAAG,EAAE,CAAC;QACZ,SAAI,GAAG,EAAE,CAAC;QACV,SAAI,GAAG,EAAE,CAAC;QACV,OAAE,GAAG,EAAE,CAAC;QACR,aAAQ,GAAG,EAAE,CAAC;QACd,WAAM,GAAG,EAAE,CAAC;QACZ,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,EAAE,CAAC;QACjB,oBAAe,GAAG,EAAE,CAAC;QACrB,UAAK,GAAG,EAAE,CAAC;QACX,WAAM,GAAG,IAAI,YAAY,EAAE,CAAC;IAC9B,CAAC;CAAA;AApBD,4CAoBC;AAED,MAAM,YAAY;IAAlB;QACE,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,YAAO,GAAG,EAAE,CAAC;QACb,QAAG,GAAG,EAAE,CAAC;QACT,SAAI,GAAG,EAAE,CAAC;QACV,WAAM,GAAG,EAAE,CAAC;QACZ,QAAG,GAAG,EAAE,CAAC;IACX,CAAC;CAAA;AAED,MAAa,qBAAqB;IAAlC;QACE,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;QACX,SAAI,GAAG,EAAE,CAAC;QACV,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG,EAAE,CAAC;QACb,gBAAW,GAAG,EAAE,CAAC;QACjB,aAAQ,GAAG,EAAE,CAAC;QACd,aAAQ,GAAG,EAAE,CAAC;QACd,UAAK,GAAG,EAAE,CAAC;QACX,SAAI,GAAG,EAAE,CAAC;QACV,cAAS,GAAG,EAAE,CAAC;QACf,eAAU,GAAG,EAAE,CAAC;QAChB,eAAU,GAAG,EAAE,CAAC;IAClB,CAAC;CAAA;AAdD,sDAcC"} \ No newline at end of file diff --git a/dist/models/types.d.ts b/dist/models/types.d.ts index 766cebd19..a274aa798 100644 --- a/dist/models/types.d.ts +++ b/dist/models/types.d.ts @@ -242,13 +242,6 @@ export interface ComicRes { containers: GetComicsComics[]; hasNextPage: boolean; } -export interface ZLibrary extends Book { - bookRating: string; - bookQuality: string; - language: string; - size: string; - pages: string; -} export interface ISubtitle { /** * The id of the subtitle. **not** required diff --git a/dist/models/types.js.map b/dist/models/types.js.map index b3a1d684c..54fe6ac27 100644 --- a/dist/models/types.js.map +++ b/dist/models/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":";;;AAuDA,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;AACvB,CAAC,EAXW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAWtB;AAwED,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;IACrB,mBAAmB;IACnB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,iDAA6B,CAAA;AAC/B,CAAC,EAZW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAY3B;AAED,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,sCAAuB,CAAA;IACvB,8CAA+B,CAAA;IAC/B,kCAAmB,CAAA;AACrB,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB;AAED,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,yBAAa,CAAA;AACf,CAAC,EAJW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAInB;AA+ID;;GAEG;AACH,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,yBAAe,CAAA;IACf,yBAAe,CAAA;AACjB,CAAC,EAJW,MAAM,GAAN,cAAM,KAAN,cAAM,QAIjB;AAsED,IAAY,MAoBX;AApBD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,yCAA+B,CAAA;IAC/B,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,+BAAqB,CAAA;AACvB,CAAC,EApBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAoBjB;AAED,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,GAAN,cAAM,KAAN,cAAM,QAajB"} \ No newline at end of file +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":";;;AAuDA,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IAC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AmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,yCAA+B,CAAA;IAC/B,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,+BAAqB,CAAA;AACvB,CAAC,EApBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAoBjB;AAED,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,GAAN,cAAM,KAAN,cAAM,QAajB"} \ No newline at end of file diff --git a/dist/providers/books/index.d.ts b/dist/providers/books/index.d.ts index 013a4fda6..4de94a646 100644 --- a/dist/providers/books/index.d.ts +++ b/dist/providers/books/index.d.ts @@ -1,7 +1,5 @@ import Libgen from './libgen'; -import ZLibrary from './zLibrary'; declare const _default: { Libgen: typeof Libgen; - ZLibrary: typeof ZLibrary; }; export default _default; diff --git a/dist/providers/books/index.js b/dist/providers/books/index.js index 2641fcd34..31ce5db11 100644 --- a/dist/providers/books/index.js +++ b/dist/providers/books/index.js @@ -4,6 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const libgen_1 = __importDefault(require("./libgen")); -const zLibrary_1 = __importDefault(require("./zLibrary")); -exports.default = { Libgen: libgen_1.default, ZLibrary: zLibrary_1.default }; +exports.default = { Libgen: libgen_1.default }; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/providers/books/index.js.map b/dist/providers/books/index.js.map index 1f64e6a2e..d99847c6c 100644 --- a/dist/providers/books/index.js.map +++ b/dist/providers/books/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/books/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAC9B,0DAAkC;AAElC,kBAAe,EAAE,MAAM,EAAN,gBAAM,EAAE,QAAQ,EAAR,kBAAQ,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/books/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAE9B,kBAAe,EAAE,MAAM,EAAN,gBAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/providers/index.js.map b/dist/providers/index.js.map index adbfced0b..5ca437da5 100644 --- a/dist/providers/index.js.map +++ b/dist/providers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AASnB,gBATF,eAAK,CASE;AARd,oDAA4B;AAQZ,gBART,eAAK,CAQS;AAPrB,kEAA0C;AAOJ,uBAP/B,sBAAY,CAO+B;AANlD,oDAA4B;AAML,gBANhB,eAAK,CAMgB;AAL5B,sDAA8B;AAKA,iBALvB,gBAAM,CAKuB;AAJpC,sDAA8B;AAIsB,iBAJ7C,gBAAM,CAI6C;AAH1D,kDAA0B;AAGkC,eAHrD,cAAI,CAGqD;AAFhE,kDAAyB;AAEyC,eAF3D,cAAI,CAE2D"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AASnB,gBATF,eAAK,CASE;AARd,oDAA4B;AAQZ,gBART,eAAK,CAQS;AAPrB,kEAA0C;AAOJ,uBAP/B,sBAAY,CAO+B;AANlD,oDAA4B;AAML,gBANhB,eAAK,CAMgB;AAL5B,sDAA8B;AAKA,iBALvB,gBAAM,CAKuB;AAJpC,sDAA8B;AAIsB,iBAJ7C,gBAAM,CAI6C;AAH1D,kDAA0B;AAGkC,eAHrD,cAAI,CAGqD;AAFhE,kDAA0B;AAEwC,eAF3D,cAAI,CAE2D"} \ No newline at end of file diff --git a/dist/providers/news/animenewsnetwork.js b/dist/providers/news/animenewsnetwork.js index 4ec91adb8..193cd6967 100644 --- a/dist/providers/news/animenewsnetwork.js +++ b/dist/providers/news/animenewsnetwork.js @@ -30,7 +30,9 @@ async function scrapNewsInfo(url) { const description = $('.meat > p').text().trim().split('\n\n').join('\n'); const time = $('#page-title > small > time').text().trim(); const thumbnailSlug = $('.meat > p').find('img').attr('data-src'); - const thumbnail = thumbnailSlug ? `https://animenewsnetwork.com${thumbnailSlug}` : 'https://i.imgur.com/KkkVr1g.png'; + const thumbnail = thumbnailSlug + ? `https://animenewsnetwork.com${thumbnailSlug}` + : 'https://i.imgur.com/KkkVr1g.png'; return { id: url.split('news/')[1], title, @@ -38,7 +40,7 @@ async function scrapNewsInfo(url) { intro, description, thumbnail, - url + url, }; } class AnimeNewsNetwork extends models_1.NewsParser { @@ -51,7 +53,9 @@ class AnimeNewsNetwork extends models_1.NewsParser { /** * @param topic Topic for fetching the feeds */ - this.fetchNewsFeeds = async (topic) => await axios_1.default.get(`${this.baseUrl}/news${topic && Object.values(models_1.Topics).includes(topic) ? `/?topic=${topic}` : ''}`).then(({ data }) => { + this.fetchNewsFeeds = async (topic) => await axios_1.default + .get(`${this.baseUrl}/news${topic && Object.values(models_1.Topics).includes(topic) ? `/?topic=${topic}` : ''}`) + .then(({ data }) => { const $ = (0, cheerio_1.load)(data); const feeds = []; $('.herald.box.news').each((i, el) => { @@ -69,12 +73,13 @@ class AnimeNewsNetwork extends models_1.NewsParser { const El = $(el).find('.preview'); const preview = { intro: El.find('.intro').text().trim(), - full: El.find('.full').text().replace('―', '').trim() + full: El.find('.full').text().replace('―', '').trim(), }; feeds.push(new NewsFeed(title, slug.replace('/news/', ''), time, topics, preview, thumbnail, url)); }); return feeds; - }).catch((err) => { + }) + .catch((err) => { throw new Error(err.message); }); /** diff --git a/dist/providers/news/animenewsnetwork.js.map b/dist/providers/news/animenewsnetwork.js.map index 6e1103b3a..8632e041d 100644 --- a/dist/providers/news/animenewsnetwork.js.map +++ b/dist/providers/news/animenewsnetwork.js.map @@ -1 +1 @@ -{"version":3,"file":"animenewsnetwork.js","sourceRoot":"","sources":["../../../src/providers/news/animenewsnetwork.ts"],"names":[],"mappings":";;;;;AAAA,qCAA8B;AAC9B,kDAAyB;AACzB,yCAAuE;AAEvE,MAAM,QAAQ;IACV,YAAmB,KAAa,EAAS,EAAU,EAAS,UAAkB,EAAS,MAAgB,EAAS,OAA6B,EAAS,SAAiB,EAAS,GAAW;QAAxK,UAAK,GAAL,KAAK,CAAQ;QAAS,OAAE,GAAF,EAAE,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAU;QAAS,YAAO,GAAP,OAAO,CAAsB;QAAS,cAAS,GAAT,SAAS,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAExL,KAAK,CAAC,OAAO;QAChB,OAAO,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;YACtD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;IACN,CAAC;CACJ;AAGD,KAAK,UAAU,aAAa,CAAC,GAAW;IACpC,MAAM,EAAE,IAAI,EAAE,GAAI,MAAM,eAAK,CAAC,GAAG,CAAS,GAAG,CAAC,CAAA;IAC9C,MAAM,CAAC,GAAG,IAAA,cAAI,EAAC,IAAI,CAAC,CAAA;IACpB,MAAM,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACjE,MAAM,KAAK,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;IAC/C,MAAM,WAAW,GAAG,CAAC,CAAC,WAA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CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE;oBACtC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;iBACxD,CAAA;gBACD,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAA;YACtG,CAAC,CAAC,CAAA;YACF,OAAO,KAAK,CAAA;QAChB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;QAEF;;;;WAIG;QACI,kBAAa,GAAG,KAAK,EAAE,EAAU,EAAsB,EAAE;YAC5D,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ;gBAAE,MAAM,IAAI,SAAS,CAAC,yEAAyE,OAAO,EAAE,WAAW,CAAC,CAAA;YACrJ,OAAO,MAAM,aAAa,CAAC,GAAG,IAAI,CAAC,OAAO,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;gBAC1E,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YAChC,CAAC,CAAC,CAAA;QACN,CAAC,CAAA;IACL,CAAC;CAAA;AAED,kBAAe,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"animenewsnetwork.js","sourceRoot":"","sources":["../../../src/providers/news/animenewsnetwork.ts"],"names":[],"mappings":";;;;;AAAA,qCAA+B;AAC/B,kDAA0B;AAC1B,yCAAwE;AAExE,MAAM,QAAQ;IACZ,YACS,KA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IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;YACrG,CAAC,CAAC,CAAC;YACH,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEP;;;;WAIG;QACI,kBAAa,GAAG,KAAK,EAAE,EAAU,EAAsB,EAAE;YAC9D,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ;gBAC/B,MAAM,IAAI,SAAS,CACjB,yEAAyE,OAAO,EAAE,WAAW,CAC9F,CAAC;YACJ,OAAO,MAAM,aAAa,CAAC,GAAG,IAAI,CAAC,OAAO,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;gBAC5E,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,kBAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/dist/providers/news/index.js.map b/dist/providers/news/index.js.map index a193eac8d..d2a88a29f 100644 --- a/dist/providers/news/index.js.map +++ b/dist/providers/news/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/news/index.ts"],"names":[],"mappings":";;;;;AAAA,0EAAmD;AAEnD,kBAAe,EAAE,GAAG,EAAH,0BAAG,EAAE,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/news/index.ts"],"names":[],"mappings":";;;;;AAAA,0EAAoD;AAEpD,kBAAe,EAAE,GAAG,EAAH,0BAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/utils/index.d.ts b/dist/utils/index.d.ts index 058a8d4ce..a62d84e95 100644 --- a/dist/utils/index.d.ts +++ b/dist/utils/index.d.ts @@ -2,5 +2,4 @@ import { GogoCDN, StreamSB, VidCloud, MixDrop, Kwik, RapidCloud, StreamTape, Viz import { USER_AGENT, splitAuthor, floorID, formatTitle, genElement, capitalizeFirstLetter, range, getDays, days, isJson, convertDuration } from './utils'; import { anilistSearchQuery, anilistMediaDetailQuery, kitsuSearchQuery, anilistTrendingQuery, anilistPopularQuery, anilistAiringScheduleQuery, anilistGenresQuery, anilistAdvancedQuery, anilistSiteStatisticsQuery, anilistCharacterQuery } from './queries'; import { parsePostInfo } from './getComics'; -import { countDivs } from './zLibrary'; -export { USER_AGENT, GogoCDN, StreamSB, splitAuthor, floorID, formatTitle, parsePostInfo, genElement, capitalizeFirstLetter, countDivs, VidCloud, MixDrop, Kwik, anilistSearchQuery, anilistMediaDetailQuery, kitsuSearchQuery, range, RapidCloud, StreamTape, VizCloud, anilistTrendingQuery, anilistPopularQuery, anilistAiringScheduleQuery, anilistGenresQuery, anilistAdvancedQuery, anilistSiteStatisticsQuery, Filemoon, anilistCharacterQuery, getDays, days, Vrv, isJson, convertDuration, BilibiliExtractor, }; +export { USER_AGENT, GogoCDN, StreamSB, splitAuthor, floorID, formatTitle, parsePostInfo, genElement, capitalizeFirstLetter, VidCloud, MixDrop, Kwik, anilistSearchQuery, anilistMediaDetailQuery, kitsuSearchQuery, range, RapidCloud, StreamTape, VizCloud, anilistTrendingQuery, anilistPopularQuery, anilistAiringScheduleQuery, anilistGenresQuery, anilistAdvancedQuery, anilistSiteStatisticsQuery, Filemoon, anilistCharacterQuery, getDays, days, Vrv, isJson, convertDuration, BilibiliExtractor, }; diff --git a/dist/utils/index.js b/dist/utils/index.js index 04e19a04a..166e7cca5 100644 --- a/dist/utils/index.js +++ b/dist/utils/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.BilibiliExtractor = exports.convertDuration = exports.isJson = exports.Vrv = exports.days = exports.getDays = exports.anilistCharacterQuery = exports.Filemoon = exports.anilistSiteStatisticsQuery = exports.anilistAdvancedQuery = exports.anilistGenresQuery = exports.anilistAiringScheduleQuery = exports.anilistPopularQuery = exports.anilistTrendingQuery = exports.VizCloud = exports.StreamTape = exports.RapidCloud = exports.range = exports.kitsuSearchQuery = exports.anilistMediaDetailQuery = exports.anilistSearchQuery = exports.Kwik = exports.MixDrop = exports.VidCloud = exports.countDivs = exports.capitalizeFirstLetter = exports.genElement = exports.parsePostInfo = exports.formatTitle = exports.floorID = exports.splitAuthor = exports.StreamSB = exports.GogoCDN = exports.USER_AGENT = void 0; +exports.BilibiliExtractor = exports.convertDuration = exports.isJson = exports.Vrv = exports.days = exports.getDays = exports.anilistCharacterQuery = exports.Filemoon = exports.anilistSiteStatisticsQuery = exports.anilistAdvancedQuery = exports.anilistGenresQuery = exports.anilistAiringScheduleQuery = exports.anilistPopularQuery = exports.anilistTrendingQuery = exports.VizCloud = exports.StreamTape = exports.RapidCloud = exports.range = exports.kitsuSearchQuery = exports.anilistMediaDetailQuery = exports.anilistSearchQuery = exports.Kwik = exports.MixDrop = exports.VidCloud = exports.capitalizeFirstLetter = exports.genElement = exports.parsePostInfo = exports.formatTitle = exports.floorID = exports.splitAuthor = exports.StreamSB = exports.GogoCDN = exports.USER_AGENT = void 0; const extractors_1 = require("./extractors"); Object.defineProperty(exports, "GogoCDN", { enumerable: true, get: function () { return extractors_1.GogoCDN; } }); Object.defineProperty(exports, "StreamSB", { enumerable: true, get: function () { return extractors_1.StreamSB; } }); @@ -38,6 +38,4 @@ Object.defineProperty(exports, "anilistSiteStatisticsQuery", { enumerable: true, Object.defineProperty(exports, "anilistCharacterQuery", { enumerable: true, get: function () { return queries_1.anilistCharacterQuery; } }); const getComics_1 = require("./getComics"); Object.defineProperty(exports, "parsePostInfo", { enumerable: true, get: function () { return getComics_1.parsePostInfo; } }); -const zLibrary_1 = require("./zLibrary"); -Object.defineProperty(exports, "countDivs", { enumerable: true, get: function () { return zLibrary_1.countDivs; } }); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/utils/index.js.map b/dist/utils/index.js.map index 7fe4892df..99c0b1597 100644 --- a/dist/utils/index.js.map +++ b/dist/utils/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,6CAYsB;AA+BpB,wFA1CA,oBAAO,OA0CA;AACP,yFA1CA,qBAAQ,OA0CA;AAQR,yFAjDA,qBAAQ,OAiDA;AACR,wFAjDA,oBAAO,OAiDA;AACP,qFAjDA,iBAAI,OAiDA;AAKJ,2FArDA,uBAAU,OAqDA;AACV,2FArDA,uBAAU,OAqDA;AACV,yFArDA,qBAAQ,OAqDA;AAOR,yFA3DA,qBAAQ,OA2DA;AAIR,oFA9DA,gBAAG,OA8DA;AAGH,kGAhEA,8BAAiB,OAgEA;AA9DnB,mCAYiB;AAiBf,2FA5BA,kBAAU,OA4BA;AAGV,4FA9BA,mBAAW,OA8BA;AACX,wFA9BA,eAAO,OA8BA;AACP,4FA9BA,mBAAW,OA8BA;AAEX,2FA/BA,kBAAU,OA+BA;AACV,sGA/BA,6BAAqB,OA+BA;AAQrB,sFAtCA,aAAK,OAsCA;AAYL,wFAjDA,eAAO,OAiDA;AACP,qFAjDA,YAAI,OAiDA;AAEJ,uFAlDA,cAAM,OAkDA;AACN,gGAlDA,uBAAe,OAkDA;AAhDjB,uCAWmB;AAkBjB,mGA5BA,4BAAkB,OA4BA;AAClB,wGA5BA,iCAAuB,OA4BA;AACvB,iGA5BA,0BAAgB,OA4BA;AAKhB,qGAhCA,8BAAoB,OAgCA;AACpB,oGAhCA,6BAAmB,OAgCA;AACnB,2GAhCA,oCAA0B,OAgCA;AAC1B,mGAhCA,4BAAkB,OAgCA;AAClB,qGAhCA,8BAAoB,OAgCA;AACpB,2GAhCA,oCAA0B,OAgCA;AAE1B,sGAjCA,+BAAqB,OAiCA;AA/BvB,2CAA4C;AAU1C,8FAVO,yBAAa,OAUP;AATf,yCAAuC;AAYrC,0FAZO,oBAAS,OAYP"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,6CAYsB;AA8BpB,wFAzCA,oBAAO,OAyCA;AACP,yFAzCA,qBAAQ,OAyCA;AAOR,yFA/CA,qBAAQ,OA+CA;AACR,wFA/CA,oBAAO,OA+CA;AACP,qFA/CA,iBAAI,OA+CA;AAKJ,2FAnDA,uBAAU,OAmDA;AACV,2FAnDA,uBAAU,OAmDA;AACV,yFAnDA,qBAAQ,OAmDA;AAOR,yFAzDA,qBAAQ,OAyDA;AAIR,oFA5DA,gBAAG,OA4DA;AAGH,kGA9DA,8BAAiB,OA8DA;AA5DnB,mCAYiB;AAgBf,2FA3BA,kBAAU,OA2BA;AAGV,4FA7BA,mBAAW,OA6BA;AACX,wFA7BA,eAAO,OA6BA;AACP,4FA7BA,mBAAW,OA6BA;AAEX,2FA9BA,kBAAU,OA8BA;AACV,sGA9BA,6BAAqB,OA8BA;AAOrB,sFApCA,aAAK,OAoCA;AAYL,wFA/CA,eAAO,OA+CA;AACP,qFA/CA,YAAI,OA+CA;AAEJ,uFAhDA,cAAM,OAgDA;AACN,gGAhDA,uBAAe,OAgDA;AA9CjB,uCAWmB;AAgBjB,mGA1BA,4BAAkB,OA0BA;AAClB,wGA1BA,iCAAuB,OA0BA;AACvB,iGA1BA,0BAAgB,OA0BA;AAKhB,qGA9BA,8BAAoB,OA8BA;AACpB,oGA9BA,6BAAmB,OA8BA;AACnB,2GA9BA,oCAA0B,OA8BA;AAC1B,mGA9BA,4BAAkB,OA8BA;AAClB,qGA9BA,8BAAoB,OA8BA;AACpB,2GA9BA,oCAA0B,OA8BA;AAE1B,sGA/BA,+BAAqB,OA+BA;AA7BvB,2CAA4C;AAS1C,8FATO,yBAAa,OASP"} \ No newline at end of file diff --git a/dist/utils/providers-list.d.ts b/dist/utils/providers-list.d.ts index ff64670dc..c67966c67 100644 --- a/dist/utils/providers-list.d.ts +++ b/dist/utils/providers-list.d.ts @@ -5,7 +5,7 @@ */ export declare const PROVIDERS_LIST: { ANIME: (import("../providers/anime/gogoanime").default | import("../providers/anime/9anime").default | import("../providers/anime/animepahe").default | import("../providers/anime/zoro").default | import("../providers/anime/animixplay").default | import("../providers/anime/animefox").default | import("../providers/anime/enime").default | import("../providers/anime/crunchyroll").default | import("../providers/anime/bilibili").default)[]; - MANGA: (import("../providers/manga/mangadex").default | import("../providers/manga/mangahere").default | import("../providers/manga/mangakakalot").default | import("../providers/manga/mangasee123").default)[]; + MANGA: (import("../providers/manga/mangadex").default | import("../providers/manga/mangahere").default | import("../providers/manga/mangakakalot").default | import("../providers/manga/mangasee123").default | import("../providers/manga/mangapark").default)[]; BOOKS: import("../providers/books/libgen").default[]; COMICS: import("../providers/comics/getComics").default[]; LIGHT_NOVELS: import("../providers/light-novels/readlightnovels").default[]; diff --git a/dist/utils/providers-list.js b/dist/utils/providers-list.js index f58decb4f..c8167d144 100644 --- a/dist/utils/providers-list.js +++ b/dist/utils/providers-list.js @@ -19,7 +19,13 @@ exports.PROVIDERS_LIST = { new providers_1.ANIME.Crunchyroll(), new providers_1.ANIME.Bilibili(), ], - MANGA: [new providers_1.MANGA.MangaDex(), new providers_1.MANGA.MangaHere(), new providers_1.MANGA.MangaKakalot(), new providers_1.MANGA.Mangasee123()], + MANGA: [ + new providers_1.MANGA.MangaDex(), + new providers_1.MANGA.MangaHere(), + new providers_1.MANGA.MangaKakalot(), + new providers_1.MANGA.Mangasee123(), + new providers_1.MANGA.Mangapark(), + ], BOOKS: [new providers_1.BOOKS.Libgen()], COMICS: [new providers_1.COMICS.GetComics()], LIGHT_NOVELS: [new providers_1.LIGHT_NOVELS.ReadLightNovels()], diff --git a/dist/utils/providers-list.js.map b/dist/utils/providers-list.js.map index 8acdab5d0..dbf275d30 100644 --- a/dist/utils/providers-list.js.map +++ b/dist/utils/providers-list.js.map @@ -1 +1 @@ -{"version":3,"file":"providers-list.js","sourceRoot":"","sources":["../../src/utils/providers-list.ts"],"names":[],"mappings":";;;AAAA,4CAA6F;AAE7F;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC5B,KAAK,EAAE;QACL,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,IAAI,EAAE;QAChB,IAAI,iBAAK,CAAC,UAAU,EAAE;QACtB,IAAI,iBAAK,CAAC,QAAQ,EAAE;QACpB,IAAI,iBAAK,CAAC,KAAK,EAAE;QACjB,IAAI,iBAAK,CAAC,WAAW,EAAE;QACvB,IAAI,iBAAK,CAAC,QAAQ,EAAE;KACrB;IACD,KAAK,EAAE,CAAC,IAAI,iBAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,iBAAK,CAAC,SAAS,EAAE,EAAE,IAAI,iBAAK,CAAC,YAAY,EAAE,EAAE,IAAI,iBAAK,CAAC,WAAW,EAAE,CAAC;IACvG,KAAK,EAAE,CAAC,IAAI,iBAAK,CAAC,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,kBAAM,CAAC,SAAS,EAAE,CAAC;IAChC,YAAY,EAAE,CAAC,IAAI,wBAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,CAAC,IAAI,kBAAM,CAAC,MAAM,EAAE,CAAC;IAC7B,IAAI,EAAE,CAAC,IAAI,gBAAI,CAAC,GAAG,EAAE,CAAC;IACtB,IAAI,EAAE,CAAC,IAAI,gBAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,MAAM,EAAE,EAAE;CACX,CAAC"} \ No newline at end of file +{"version":3,"file":"providers-list.js","sourceRoot":"","sources":["../../src/utils/providers-list.ts"],"names":[],"mappings":";;;AAAA,4CAA6F;AAE7F;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC5B,KAAK,EAAE;QACL,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,IAAI,EAAE;QAChB,IAAI,iBAAK,CAAC,UAAU,EAAE;QACtB,IAAI,iBAAK,CAAC,QAAQ,EAAE;QACpB,IAAI,iBAAK,CAAC,KAAK,EAAE;QACjB,IAAI,iBAAK,CAAC,WAAW,EAAE;QACvB,IAAI,iBAAK,CAAC,QAAQ,EAAE;KACrB;IACD,KAAK,EAAE;QACL,IAAI,iBAAK,CAAC,QAAQ,EAAE;QACpB,IAAI,iBAAK,CAAC,SAAS,EAAE;QACrB,IAAI,iBAAK,CAAC,YAAY,EAAE;QACxB,IAAI,iBAAK,CAAC,WAAW,EAAE;QACvB,IAAI,iBAAK,CAAC,SAAS,EAAE;KACtB;IACD,KAAK,EAAE,CAAC,IAAI,iBAAK,CAAC,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,kBAAM,CAAC,SAAS,EAAE,CAAC;IAChC,YAAY,EAAE,CAAC,IAAI,wBAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,CAAC,IAAI,kBAAM,CAAC,MAAM,EAAE,CAAC;IAC7B,IAAI,EAAE,CAAC,IAAI,gBAAI,CAAC,GAAG,EAAE,CAAC;IACtB,IAAI,EAAE,CAAC,IAAI,gBAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,MAAM,EAAE,EAAE;CACX,CAAC"} \ No newline at end of file diff --git a/dist/utils/utils.js b/dist/utils/utils.js index 2cb0e0bc5..a637287ee 100644 --- a/dist/utils/utils.js +++ b/dist/utils/utils.js @@ -110,18 +110,13 @@ const compareTwoStrings = (first, second) => { let firstBigrams = new Map(); for (let i = 0; i < first.length - 1; i++) { const bigram = first.substring(i, i + 2); - const count = firstBigrams.has(bigram) - ? firstBigrams.get(bigram) + 1 - : 1; + const count = firstBigrams.has(bigram) ? firstBigrams.get(bigram) + 1 : 1; firstBigrams.set(bigram, count); } - ; let intersectionSize = 0; for (let i = 0; i < second.length - 1; i++) { const bigram = second.substring(i, i + 2); - const count = firstBigrams.has(bigram) - ? firstBigrams.get(bigram) - : 0; + const count = firstBigrams.has(bigram) ? firstBigrams.get(bigram) : 0; if (count > 0) { firstBigrams.set(bigram, count - 1); intersectionSize++; diff --git a/dist/utils/utils.js.map b/dist/utils/utils.js.map index d0856d696..67b73aa87 100644 --- a/dist/utils/utils.js.map +++ b/dist/utils/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":";;;AAAA,qCAA+B;AAIlB,QAAA,UAAU,GACrB,qHAAqH,CAAC;AAC3G,QAAA,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAE5F,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,EAAE;IAC7C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE;YACzE,SAAS;SACV;QACD,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;YAC1C,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACvB,KAAK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a/docs/guides/books.md +++ b/docs/guides/books.md @@ -16,6 +16,5 @@ const bookProvider = BOOKS.(); This list is in alphabetical order. (except the sub bullet points) - [Libgen](../providers/libgen.md) -- [zLibrary](../providers/zLibrary.md)

(back to table of contents)

\ No newline at end of file diff --git a/docs/providers/zLibrary.md b/docs/providers/zLibrary.md deleted file mode 100644 index 10f4735fc..000000000 --- a/docs/providers/zLibrary.md +++ /dev/null @@ -1,37 +0,0 @@ -# Libgen - -```ts -const zLibrary = new BOOKS.ZLibrary(); -``` - -## Methods - -```ts -/** - * Scrapes a libgen search page by book query - * - * @param {string} bookTitle - the name of the book - * @param {number} [page=1] - maximum number of results - * @returns {Promise<{containers: ZLibrary[], page: number}>} -*/ -ZLibrary.search("One Houndred Years of Solitude", 30); -``` - -## Variables - -```ts -/** - * @type {string} -*/ -ZLibrary.name; // the name of the provider. -/** - * @type {boolean} -*/ -ZLibrary.isNSFW; // if NSFW -/** - * @type {boolean} -*/ -Libgen.isWorking; // if provider is working -``` - -

(back to book providers list)

\ No newline at end of file diff --git a/src/models/index.ts b/src/models/index.ts index 353570156..538bac66c 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -29,7 +29,6 @@ import { ILightNovelChapterContent, GetComicsComics, ComicRes, - ZLibrary, IMangaChapterPage, TvType, IMovieEpisode, @@ -47,7 +46,7 @@ import { MediaFormat, ProxyConfig, } from './types'; -import { LibgenBookObject, GetComicsComicsObject, ZLibraryObject } from './type-objects'; +import { LibgenBookObject, GetComicsComicsObject } from './type-objects'; export { BaseProvider, @@ -80,8 +79,6 @@ export { GetComicsComics, GetComicsComicsObject, ComicRes, - ZLibrary, - ZLibraryObject, ISearch, IMangaChapterPage, TvType, diff --git a/src/models/news-parser.ts b/src/models/news-parser.ts index 978465701..05cf30192 100644 --- a/src/models/news-parser.ts +++ b/src/models/news-parser.ts @@ -1,4 +1,4 @@ -import { BaseProvider } from '.' +import { BaseProvider } from '.'; abstract class NewsParser extends BaseProvider {} -export default NewsParser \ No newline at end of file +export default NewsParser; diff --git a/src/models/type-objects.ts b/src/models/type-objects.ts index e4f1a35ed..a3076dbae 100644 --- a/src/models/type-objects.ts +++ b/src/models/type-objects.ts @@ -1,5 +1,5 @@ import { Hashes } from './base-types'; -import { GetComicsComics, LibgenBook, ZLibrary } from './types'; +import { GetComicsComics, LibgenBook } from './types'; export class LibgenBookObject implements LibgenBook { title = ''; @@ -48,23 +48,3 @@ export class GetComicsComicsObject implements GetComicsComics { zippyshare = ''; readOnline = ''; } - -export class ZLibraryObject implements ZLibrary { - bookRating = ''; - bookQuality = ''; - description = ''; - title = ''; - authors: string[] = []; - publisher = ''; - year = ''; - edition = ''; - volume = ''; - series = ''; - isbn = []; - link = ''; - id = ''; - language = ''; - size = ''; - pages = ''; - image = ''; -} diff --git a/src/models/types.ts b/src/models/types.ts index ac8adcdc7..dee290daa 100644 --- a/src/models/types.ts +++ b/src/models/types.ts @@ -268,14 +268,6 @@ export interface ComicRes { hasNextPage: boolean; } -export interface ZLibrary extends Book { - bookRating: string; - bookQuality: string; - language: string; - size: string; - pages: string; -} - export interface ISubtitle { /** * The id of the subtitle. **not** required diff --git a/src/providers/books/index.ts b/src/providers/books/index.ts index c3ac7a9b8..1bb6f9457 100644 --- a/src/providers/books/index.ts +++ b/src/providers/books/index.ts @@ -1,4 +1,3 @@ import Libgen from './libgen'; -import ZLibrary from './zLibrary'; -export default { Libgen, ZLibrary }; +export default { Libgen }; diff --git a/src/providers/books/zLibrary.ts b/src/providers/books/zLibrary.ts deleted file mode 100644 index c8b6c826f..000000000 --- a/src/providers/books/zLibrary.ts +++ /dev/null @@ -1,113 +0,0 @@ -import axios from 'axios'; -import { load } from 'cheerio'; -import { BookParser, ZLibrary, ZLibraryObject } from '../../models'; -import { genElement, countDivs } from '../../utils'; - -const { get } = axios; - -class Zlibrary extends BookParser { - protected override readonly baseUrl = 'https://3lib.net'; - override readonly name = 'ZLibrary'; - protected override classPath = 'BOOKS.Zlibrary'; - protected override logo = `${this.baseUrl}/img/logo.zlibrary.png`; - override isWorking = true; - private headers = { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0', - }; - - search = async (bookTitle: string, page: number = 1) => { - bookTitle = encodeURIComponent(bookTitle); - if (page > 10 || page < 1) { - return; - } - const { data } = await get(`${this.baseUrl}/s/${bookTitle}?page=${page}`, { - headers: this.headers, - }); - const $ = load(data); - const containers: ZLibrary[] = []; - $('div.resItemBox').each((i, e) => { - const container = new ZLibraryObject(); - - const html = $(e).html() || ''; - - container.image = - $(genElement('div table tbody tr td div div a img', html)).attr('data-src')![0] == 'h' && - $(genElement('div table tbody tr td div div a img', html)).attr('data-src')![1] == 't' && - $(genElement('div table tbody tr td div div a img', html)).attr('data-src')![2] == 't' && - $(genElement('div table tbody tr td div div a img', html)).attr('data-src')![3] == 'p' - ? `${$(genElement('div table tbody tr td div div a img', html)).attr('data-src')}` - : `${this.baseUrl}${$(genElement('div table tbody tr td div div a img', html)).attr('data-src')}`; - - container.title = $(genElement('div table tbody tr td:eq(1) table tbody tr td h3 a', html)) - .text() - .trim(); - - container.publisher = - countDivs($(genElement('div table tbody tr td:eq(1) table tbody tr td', html)).html() ?? '') == 2 - ? $(genElement('div table tbody tr td:eq(1) table tbody tr td div:eq(0) a', html)).text() - : ''; - - container.authors = - countDivs($(genElement('div table tbody tr td:eq(1) table tbody tr td', html)).html() ?? '') == 2 - ? $(genElement('div table tbody tr td:eq(1) table tbody tr td div:eq(1) a', html)) - .text() - .split(', ') - : $(genElement('div table tbody tr td:eq(1) table tbody tr td div:eq(0) a', html)) - .text() - .split(', '); - - container.link = `${this.baseUrl}${$( - genElement('div table tbody tr td:eq(1) table tbody tr td h3 a', html) - ).attr('href')}`; - - container.year = $( - genElement('div table tbody tr td:eq(1) table tbody tr:eq(1) td div:eq(1) div div:eq(1)', html) - ).text(); - - container.language = $( - genElement('div table tbody tr td:eq(1) table tbody tr:eq(1) td div:eq(1) div:eq(1) div:eq(1)', html) - ).text(); - container.size = $( - genElement('div table tbody tr td:eq(1) table tbody tr:eq(1) td div:eq(1) div:eq(2) div:eq(1)', html) - ).text(); - container.bookRating = $( - genElement( - 'div table tbody tr td:eq(1) table tbody tr:eq(1) td div:eq(1) div:eq(4) div span:eq(0)', - html - ) - ) - .text() - .trim(); - container.bookQuality = $( - genElement( - 'div table tbody tr td:eq(1) table tbody tr:eq(1) td div:eq(1) div:eq(4) div span:eq(1)', - html - ) - ) - .text() - .trim(); - containers.push(container); - }); - for (let c of containers) { - const { data } = await get(c.link, { - headers: this.headers, - }); - const $ = load(data); - - c.description = $('#bookDescriptionBox').text().trim(); - c.isbn = [ - $('.property_isbn.10 .property_value').text().trim(), - $('.property_isbn.13 .property_value').text().trim(), - ]; - c.edition = $('.property_edition .property_value').text().trim(); - c.pages = $('.property_pages .property_value').text().trim(); - c.link = $('.addDownloadedBook').attr('href') ?? ''; - } - return { - containers, - page, - }; - }; -} - -export default Zlibrary; diff --git a/src/providers/index.ts b/src/providers/index.ts index b7f59be87..e390e852b 100644 --- a/src/providers/index.ts +++ b/src/providers/index.ts @@ -5,6 +5,6 @@ import BOOKS from './books'; import COMICS from './comics'; import MOVIES from './movies'; import META from './meta'; -import NEWS from './news' +import NEWS from './news'; -export { ANIME, MANGA, BOOKS, COMICS, LIGHT_NOVELS, MOVIES, META, NEWS }; \ No newline at end of file +export { ANIME, MANGA, BOOKS, COMICS, LIGHT_NOVELS, MOVIES, META, NEWS }; diff --git a/src/providers/news/animenewsnetwork.ts b/src/providers/news/animenewsnetwork.ts index 64276336b..84edddd41 100644 --- a/src/providers/news/animenewsnetwork.ts +++ b/src/providers/news/animenewsnetwork.ts @@ -1,85 +1,103 @@ -import { load } from 'cheerio' -import axios from 'axios' -import { NewsParser, INewsFeed, Topics, INewsInfo } from '../../models' +import { load } from 'cheerio'; +import axios from 'axios'; +import { NewsParser, INewsFeed, Topics, INewsInfo } from '../../models'; class NewsFeed implements INewsFeed { - constructor(public title: string, public id: string, public uploadedAt: string, public topics: Topics[], public preview: INewsFeed['preview'], public thumbnail: string, public url: string) {} + constructor( + public title: string, + public id: string, + public uploadedAt: string, + public topics: Topics[], + public preview: INewsFeed['preview'], + public thumbnail: string, + public url: string + ) {} - public async getInfo(): Promise { - return await scrapNewsInfo(this.url).catch((err: Error) => { - throw new Error(err.message) - }) - } + public async getInfo(): Promise { + return await scrapNewsInfo(this.url).catch((err: Error) => { + throw new Error(err.message); + }); + } } - async function scrapNewsInfo(url: string): Promise { - const { data } = await axios.get(url) - const $ = load(data) - const title = $('#page_header').text().replace('News', '').trim() - const intro = $('.intro').first().text().trim() - const description = $('.meat > p').text().trim().split('\n\n').join('\n') - const time = $('#page-title > small > time').text().trim() - const thumbnailSlug = $('.meat > p').find('img').attr('data-src') - const thumbnail = thumbnailSlug ? `https://animenewsnetwork.com${thumbnailSlug}` : 'https://i.imgur.com/KkkVr1g.png' - return { - id: url.split('news/')[1], - title, - uploadedAt: time, - intro, - description, - thumbnail, - url - } + const { data } = await axios.get(url); + const $ = load(data); + const title = $('#page_header').text().replace('News', '').trim(); + const intro = $('.intro').first().text().trim(); + const description = $('.meat > p').text().trim().split('\n\n').join('\n'); + const time = $('#page-title > small > time').text().trim(); + const thumbnailSlug = $('.meat > p').find('img').attr('data-src'); + const thumbnail = thumbnailSlug + ? `https://animenewsnetwork.com${thumbnailSlug}` + : 'https://i.imgur.com/KkkVr1g.png'; + return { + id: url.split('news/')[1], + title, + uploadedAt: time, + intro, + description, + thumbnail, + url, + }; } class AnimeNewsNetwork extends NewsParser { - override readonly name = 'Anime News Network' - protected override baseUrl = 'https://www.animenewsnetwork.com' - protected override classPath = 'NEWS.ANN' - protected override logo = 'https://i.imgur.com/KkkVr1g.png' + override readonly name = 'Anime News Network'; + protected override baseUrl = 'https://www.animenewsnetwork.com'; + protected override classPath = 'NEWS.ANN'; + protected override logo = 'https://i.imgur.com/KkkVr1g.png'; - /** - * @param topic Topic for fetching the feeds - */ - public fetchNewsFeeds = async (topic?: Topics): Promise => await axios.get(`${this.baseUrl}/news${topic && Object.values(Topics).includes(topic) ? `/?topic=${topic}` : ''}`).then(({ data }) => { - const $ = load(data) - const feeds: NewsFeed[] = [] + /** + * @param topic Topic for fetching the feeds + */ + public fetchNewsFeeds = async (topic?: Topics): Promise => + await axios + .get( + `${this.baseUrl}/news${topic && Object.values(Topics).includes(topic) ? `/?topic=${topic}` : ''}` + ) + .then(({ data }) => { + const $ = load(data); + const feeds: NewsFeed[] = []; $('.herald.box.news').each((i, el) => { - const thumbnailSlug = $(el).find('.thumbnail').attr('data-src') - const thumbnail = thumbnailSlug ? `${this.baseUrl}${thumbnailSlug}` : this.logo - const title = $(el).find('h3').text().trim() - const slug = $(el).find('h3 > a').attr('href') || '' - const url = `${this.baseUrl}${slug}` - const byline = $(el).find('.byline') - const time = byline.find('time').text().trim() - const topics: Topics[] = [] - byline.find('.topics > a').each((i, el) => { - topics.push($(el).text().trim() as Topics) - }) - const El = $(el).find('.preview') - const preview = { - intro: El.find('.intro').text().trim(), - full: El.find('.full').text().replace('―', '').trim() - } - feeds.push(new NewsFeed(title, slug.replace('/news/', ''), time, topics, preview, thumbnail, url)) - }) - return feeds - }).catch((err: Error) => { - throw new Error(err.message) - }) + const thumbnailSlug = $(el).find('.thumbnail').attr('data-src'); + const thumbnail = thumbnailSlug ? `${this.baseUrl}${thumbnailSlug}` : this.logo; + const title = $(el).find('h3').text().trim(); + const slug = $(el).find('h3 > a').attr('href') || ''; + const url = `${this.baseUrl}${slug}`; + const byline = $(el).find('.byline'); + const time = byline.find('time').text().trim(); + const topics: Topics[] = []; + byline.find('.topics > a').each((i, el) => { + topics.push($(el).text().trim() as Topics); + }); + const El = $(el).find('.preview'); + const preview = { + intro: El.find('.intro').text().trim(), + full: El.find('.full').text().replace('―', '').trim(), + }; + feeds.push(new NewsFeed(title, slug.replace('/news/', ''), time, topics, preview, thumbnail, url)); + }); + return feeds; + }) + .catch((err: Error) => { + throw new Error(err.message); + }); - /** - * @param id ID of the news from Anime News Network - * @example - * fetchNewsInfo('2022-08-26/higurashi-no-naku-koro-ni-rei-oni-okoshi-hen-manga-ends/.188996') // --> https://www.animenewsnetwork.com/news/2022-08-26/higurashi-no-naku-koro-ni-rei-oni-okoshi-hen-manga-ends/.188996 - */ - public fetchNewsInfo = async (id: string): Promise => { - if (!id || typeof id !== 'string') throw new TypeError(`The type of parameter "id" should be of type "string", received type "${typeof id}" instead`) - return await scrapNewsInfo(`${this.baseUrl}/news/${id}`).catch((err: Error) => { - throw new Error(err.message) - }) - } + /** + * @param id ID of the news from Anime News Network + * @example + * fetchNewsInfo('2022-08-26/higurashi-no-naku-koro-ni-rei-oni-okoshi-hen-manga-ends/.188996') // --> https://www.animenewsnetwork.com/news/2022-08-26/higurashi-no-naku-koro-ni-rei-oni-okoshi-hen-manga-ends/.188996 + */ + public fetchNewsInfo = async (id: string): Promise => { + if (!id || typeof id !== 'string') + throw new TypeError( + `The type of parameter "id" should be of type "string", received type "${typeof id}" instead` + ); + return await scrapNewsInfo(`${this.baseUrl}/news/${id}`).catch((err: Error) => { + throw new Error(err.message); + }); + }; } -export default AnimeNewsNetwork \ No newline at end of file +export default AnimeNewsNetwork; diff --git a/src/providers/news/index.ts b/src/providers/news/index.ts index 2a77dd63a..d6d11e26b 100644 --- a/src/providers/news/index.ts +++ b/src/providers/news/index.ts @@ -1,3 +1,3 @@ -import { default as ANN } from './animenewsnetwork' +import { default as ANN } from './animenewsnetwork'; -export default { ANN } \ No newline at end of file +export default { ANN }; diff --git a/src/utils/index.ts b/src/utils/index.ts index 84ec4d13e..1f19d1690 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -37,7 +37,6 @@ import { anilistCharacterQuery, } from './queries'; import { parsePostInfo } from './getComics'; -import { countDivs } from './zLibrary'; export { USER_AGENT, @@ -49,7 +48,6 @@ export { parsePostInfo, genElement, capitalizeFirstLetter, - countDivs, VidCloud, MixDrop, Kwik, diff --git a/src/utils/providers-list.ts b/src/utils/providers-list.ts index b445f3a9d..0e5b5a818 100644 --- a/src/utils/providers-list.ts +++ b/src/utils/providers-list.ts @@ -17,7 +17,13 @@ export const PROVIDERS_LIST = { new ANIME.Crunchyroll(), new ANIME.Bilibili(), ], - MANGA: [new MANGA.MangaDex(), new MANGA.MangaHere(), new MANGA.MangaKakalot(), new MANGA.Mangasee123()], + MANGA: [ + new MANGA.MangaDex(), + new MANGA.MangaHere(), + new MANGA.MangaKakalot(), + new MANGA.Mangasee123(), + new MANGA.Mangapark(), + ], BOOKS: [new BOOKS.Libgen()], COMICS: [new COMICS.GetComics()], LIGHT_NOVELS: [new LIGHT_NOVELS.ReadLightNovels()], diff --git a/src/utils/utils.ts b/src/utils/utils.ts index b91c87dc5..e3b0e454b 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -104,34 +104,30 @@ export function convertDuration(milliseconds: number) { } export const compareTwoStrings = (first: string, second: string): number => { - first = first.replace(/\s+/g, '') - second = second.replace(/\s+/g, '') - - if (first === second) return 1; // identical or empty - if (first.length < 2 || second.length < 2) return 0; // if either is a 0-letter or 1-letter string - - let firstBigrams = new Map(); - for (let i = 0; i < first.length - 1; i++) { - const bigram = first.substring(i, i + 2); - const count = firstBigrams.has(bigram) - ? firstBigrams.get(bigram) + 1 - : 1; - - firstBigrams.set(bigram, count); - }; - - let intersectionSize = 0; - for (let i = 0; i < second.length - 1; i++) { - const bigram = second.substring(i, i + 2); - const count = firstBigrams.has(bigram) - ? firstBigrams.get(bigram) - : 0; - - if (count > 0) { - firstBigrams.set(bigram, count - 1); - intersectionSize++; - } - } - - return (2.0 * intersectionSize) / (first.length + second.length - 2); -} \ No newline at end of file + first = first.replace(/\s+/g, ''); + second = second.replace(/\s+/g, ''); + + if (first === second) return 1; // identical or empty + if (first.length < 2 || second.length < 2) return 0; // if either is a 0-letter or 1-letter string + + let firstBigrams = new Map(); + for (let i = 0; i < first.length - 1; i++) { + const bigram = first.substring(i, i + 2); + const count = firstBigrams.has(bigram) ? firstBigrams.get(bigram) + 1 : 1; + + firstBigrams.set(bigram, count); + } + + let intersectionSize = 0; + for (let i = 0; i < second.length - 1; i++) { + const bigram = second.substring(i, i + 2); + const count = firstBigrams.has(bigram) ? firstBigrams.get(bigram) : 0; + + if (count > 0) { + firstBigrams.set(bigram, count - 1); + intersectionSize++; + } + } + + return (2.0 * intersectionSize) / (first.length + second.length - 2); +}; diff --git a/src/utils/zLibrary.ts b/src/utils/zLibrary.ts deleted file mode 100644 index cb8368aef..000000000 --- a/src/utils/zLibrary.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const countDivs = (s: string) => { - let counter = 0; - for (let i = 0; i < s.length; i++) { - if (s[i] == '<' && s[i + 1] == 'd' && s[i + 2] == 'i' && s[i + 3] == 'v') counter++; - } - return counter; -}; diff --git a/test/books/zLibrary.test.ts b/test/books/zLibrary.test.ts deleted file mode 100644 index e507efe06..000000000 --- a/test/books/zLibrary.test.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BOOKS } from '../../src/providers'; - -jest.setTimeout(120000); - -test('should not be empty', async () => { - const zlib = new BOOKS.ZLibrary(); - const res = await zlib.search('Infinite Jest'); - expect(res?.containers.length).not.toEqual(0); -});