├── .gitignore ├── .npmignore ├── test ├── index.d.ts ├── index.d.ts.map ├── index.ts ├── index.js └── index.js.map ├── src ├── crawler │ ├── index.ts │ └── movies │ │ ├── index.ts │ │ └── flixhq.ts ├── index.ts ├── extractors │ ├── index.ts │ ├── mixdrop.ts │ └── vidcloud.ts ├── types │ └── types.ts └── utils │ └── index.ts ├── dist ├── index.d.ts ├── crawler │ ├── index.d.ts │ ├── index.js.map │ ├── movies │ │ ├── index.d.ts │ │ ├── index.d.ts.map │ │ ├── index.js.map │ │ ├── index.js │ │ ├── flixhq.d.ts.map │ │ ├── flixhq.d.ts │ │ ├── flixhq.js.map │ │ └── flixhq.js │ ├── index.d.ts.map │ └── index.js ├── index.js.map ├── extractors │ ├── index.d.ts │ ├── index.js.map │ ├── index.d.ts.map │ ├── mixdrop.d.ts │ ├── mixdrop.d.ts.map │ ├── vidcloud.d.ts │ ├── vidcloud.d.ts.map │ ├── index.js │ ├── vidcloud.js.map │ ├── mixdrop.js.map │ ├── mixdrop.js │ └── vidcloud.js ├── index.d.ts.map ├── index.js ├── utils │ ├── index.d.ts.map │ ├── index.d.ts │ ├── index.js.map │ └── index.js └── types │ ├── types.js.map │ ├── types.js │ ├── types.d.ts.map │ └── types.d.ts ├── .github └── dependabot.yml ├── package.json ├── LICENSE ├── README.md └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | node_modules 3 | .idea 4 | test 5 | .github -------------------------------------------------------------------------------- /test/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /src/crawler/index.ts: -------------------------------------------------------------------------------- 1 | import MOVIES from './movies'; 2 | 3 | export { MOVIES }; -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { MOVIES } from './crawler'; 2 | 3 | export { MOVIES }; -------------------------------------------------------------------------------- /src/crawler/movies/index.ts: -------------------------------------------------------------------------------- 1 | import FlixHQ from "./flixhq"; 2 | 3 | export default { FlixHQ }; -------------------------------------------------------------------------------- /dist/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MOVIES } from './crawler'; 2 | export { MOVIES }; 3 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /dist/crawler/index.d.ts: -------------------------------------------------------------------------------- 1 | import MOVIES from './movies'; 2 | export { MOVIES }; 3 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /test/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /src/extractors/index.ts: -------------------------------------------------------------------------------- 1 | import VidCloud from "./vidcloud"; 2 | import MixDrop from "./mixdrop"; 3 | 4 | export { VidCloud, MixDrop }; -------------------------------------------------------------------------------- /dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAE1B,uFAFA,gBAAM,OAEA"} -------------------------------------------------------------------------------- /dist/extractors/index.d.ts: -------------------------------------------------------------------------------- 1 | import VidCloud from "./vidcloud"; 2 | import MixDrop from "./mixdrop"; 3 | export { VidCloud, MixDrop }; 4 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /dist/crawler/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/crawler/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAErB,iBAFF,gBAAM,CAEE"} -------------------------------------------------------------------------------- /dist/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,CAAC"} -------------------------------------------------------------------------------- /dist/crawler/movies/index.d.ts: -------------------------------------------------------------------------------- 1 | import FlixHQ from "./flixhq"; 2 | declare const _default: { 3 | FlixHQ: typeof FlixHQ; 4 | }; 5 | export default _default; 6 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /dist/crawler/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crawler/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,CAAC"} -------------------------------------------------------------------------------- /dist/crawler/movies/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crawler/movies/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;;;;AAE9B,wBAA0B"} -------------------------------------------------------------------------------- /dist/crawler/movies/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crawler/movies/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAE9B,kBAAe,EAAE,MAAM,EAAN,gBAAM,EAAE,CAAC"} -------------------------------------------------------------------------------- /dist/extractors/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extractors/index.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAGzB,mBAHF,kBAAQ,CAGE;AAFjB,wDAAgC;AAEb,kBAFZ,iBAAO,CAEY"} -------------------------------------------------------------------------------- /dist/extractors/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extractors/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC"} -------------------------------------------------------------------------------- /test/index.ts: -------------------------------------------------------------------------------- 1 | import { MOVIES } from "../src"; 2 | 3 | (async () => { 4 | const FlixHQ = new MOVIES.FlixHQ(); 5 | const data = await FlixHQ.fetchMovieInfo('tv/watch-junji-ito-maniac-japanese-tales-of-the-macabre-92398'); 6 | console.log(data); 7 | })(); -------------------------------------------------------------------------------- /dist/extractors/mixdrop.d.ts: -------------------------------------------------------------------------------- 1 | import { IVideoResult } from "../types/types"; 2 | declare class MixDrop { 3 | protected serverName: string; 4 | extract: (videoUrl: URL) => Promise; 5 | private formatter; 6 | } 7 | export default MixDrop; 8 | //# sourceMappingURL=mixdrop.d.ts.map -------------------------------------------------------------------------------- /dist/extractors/mixdrop.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mixdrop.d.ts","sourceRoot":"","sources":["../../src/extractors/mixdrop.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAM,OAAO;IACT,SAAS,CAAC,UAAU,SAAa;IAEjC,OAAO,aAAoB,GAAG,2BA8B7B;IAED,OAAO,CAAC,SAAS,CA+BhB;CACJ;AAED,eAAe,OAAO,CAAC"} -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const src_1 = require("../src"); 4 | (async () => { 5 | const FlixHQ = new src_1.MOVIES.FlixHQ(); 6 | const data = await FlixHQ.home(); 7 | console.log(data); 8 | })(); 9 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.MOVIES = void 0; 4 | const crawler_1 = require("./crawler"); 5 | Object.defineProperty(exports, "MOVIES", { enumerable: true, get: function () { return crawler_1.MOVIES; } }); 6 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /test/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,gCAAgC;AAEhC,CAAC,KAAK,IAAI,EAAE;IACR,MAAM,MAAM,GAAG,IAAI,YAAM,CAAC,MAAM,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC,CAAC,EAAE,CAAC"} -------------------------------------------------------------------------------- /dist/extractors/vidcloud.d.ts: -------------------------------------------------------------------------------- 1 | import { IVideoResult } from '../types/types'; 2 | declare class VidCloud { 3 | protected serverName: string; 4 | private readonly host; 5 | private readonly host2; 6 | extract: (videoUrl: URL, isAlternative?: boolean) => Promise; 7 | } 8 | export default VidCloud; 9 | //# sourceMappingURL=vidcloud.d.ts.map -------------------------------------------------------------------------------- /dist/extractors/vidcloud.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vidcloud.d.ts","sourceRoot":"","sources":["../../src/extractors/vidcloud.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,cAAM,QAAQ;IACV,SAAS,CAAC,UAAU,SAAc;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2B;IAChD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IAEpD,OAAO,aAAoB,GAAG,kBAAiB,OAAO,KAAW,QAAQ,YAAY,CAAC,CAoDrF;CACJ;AAED,eAAe,QAAQ,CAAC"} -------------------------------------------------------------------------------- /dist/crawler/movies/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const flixhq_1 = __importDefault(require("./flixhq")); 7 | exports.default = { FlixHQ: flixhq_1.default }; 8 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/crawler/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | exports.MOVIES = void 0; 7 | const movies_1 = __importDefault(require("./movies")); 8 | exports.MOVIES = movies_1.default; 9 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/utils/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAa,MAAM,gBAAgB,CAAC;AAGrE,eAAO,MAAM,YAAY,MAAO,QAAQ,OAAO,CAAC,WAAW,MAAM,iBAgBhE,CAAA;AAED,eAAO,MAAM,MAAM,SAAU,MAAM,KAAG,OAQrC,CAAA;AAGD,eAAO,MAAM,YAAY,MAAO,UAAU,aAAa,UAAU,WAAW,MAAM,SAiCjF,CAAA"} -------------------------------------------------------------------------------- /dist/utils/index.d.ts: -------------------------------------------------------------------------------- 1 | import { AnyNode, Cheerio, CheerioAPI } from "cheerio"; 2 | import { IMovieInfo, IMovieResult } from "../types/types"; 3 | export declare const setMovieData: ($: Cheerio, baseUrl: string) => IMovieResult; 4 | export declare const isJson: (data: string) => boolean; 5 | export declare const setMovieInfo: ($: CheerioAPI, movieInfo: IMovieInfo, baseUrl: string) => void; 6 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /dist/extractors/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | exports.MixDrop = exports.VidCloud = void 0; 7 | const vidcloud_1 = __importDefault(require("./vidcloud")); 8 | exports.VidCloud = vidcloud_1.default; 9 | const mixdrop_1 = __importDefault(require("./mixdrop")); 10 | exports.MixDrop = mixdrop_1.default; 11 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /dist/types/types.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,4BAAe,CAAA;IACf,iCAAoB,CAAA;IACpB,wBAAW,CAAA;AACf,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAED,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,oCAAqB,CAAA;IACrB,6CAA8B,CAAA;IAC9B,kDAAmC,CAAA;IACnC,0CAA2B,CAAA;AAC/B,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,IAAY,MAGX;AAHD,WAAY,MAAM;IACd,yBAAe,CAAA;IACf,6BAAmB,CAAA;AACvB,CAAC,EAHW,MAAM,GAAN,cAAM,KAAN,cAAM,QAGjB;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;AACvB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flixhq-core", 3 | "version": "1.1.1", 4 | "description": "Nodejs library that provides an Api for obtaining the movies information from FlixHQ website.", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "dev": "nodemon src/index.ts", 8 | "build": "tsc", 9 | "test": "nodemon test/index.ts" 10 | }, 11 | "keywords": [ 12 | "api", 13 | "crawler", 14 | "library", 15 | "movies", 16 | "core", 17 | "apis", 18 | "nodejs", 19 | "movies-api" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/shin202/flixhq-core.git" 24 | }, 25 | "author": "Shin", 26 | "license": "MIT", 27 | "devDependencies": { 28 | "@types/crypto-js": "^4.1.1", 29 | "nodemon": "^2.0.20", 30 | "ts-node": "^10.9.1", 31 | "typescript": "^5.0.2" 32 | }, 33 | "dependencies": { 34 | "axios": "^1.2.4", 35 | "cheerio": "^1.0.0-rc.12", 36 | "crypto-js": "^4.1.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Trần Việt Hoàng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist/types/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.StreamingServers = exports.Filter = exports.MovieReport = exports.MovieType = void 0; 4 | var MovieType; 5 | (function (MovieType) { 6 | MovieType["MOVIE"] = "movie"; 7 | MovieType["TVSERIES"] = "tv-show"; 8 | MovieType["ALL"] = "all"; 9 | })(MovieType = exports.MovieType || (exports.MovieType = {})); 10 | var MovieReport; 11 | (function (MovieReport) { 12 | MovieReport["TRENDING"] = "Trending"; 13 | MovieReport["LATEST_MOVIE"] = "Latest Movies"; 14 | MovieReport["LATEST_TV_SHOWS"] = "Latest TV Shows"; 15 | MovieReport["COMING_SOON"] = "Coming Soon"; 16 | })(MovieReport = exports.MovieReport || (exports.MovieReport = {})); 17 | var Filter; 18 | (function (Filter) { 19 | Filter["GENRE"] = "genre"; 20 | Filter["COUNTRY"] = "country"; 21 | })(Filter = exports.Filter || (exports.Filter = {})); 22 | var StreamingServers; 23 | (function (StreamingServers) { 24 | StreamingServers["UpCloud"] = "UpCloud"; 25 | StreamingServers["VidCloud"] = "Vidcloud"; 26 | StreamingServers["MixDrop"] = "MixDrop"; 27 | })(StreamingServers = exports.StreamingServers || (exports.StreamingServers = {})); 28 | //# sourceMappingURL=types.js.map -------------------------------------------------------------------------------- /dist/crawler/movies/flixhq.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"flixhq.d.ts","sourceRoot":"","sources":["../../../src/crawler/movies/flixhq.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,MAAM,EACN,QAAQ,EACR,cAAc,EACd,MAAM,EACN,WAAW,EAEX,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,OAAO,EAGP,SAAS,EACT,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;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AAC,CA4DjD;IAED,MAAM,YAAmB,YAAY,SAAQ,MAAM,KAAO,QAAQ,QAAQ,YAAY,CAAC,CAAC,CAmCvF;CACJ;AAED,eAAe,MAAM,CAAC"} -------------------------------------------------------------------------------- /dist/extractors/vidcloud.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vidcloud.js","sourceRoot":"","sources":["../../src/extractors/vidcloud.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,0DAAiC;AAEjC,oCAAkC;AAElC,MAAM,QAAQ;IACA,UAAU,GAAG,UAAU,CAAC;IACjB,IAAI,GAAG,uBAAuB,CAAC;IAC/B,KAAK,GAAG,0BAA0B,CAAC;IAEpD,OAAO,GAAG,KAAK,EAAE,QAAa,EAAE,gBAAyB,KAAK,EAAyB,EAAE;QACrF,MAAM,WAAW,GAAiB;YAC9B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACf,CAAA;QAED,IAAI;YACA,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACzD,MAAM,OAAO,GAAG;gBACZ,OAAO,EAAE;oBACL,kBAAkB,EAAE,gBAAgB;oBACpC,SAAS,EAAE,QAAQ,CAAC,IAAI;iBAC3B;aACJ,CAAC;YACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,+BAA+B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YAExH,IAAI,OAAO,GAAG,IAAI,CAAC;YAEnB,IAAI,CAAC,IAAA,cAAM,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACvB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,eAAK,CAAC,GAAG,CAA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AC,KAAU,EAAE,EAAE;gBAClD,OAAO;oBACH,GAAG,EAAE,KAAK,CAAC,IAAI;oBACf,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,SAAS;iBACjC,CAAA;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,WAAW,CAAC;SACtB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;SAC3C;IACL,CAAC,CAAA;CACJ;AAED,kBAAe,QAAQ,CAAC"} -------------------------------------------------------------------------------- /dist/crawler/movies/flixhq.d.ts: -------------------------------------------------------------------------------- 1 | import { Filter, ICountry, IEpisodeServer, IGenre, IHomeResult, IMovieFilter, IMovieInfo, IMovieResult, ISearch, MovieType, StreamingServers } from "../../types/types"; 2 | declare class FlixHQ { 3 | readonly name = "FlixHQ"; 4 | protected baseUrl: string; 5 | protected classPath: string; 6 | protected supportedTypes: MovieType[]; 7 | private fetchSlider; 8 | private fetchTrendingMovies; 9 | private fetchTrendingTvShows; 10 | private fetchMovieSections; 11 | home: () => Promise; 12 | fetchGenresList: () => Promise; 13 | fetchCountriesList: () => Promise; 14 | /** 15 | * 16 | * @param filterBy Type of the filter 17 | * @param query Query depend on the filter 18 | * @param page 19 | * @returns 20 | */ 21 | fetchMovieByGenreOrCountry: (filterBy: Filter, query: string, page?: number) => Promise>; 22 | /** 23 | * 24 | * @param type Type of the video (MOVIE or TVSERIES) 25 | * @param page 26 | * @returns 27 | */ 28 | fetchMovieByType: (type: MovieType, page?: number) => Promise>; 29 | /** 30 | * 31 | * @param type 32 | * @param page 33 | * @returns 34 | */ 35 | fetchMovieByTopIMDB: (type?: MovieType, page?: number) => Promise>; 36 | private fetchTvShowSeasons; 37 | private fetchTvShowEpisodes; 38 | private fetchTvShowEpisodeInfo; 39 | private fetchTvShowSeasonInfo; 40 | /** 41 | * Get Info of the video 42 | * 43 | * @param mediaId 44 | * @returns 45 | */ 46 | fetchMovieInfo: (mediaId: string) => Promise; 47 | fetchEpisodeServers: (mediaId: string, episodeId: string) => Promise; 48 | fetchEpisodeSources: (mediaId: string, episodeId: string, server?: StreamingServers) => Promise; 49 | search: (query: string, page?: number) => Promise>; 50 | fetchFiltersList: () => Promise; 51 | filter: (options: IMovieFilter, page?: number) => Promise>; 52 | } 53 | export default FlixHQ; 54 | //# sourceMappingURL=flixhq.d.ts.map -------------------------------------------------------------------------------- /dist/extractors/mixdrop.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mixdrop.js","sourceRoot":"","sources":["../../src/extractors/mixdrop.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,qCAA+B;AAG/B,MAAM,OAAO;IACC,UAAU,GAAG,SAAS,CAAC;IAEjC,OAAO,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;QAC9B,MAAM,WAAW,GAAiB;YAC9B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACf,CAAA;QAED,IAAI;YACA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAChD,MAAM,KAAK,GAAG,IAAA,cAAI,EAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAEjE,IAAI,CAAC,KAAK,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;aACvC;YAED,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1G,MAAM,SAAS,GAAG,IAAI,CAAC,S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AAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;aAC5C;YAED,CAAC,GAAG,CAAC,UAAU,CAAM;oBACjB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChB,CAAC;aACA,CAAC;YAEF,CAAC,GAAG;gBACA,OAAO,MAAM,CAAC;YAClB,CAAC,CAAA;YAED,CAAC,GAAG,CAAC,CAAC;SACT;QAED,OAAO,CAAC,EAAE,EAAE;YACR,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;gBACN,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9D;SACJ;QAED,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;CACJ;AAED,kBAAe,OAAO,CAAC"} -------------------------------------------------------------------------------- /src/extractors/mixdrop.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { load } from "cheerio"; 3 | import { IVideoResult } from "../types/types"; 4 | 5 | class MixDrop { 6 | protected serverName = 'MixDrop'; 7 | 8 | extract = async (videoUrl: URL) => { 9 | const videoResult: IVideoResult = { 10 | sources: [], 11 | subtitles: [] 12 | } 13 | 14 | try { 15 | const { data } = await axios.get(videoUrl.href); 16 | const match = load(data).html().match(/return p}(.+?)wurl.+?}/g); 17 | 18 | if (!match) { 19 | throw new Error('Video not found!'); 20 | } 21 | 22 | const [p, a, c, k, e, d] = match[0].replace(/return p}\(/, '').split(',').map(o => o.split('.split(')[0]); 23 | const formatted = this.formatter(p, a, c, k, e, JSON.parse(d)); 24 | 25 | const url = /MDCore\.wurl="(.+?)\"/g.exec(formatted)?.pop(); 26 | const poster = /MDCore\.poster\'?="(.+?)\"/g.exec(formatted)?.pop(); 27 | 28 | videoResult.sources.push({ 29 | url: url?.startsWith('https') ? url : `https:${url}`, 30 | poster: poster?.startsWith('https') ? poster : `https:${poster}`, 31 | isM3U8: url!.includes('.m3u8'), 32 | }); 33 | 34 | return videoResult; 35 | } catch (err) { 36 | throw new Error((err as Error).message); 37 | } 38 | } 39 | 40 | private formatter = (p: any, a: any, c: any, k: any, e: any, d: any) => { 41 | k = k.split('|'); 42 | 43 | e = function (c: any) { 44 | return c.toString(36); 45 | } 46 | 47 | if (!''.replace(/^/, String)) { 48 | while (c--) { 49 | d[c.toString(a)] = k[c] || c.toString(a); 50 | } 51 | 52 | k = [function (e: any) { 53 | return d[e]; 54 | } 55 | ]; 56 | 57 | e = function () { 58 | return '\\w+'; 59 | } 60 | 61 | c = 1; 62 | } 63 | 64 | while (c--) { 65 | if (k[c]) { 66 | p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); 67 | } 68 | } 69 | 70 | return p; 71 | } 72 | } 73 | 74 | export default MixDrop; -------------------------------------------------------------------------------- /dist/extractors/mixdrop.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const axios_1 = __importDefault(require("axios")); 7 | const cheerio_1 = require("cheerio"); 8 | class MixDrop { 9 | serverName = 'MixDrop'; 10 | extract = async (videoUrl) => { 11 | const videoResult = { 12 | sources: [], 13 | subtiles: [] 14 | }; 15 | try { 16 | const { data } = await axios_1.default.get(videoUrl.href); 17 | const match = (0, cheerio_1.load)(data).html().match(/return p}(.+?)wurl.+?}/g); 18 | if (!match) { 19 | throw new Error('Video not found!'); 20 | } 21 | const [p, a, c, k, e, d] = match[0].replace(/return p}\(/, '').split(',').map(o => o.split('.split(')[0]); 22 | const formatted = this.formatter(p, a, c, k, e, JSON.parse(d)); 23 | const url = /MDCore\.wurl="(.+?)\"/g.exec(formatted)?.pop(); 24 | const poster = /MDCore\.poster\'?="(.+?)\"/g.exec(formatted)?.pop(); 25 | videoResult.sources.push({ 26 | url: url?.startsWith('https') ? url : `https:${url}`, 27 | poster: poster?.startsWith('https') ? poster : `https:${poster}`, 28 | isM3U8: url.includes('.m3u8'), 29 | }); 30 | return videoResult; 31 | } 32 | catch (err) { 33 | throw new Error(err.message); 34 | } 35 | }; 36 | formatter = (p, a, c, k, e, d) => { 37 | k = k.split('|'); 38 | e = function (c) { 39 | return c.toString(36); 40 | }; 41 | if (!''.replace(/^/, String)) { 42 | while (c--) { 43 | d[c.toString(a)] = k[c] || c.toString(a); 44 | } 45 | k = [function (e) { 46 | return d[e]; 47 | } 48 | ]; 49 | e = function () { 50 | return '\\w+'; 51 | }; 52 | c = 1; 53 | } 54 | while (c--) { 55 | if (k[c]) { 56 | p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); 57 | } 58 | } 59 | return p; 60 | }; 61 | } 62 | exports.default = MixDrop; 63 | //# sourceMappingURL=mixdrop.js.map -------------------------------------------------------------------------------- /dist/extractors/vidcloud.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const axios_1 = __importDefault(require("axios")); 7 | const crypto_js_1 = __importDefault(require("crypto-js")); 8 | const utils_1 = require("../utils"); 9 | class VidCloud { 10 | serverName = 'VidCloud'; 11 | host = 'https://dokicloud.one'; 12 | host2 = 'https://rabbitstream.net'; 13 | extract = async (videoUrl, isAlternative = false) => { 14 | const videoResult = { 15 | sources: [], 16 | subtiles: [], 17 | }; 18 | try { 19 | const id = videoUrl.href.split('/').pop()?.split('?')[0]; 20 | const options = { 21 | headers: { 22 | 'X-Requested-With': 'XMLHttpRequest', 23 | 'Referer': videoUrl.href, 24 | }, 25 | }; 26 | const { data } = await axios_1.default.get(`${isAlternative ? this.host2 : this.host}/ajax/embed-4/getSources?id=${id}`, options); 27 | let sources = null; 28 | if (!(0, utils_1.isJson)(data.sources)) { 29 | const key = await (await axios_1.default.get('https://raw.githubusercontent.com/enimax-anime/key/e4/key.txt')).data; 30 | sources = JSON.parse(crypto_js_1.default.AES.decrypt(data.sources, key).toString(crypto_js_1.default.enc.Utf8)); 31 | } 32 | for (const source of sources) { 33 | const { data } = await axios_1.default.get(source.file, options); 34 | const videoUrls = data.split('\n').filter((line) => line.includes('.m3u8')); 35 | const videoQualities = data.split('\n').filter((line) => line.includes('RESOLUTION=')); 36 | videoQualities.map((item, i) => { 37 | const quality = item.split(',')[2].split('x')[1]; 38 | const url = videoUrls[i]; 39 | videoResult.sources.push({ 40 | url: url, 41 | quality: quality, 42 | isM3U8: url.includes('.m3u8'), 43 | }); 44 | }); 45 | } 46 | videoResult.subtiles = data.tracks.map((track) => { 47 | return { 48 | url: track.file, 49 | lang: track.label ?? 'Default', 50 | }; 51 | }); 52 | return videoResult; 53 | } 54 | catch (err) { 55 | throw new Error(err.message); 56 | } 57 | }; 58 | } 59 | exports.default = VidCloud; 60 | //# sourceMappingURL=vidcloud.js.map -------------------------------------------------------------------------------- /src/extractors/vidcloud.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import CryptoJS from 'crypto-js'; 3 | import {IVideoResult} from '../types/types'; 4 | import {isJson} from '../utils'; 5 | 6 | class VidCloud { 7 | protected serverName = 'VidCloud'; 8 | private readonly host = 'https://dokicloud.one'; 9 | private readonly host2 = 'https://rabbitstream.net'; 10 | 11 | extract = async (videoUrl: URL, isAlternative: boolean = false): Promise => { 12 | const videoResult: IVideoResult = { 13 | sources: [], 14 | subtitles: [], 15 | } 16 | 17 | try { 18 | const id = videoUrl.href.split('/').pop()?.split('?')[0]; 19 | const options = { 20 | headers: { 21 | 'X-Requested-With': 'XMLHttpRequest', 22 | 'Referer': videoUrl.href, 23 | }, 24 | }; 25 | const {data} = await axios.get(`${isAlternative ? this.host2 : this.host}/ajax/embed-4/getSources?id=${id}`, options); 26 | 27 | let sources = null; 28 | 29 | if (!isJson(data.sources)) { 30 | let keys = await (await axios.get('https://keys4.fun')).data["rabbitstream"]["keys"]; 31 | const keyString = btoa(String.fromCharCode.apply(null, Array.from(new Uint8Array(keys)))); 32 | const decryptedVal = CryptoJS.AES.decrypt(res.data.sources, keyString).toString(CryptoJS.enc.Utf8); 33 | sources = JSON.parse(CryptoJS.AES.decrypt(res.data.sources, keyString).toString(CryptoJS.enc.Utf8)); 34 | sources = isJson(decryptedVal) ? JSON.parse(decryptedVal) : res.data.sources; 35 | } 36 | 37 | for (const source of sources) { 38 | const {data} = await axios.get(source.file, options); 39 | const videoUrls = data.split('\n').filter((line: string) => line.includes('.m3u8')) as string[]; 40 | const videoQualities = data.split('\n').filter((line: string) => line.includes('RESOLUTION=')) as string[]; 41 | 42 | videoQualities.map((item, i) => { 43 | const quality = item.split(',')[2].split('x')[1]; 44 | const url = videoUrls[i]; 45 | 46 | videoResult.sources.push({ 47 | url: url, 48 | quality: quality, 49 | isM3U8: url.includes('.m3u8'), 50 | }); 51 | }); 52 | } 53 | 54 | videoResult.subtitles = data.tracks.map((track: any) => { 55 | return { 56 | url: track.file, 57 | lang: track.label ?? 'Default', 58 | } 59 | }); 60 | 61 | return videoResult; 62 | } catch (err) { 63 | throw new Error((err as Error).message); 64 | } 65 | } 66 | } 67 | 68 | export default VidCloud; 69 | -------------------------------------------------------------------------------- /dist/types/types.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACjB,KAAK,UAAU;IACf,QAAQ,YAAY;IACpB,GAAG,QAAQ;CACd;AAED,oBAAY,WAAW;IACnB,QAAQ,aAAa;IACrB,YAAY,kBAAkB;IAC9B,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;CAC9B;AAED,oBAAY,MAAM;IACd,KAAK,UAAU;IACf,OAAO,YAAY;CACtB;AAED,oBAAY,gBAAgB;IACxB,OAAO,YAAY;IAC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,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC1B,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,eAAe,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,UAAU,EAAE,YAAY,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,KAAK;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAC,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;IACtB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"} -------------------------------------------------------------------------------- /dist/types/types.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum MovieType { 2 | MOVIE = "movie", 3 | TVSERIES = "tv-show", 4 | ALL = "all" 5 | } 6 | export declare enum MovieReport { 7 | TRENDING = "Trending", 8 | LATEST_MOVIE = "Latest Movies", 9 | LATEST_TV_SHOWS = "Latest TV Shows", 10 | COMING_SOON = "Coming Soon" 11 | } 12 | export declare enum Filter { 13 | GENRE = "genre", 14 | COUNTRY = "country" 15 | } 16 | export declare enum StreamingServers { 17 | UpCloud = "UpCloud", 18 | VidCloud = "Vidcloud", 19 | MixDrop = "MixDrop" 20 | } 21 | export interface ISliderDetail { 22 | quality: string; 23 | duration: string; 24 | imdb: string; 25 | genres: string[]; 26 | } 27 | export interface ISlider { 28 | image: string; 29 | title: string; 30 | detail: ISliderDetail; 31 | description: string; 32 | } 33 | export interface IMovieResult { 34 | id: string; 35 | title: string; 36 | url?: string; 37 | image?: string; 38 | releaseDate?: string | null; 39 | type?: MovieType; 40 | [x: string]: unknown; 41 | } 42 | export interface IHomeResult { 43 | slider: ISlider[]; 44 | moviesSection: { 45 | trending: { 46 | trendingMovies: IMovieResult[]; 47 | trendingTVShows: IMovieResult[]; 48 | }; 49 | latestMovies: IMovieResult[]; 50 | latestTvShows: IMovieResult[]; 51 | comingSoon: IMovieResult[]; 52 | }; 53 | } 54 | export interface IGenre { 55 | id?: number; 56 | title: string; 57 | url: string; 58 | } 59 | export interface ICountry { 60 | id?: number; 61 | title: string; 62 | url: string; 63 | } 64 | export interface ISearch { 65 | currentPage?: number; 66 | hasNextPage?: boolean; 67 | totalPages?: number; 68 | totalResults?: number; 69 | results: T[]; 70 | } 71 | export interface IMovieEpisode { 72 | id: string; 73 | title: string; 74 | url?: string; 75 | episode?: number; 76 | seasons?: number; 77 | [x: string]: unknown; 78 | } 79 | export interface IMovieInfo extends IMovieResult { 80 | cover: string; 81 | description: string; 82 | episodes: IMovieEpisode[]; 83 | recommended?: IMovieResult[]; 84 | country?: ICountry; 85 | genres?: string[]; 86 | productions?: string[]; 87 | casts?: string[]; 88 | tags?: string[]; 89 | duration?: string; 90 | rating?: number; 91 | quality?: string; 92 | } 93 | export interface IEpisodeServer { 94 | id: string; 95 | name: string; 96 | url: string; 97 | } 98 | export interface IVideo { 99 | url: string; 100 | quality?: string; 101 | isM3U8: boolean; 102 | poster?: string; 103 | } 104 | export interface ISubtile { 105 | url: string; 106 | lang: string; 107 | } 108 | export interface IVideoResult { 109 | sources: IVideo[]; 110 | subtiles: ISubtile[]; 111 | } 112 | export interface IMovieSection { 113 | trendingMovies: IMovieResult[]; 114 | trendingTVShows: IMovieResult[]; 115 | latestMovies: IMovieResult[]; 116 | latestTvShows: IMovieResult[]; 117 | comingSoon: IMovieResult[]; 118 | } 119 | export interface IItem { 120 | label: string; 121 | value: string | number; 122 | } 123 | export interface IMovieFilter { 124 | genres?: IItem[]; 125 | countries?: IItem[]; 126 | types?: IItem[]; 127 | qualities?: IItem[]; 128 | releaseYear?: IItem[]; 129 | [x: string]: unknown; 130 | } 131 | //# sourceMappingURL=types.d.ts.map -------------------------------------------------------------------------------- /src/types/types.ts: -------------------------------------------------------------------------------- 1 | export enum MovieType { 2 | MOVIE = 'movie', 3 | TVSERIES = 'tv-show', 4 | ALL = 'all', 5 | } 6 | 7 | export enum MovieReport { 8 | TRENDING = 'Trending', 9 | LATEST_MOVIE = 'Latest Movies', 10 | LATEST_TV_SHOWS = 'Latest TV Shows', 11 | COMING_SOON = 'Coming Soon', 12 | } 13 | 14 | export enum Filter { 15 | GENRE = 'genre', 16 | COUNTRY = 'country', 17 | } 18 | 19 | export enum StreamingServers { 20 | UpCloud = 'UpCloud', 21 | VidCloud = 'Vidcloud', 22 | MixDrop = 'MixDrop', 23 | } 24 | 25 | export interface ISliderDetail { 26 | quality: string, 27 | duration: string, 28 | imdb: string, 29 | genres: string[], 30 | } 31 | 32 | export interface ISlider { 33 | image: string, 34 | title: string, 35 | detail: ISliderDetail, 36 | description: string, 37 | } 38 | 39 | export interface IMovieResult { 40 | id: string, 41 | title: string, 42 | url?: string, 43 | image?: string, 44 | releaseDate?: string | null, 45 | type?: MovieType, 46 | [x: string]: unknown, 47 | } 48 | 49 | export interface IHomeResult { 50 | slider: ISlider[], 51 | moviesSection: { 52 | trending: { 53 | trendingMovies: IMovieResult[], 54 | trendingTVShows: IMovieResult[], 55 | }, 56 | latestMovies: IMovieResult[], 57 | latestTvShows: IMovieResult[], 58 | comingSoon: IMovieResult[], 59 | } 60 | } 61 | 62 | export interface IGenre { 63 | id?: number, 64 | title: string, 65 | url: string, 66 | } 67 | 68 | export interface ICountry { 69 | id?: number 70 | title: string, 71 | url: string, 72 | } 73 | 74 | export interface ISearch { 75 | currentPage?: number, 76 | hasNextPage?: boolean, 77 | totalPages?: number, 78 | totalResults?: number, 79 | results: T[], 80 | } 81 | 82 | export interface IMovieEpisode { 83 | id: string, 84 | title: string, 85 | url?: string, 86 | episode?: number, 87 | seasons?: number, 88 | [x: string]: unknown, 89 | } 90 | 91 | export interface IMovieInfo extends IMovieResult { 92 | cover: string, 93 | description: string, 94 | episodes: IMovieEpisode[], 95 | recommended?: IMovieResult[], 96 | country?: ICountry, 97 | genres?: string[], 98 | productions?: string[], 99 | casts?: string[], 100 | tags?: string[], 101 | duration?: string, 102 | rating?: number, 103 | quality?: string, 104 | } 105 | 106 | export interface IEpisodeServer { 107 | id: string, 108 | name: string, 109 | url: string, 110 | } 111 | 112 | export interface IVideo { 113 | url: string, 114 | quality?: string, 115 | isM3U8: boolean, 116 | poster?: string, 117 | } 118 | 119 | export interface ISubtile { 120 | url: string, 121 | lang: string, 122 | } 123 | 124 | export interface IVideoResult { 125 | sources: IVideo[], 126 | subtitles: ISubtile[], 127 | } 128 | 129 | export interface IMovieSection { 130 | trendingMovies: IMovieResult[], 131 | trendingTVShows: IMovieResult[], 132 | latestMovies: IMovieResult[], 133 | latestTvShows: IMovieResult[], 134 | comingSoon: IMovieResult[], 135 | } 136 | 137 | export interface IItem { 138 | label: string, 139 | value: string|number, 140 | } 141 | 142 | export interface IMovieFilter { 143 | genres?: IItem[], 144 | countries?: IItem[], 145 | types?: IItem[]; 146 | qualities?: IItem[], 147 | releaseYear?: IItem[], 148 | [x: string]: unknown, 149 | } -------------------------------------------------------------------------------- /dist/utils/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AACA,0CAAqE;AAErE,mCAAmC;AAC5B,MAAM,YAAY,GAAG,CAAC,CAAmB,EAAE,OAAe,EAAE,EAAE;IACjE,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC,IAAI,EAAE,CAAC;IACvF,MAAM,aAAa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DAA8D,CAAC;SAC7E,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IACxC,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC,8CAA8C,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9E,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACxF,SAAS,CAAC,OAAO,GAAG,CAAC,CAAC,8CAA8C,CAAC,CAAC,IAAI,EAAE,CAAC;IAE7E,CAAC,CAAC,gGAAgG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC/G,cAAc,CAAC,IAAI,CAAC,IAAA,oBAAY,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,WAAW,GAAG,cAAc,CAAC;AAC3C,CAAC,CAAA;AAjCY,QAAA,YAAY,gBAiCxB"} -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { AnyNode, Cheerio, CheerioAPI } from "cheerio"; 2 | import { IMovieInfo, IMovieResult, MovieType } from "../types/types"; 3 | 4 | // Short informations of the movie. 5 | export const setMovieData = ($: Cheerio, baseUrl: string) => { 6 | const releaseDate = $.find('.film-detail > .fd-infor > .fdi-item:nth-child(1)').text(); 7 | const totalEpisodes = $.find('.film-detail > .fd-infor > span:nth-child(3)').text(); 8 | const movieData: IMovieResult = { 9 | id: $.find('.film-poster > .film-poster-ahref').attr('href')?.slice(1)!, 10 | title: $.find('.film-detail > .film-name > a').attr('title')!, 11 | url: `${baseUrl}${$.find('.film-detail > .film-name > a').attr('href')}`!, 12 | image: $.find('.film-poster-img').attr('data-src'), 13 | releaseDate: isNaN(parseInt(releaseDate)) ? null : releaseDate, 14 | type: $.find('.film-detail > .fd-infor > .fdi-type').text() === 'Movie' ? MovieType.MOVIE : MovieType.TVSERIES, 15 | duration: $.find('.film-detail > .fd-infor > .fdi-duration').text(), 16 | seasons: releaseDate.includes('SS') && !isNaN(parseInt(releaseDate.split('SS')[1])) ? parseInt(releaseDate.split('SS')[1]) : null, 17 | lastEpisodes: totalEpisodes.includes('EPS') && !isNaN(parseInt(totalEpisodes.split('EPS')[1])) ? parseInt(totalEpisodes.split('EPS')[1]) : null, 18 | }; 19 | 20 | return movieData; 21 | } 22 | 23 | export const isJson = (data: string): boolean => { 24 | try { 25 | JSON.parse(data); 26 | } catch (err) { 27 | return false; 28 | } 29 | 30 | return true; 31 | } 32 | 33 | // Detail information of the movie. 34 | export const setMovieInfo = ($: CheerioAPI, movieInfo: IMovieInfo, baseUrl: string) => { 35 | const coverImageRegex = new RegExp(/^background-image: url\((.*)\)/); 36 | const cover = $('.watch_block > .w_b-cover').attr('style')!; 37 | const match = cover.match(coverImageRegex)!; 38 | const recommendedArr: IMovieResult[] = []; 39 | 40 | movieInfo.title = $('.heading-name > a:nth-child(1)').text(); 41 | movieInfo.url = `${baseUrl}${$('.heading-name > a:nth-child(1)').attr('href')}`; 42 | movieInfo.cover = match[1]; 43 | movieInfo.image = $('.m_i-d-poster > .film-poster > img:nth-child(1)').attr('src')!; 44 | movieInfo.description = $('.m_i-d-content > .description').text(); 45 | movieInfo.releaseDate = $('.m_i-d-content > .elements > .row-line:nth-child(3)').text().replace('Released: ', '').trim(); 46 | movieInfo.type = movieInfo.id.split('/')[0] === 'movie' ? MovieType.MOVIE : MovieType.TVSERIES; 47 | movieInfo.country = { 48 | title: $('.m_i-d-content > .elements > .row-line:nth-child(1) > a').attr('title')!, 49 | url: $('.m_i-d-content > .elements > .row-line:nth-child(1) > a').attr('href')?.slice(1)!, 50 | }; 51 | movieInfo.genres = $('.m_i-d-content > .elements > .row-line:nth-child(2) > a') 52 | .map((_, el) => $(el).attr('title')).get(); 53 | movieInfo.productions = $('.m_i-d-content > .elements > .row-line:nth-child(4) > a') 54 | .map((_, el) => $(el).attr('title')).get(); 55 | movieInfo.casts = $('.m_i-d-content > .elements > .row-line:nth-child(5) > a') 56 | .map((_, el) => $(el).attr('title')).get(); 57 | movieInfo.tags = $('.m_i-d-content > .elements > .row-line:nth-child(6) > .h-tag') 58 | .map((_, el) => $(el).text()).get(); 59 | movieInfo.duration = $('.m_i-d-content > .stats > .item:nth-child(3)').text(); 60 | movieInfo.rating = parseFloat($('.m_i-d-content > .stats > .item:nth-child(2)').text()); 61 | movieInfo.quality = $('.m_i-d-content > .stats > .item:nth-child(1)').text(); 62 | 63 | $('.m_i-related > .film-related > .block_area > .block_area-content > .film_list-wrap > .flw-item').each((_, el) => { 64 | recommendedArr.push(setMovieData($(el), baseUrl)); 65 | }); 66 | movieInfo.recommended = recommendedArr; 67 | } -------------------------------------------------------------------------------- /dist/utils/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.setMovieInfo = exports.isJson = exports.setMovieData = void 0; 4 | const types_1 = require("../types/types"); 5 | // Short informations of the movie. 6 | const setMovieData = ($, baseUrl) => { 7 | const releaseDate = $.find('.film-detail > .fd-infor > .fdi-item:nth-child(1)').text(); 8 | const totalEpisodes = $.find('.film-detail > .fd-infor > span:nth-child(3)').text(); 9 | const movieData = { 10 | id: $.find('.film-poster > .film-poster-ahref').attr('href')?.slice(1), 11 | title: $.find('.film-detail > .film-name > a').attr('title'), 12 | url: `${baseUrl}${$.find('.film-detail > .film-name > a').attr('href')}`, 13 | image: $.find('.film-poster-img').attr('data-src'), 14 | releaseDate: isNaN(parseInt(releaseDate)) ? null : releaseDate, 15 | type: $.find('.film-detail > .fd-infor > .fdi-type').text() === 'Movie' ? types_1.MovieType.MOVIE : types_1.MovieType.TVSERIES, 16 | duration: $.find('.film-detail > .fd-infor > .fdi-duration').text(), 17 | seasons: releaseDate.includes('SS') && !isNaN(parseInt(releaseDate.split('SS')[1])) ? parseInt(releaseDate.split('SS')[1]) : null, 18 | lastEpisodes: totalEpisodes.includes('EPS') && !isNaN(parseInt(totalEpisodes.split('EPS')[1])) ? parseInt(totalEpisodes.split('EPS')[1]) : null, 19 | }; 20 | return movieData; 21 | }; 22 | exports.setMovieData = setMovieData; 23 | const isJson = (data) => { 24 | try { 25 | JSON.parse(data); 26 | } 27 | catch (err) { 28 | return false; 29 | } 30 | return true; 31 | }; 32 | exports.isJson = isJson; 33 | // Detail information of the movie. 34 | const setMovieInfo = ($, movieInfo, baseUrl) => { 35 | const coverImageRegex = new RegExp(/^background-image: url\((.*)\)/); 36 | const cover = $('.watch_block > .w_b-cover').attr('style'); 37 | const match = cover.match(coverImageRegex); 38 | const recommendedArr = []; 39 | movieInfo.title = $('.heading-name > a:nth-child(1)').text(); 40 | movieInfo.url = `${baseUrl}${$('.heading-name > a:nth-child(1)').attr('href')}`; 41 | movieInfo.cover = match[1]; 42 | movieInfo.image = $('.m_i-d-poster > .film-poster > img:nth-child(1)').attr('src'); 43 | movieInfo.description = $('.m_i-d-content > .description').text(); 44 | movieInfo.releaseDate = $('.m_i-d-content > .elements > .row-line:nth-child(3)').text().replace('Released: ', '').trim(); 45 | movieInfo.type = movieInfo.id.split('/')[0] === 'movie' ? types_1.MovieType.MOVIE : types_1.MovieType.TVSERIES; 46 | movieInfo.country = { 47 | title: $('.m_i-d-content > .elements > .row-line:nth-child(1) > a').attr('title'), 48 | url: $('.m_i-d-content > .elements > .row-line:nth-child(1) > a').attr('href')?.slice(1), 49 | }; 50 | movieInfo.genres = $('.m_i-d-content > .elements > .row-line:nth-child(2) > a') 51 | .map((_, el) => $(el).attr('title')).get(); 52 | movieInfo.productions = $('.m_i-d-content > .elements > .row-line:nth-child(4) > a') 53 | .map((_, el) => $(el).attr('title')).get(); 54 | movieInfo.casts = $('.m_i-d-content > .elements > .row-line:nth-child(5) > a') 55 | .map((_, el) => $(el).attr('title')).get(); 56 | movieInfo.tags = $('.m_i-d-content > .elements > .row-line:nth-child(6) > .h-tag') 57 | .map((_, el) => $(el).text()).get(); 58 | movieInfo.duration = $('.m_i-d-content > .stats > .item:nth-child(3)').text(); 59 | movieInfo.rating = parseFloat($('.m_i-d-content > .stats > .item:nth-child(2)').text()); 60 | movieInfo.quality = $('.m_i-d-content > .stats > .item:nth-child(1)').text(); 61 | $('.m_i-related > .film-related > .block_area > .block_area-content > .film_list-wrap > .flw-item').each((_, el) => { 62 | recommendedArr.push((0, exports.setMovieData)($(el), baseUrl)); 63 | }); 64 | movieInfo.recommended = recommendedArr; 65 | }; 66 | exports.setMovieInfo = setMovieInfo; 67 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # FLIXHQ CORE 3 | 4 | Nodejs library that provides an Api for obtaining the movies information from FlixHQ website. 5 | 6 | ```ts 7 | import { MOVIES } from 'flixhq-core' 8 | 9 | const flixhq = new MOVIES.FlixHQ(); 10 | ``` 11 | 12 | ## Installation 13 | 14 | Install with npm 15 | 16 | ```bash 17 | npm install flixhq-core 18 | ``` 19 | 20 | ## Methods 21 | 22 | - [home](#home) 23 | - [fetchGenresList](#fetchgenresList) 24 | - [fetchCountriesList](#fetchcountriesList) 25 | - [fetchMovieByCountryOrGenre](#fetchmoviebycountryorgenre) 26 | - [fetchMovieByType](#fetchmoviebytype) 27 | - [fetchMovieByTopIMDB](#fetchmoviebytopimdb) 28 | - [fetchMovieInfo](#fetchmovieinfo) 29 | - [fetchEpisodeServers](#fetchepisodeservers) 30 | - [fetchEpisodeSources](#fetchepisodesources) 31 | - [search](#search) 32 | - [fetchFiltersList](#fetchfilterslist) 33 | - [filter](#filter) 34 | 35 | ### home 36 | Fetch data of the FlixHQ homepage. 37 | 38 | ```ts 39 | // Promise: 40 | flixhq.home().then(data => console.log(data)); 41 | 42 | // Async/Await: 43 | (async () => { 44 | const data = await flixhq.home(); 45 | console.log(data); 46 | })(); 47 | ``` 48 | returns a promise which resolves into an object. (*[`Promise`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L49-L60)*). 49 | 50 | ### fetchGenresList 51 | ```ts 52 | // Promise: 53 | flixhq.fetchGenresList().then(data => console.log(data)); 54 | 55 | // Async/Await: 56 | (async () => { 57 | const data = await flixhq.fetchGenresList(); 58 | console.log(data); 59 | })(); 60 | ``` 61 | returns a promise which resolves into an array of genres. (*[`Promise`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L62-L67)*). 62 | 63 | ### fetchCountriesList 64 | ```ts 65 | // Promise: 66 | flixhq.fetchCountriesList().then(data => console.log(data)); 67 | 68 | // Async/Await: 69 | (async () => { 70 | const data = await flixhq.fetchCountriesList(); 71 | console.log(data); 72 | })(); 73 | ``` 74 | returns a promise which resolves into an array of countries. (*[`Promise`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L68-L72)*). 75 | 76 | ### fetchMovieByCountryOrGenre 77 | | Parameter | Type | Description | 78 | | --------- |------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| 79 | | filterBy | [`Filters`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L14-L17) | Accept: "GENRE" or "COUNTRY". | 80 | | query | string | query that depend on the `filterBy` parameter. (*genre or country that can be found in the genres or countries list*). | 81 | | page (optional) | number | page number (*default: 1*). | 82 | 83 | ```ts 84 | // Promise: 85 | flixhq.fetchMovieByCountryOrGenre(Filter.COUNTRY, "US").then(data => console.log(data)); 86 | 87 | // Async/Await: 88 | (async () => { 89 | const data = await flixhq.fetchMovieByCountryOrGenre(Filter.COUNTRY, "US"); 90 | console.log(data); 91 | })(); 92 | ``` 93 | returns a promise which resolves into an array of movies/tvseries. (*[`Promise>`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L74-L80)*). 94 | 95 | ### fetchMovieByType 96 | | Parameter | Type | Description | 97 | | --------- |------------------------------------------------------------------------------------------|--------------------------------| 98 | | type | [`MovieType`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L1-L5) | Accept: "MOVIE" or "TVSERIES". | 99 | | page (optional) | number | page number (default: 1). | 100 | 101 | ```ts 102 | // Promise: 103 | flixhq.fetchMovieByType(MovieType.MOVIE).then(data => console.log(data)); 104 | 105 | // Async/Await: 106 | (async () => { 107 | const data = await flixhq.fetchMovieByType(MovieType.MOVIE); 108 | console.log(data); 109 | })(); 110 | ``` 111 | returns a promise which resolves into an array of movies. (*[`Promise>`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L74-L80)*). 112 | 113 | ### fetchMovieByTopIMDB 114 | | Parameter | Type | Description | 115 | | --------- |------------------------------------------------------------------------------------------| ----------- | 116 | | type (optional) | [`MovieType`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L1-L5) | Accept: "MOVIE" or "TVSERIES" (default: "ALL"). | 117 | | page (optional) | number | page number (default: 1). | 118 | 119 | ```ts 120 | // Promise: 121 | flixhq.fetchMovieByTopIMDB().then(data => console.log(data)); 122 | 123 | // Async/Await: 124 | (async () => { 125 | const data = await flixhq.fetchMovieByTopIMDB(); 126 | console.log(data); 127 | })(); 128 | ``` 129 | returns a promise which resolves into an array of movies/tvseries. (*[`Promise>`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L74-L80)*). 130 | 131 | ### fetchMovieInfo 132 | | Parameter | Type | Description | 133 | | --------- | ---- | ----------- | 134 | | mediaId | string | (*can be found in the media search results.*). | 135 | 136 | ```ts 137 | // Promise: 138 | flixhq.fetchMovieInfo("movie/watch-m3gan-91330").then(data => console.log(data)); 139 | 140 | // Async/Await: 141 | (async () => { 142 | const data = await flixhq.fetchMovieInfo("movie/watch-m3gan-91330"); 143 | console.log(data); 144 | })(); 145 | ``` 146 | returns a promise which resolves into an object of movie info. (*[`Promise`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L91-L104)*). 147 | 148 | ### fetchEpisodeServers 149 | | Parameter | Type | Description | 150 | | --------- | ---- | ----------- | 151 | | mediaId | string | (*can be found in the media search results.*). | 152 | | episodeId | string | (*can be found in the media info results as shown on the above method*). | 153 | 154 | ```ts 155 | // Promise: 156 | flixhq.fetchEpisodeServers("movie/watch-m3gan-91330", "91330").then(data => console.log(data)); 157 | 158 | // Async/Await: 159 | (async () => { 160 | const data = await flixhq.fetchEpisodeServers("movie/watch-m3gan-91330", "91330"); 161 | console.log(data); 162 | })(); 163 | ``` 164 | returns a promise which resolves into an array of the servers info. (*[`Promise`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L106-L110)*). 165 | 166 | ### fetchEpisodeSources 167 | | Parameter | Type | Description | 168 | | --------- |---------------------------------------------------------------------------------------------------| ----------- | 169 | | mediaId | string | (*can be found in the media search results.*). | 170 | | episodeId | string | (*can be found in the media info results as shown on the above method*). | 171 | | server (optional) | [`StreamingServers`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L19-L23) | Accept: "UpCloud" or "VidCloud" or "MixDrop" (default: "UpCloud"). | 172 | 173 | ```ts 174 | // Promsie: 175 | flixhq.fetchEpisodeSources("movie/watch-m3gan-91330", "91330").then(data => console.log(data)); 176 | 177 | // Async/Await: 178 | (async () => { 179 | const data = await flixhq.fetchEpisodeSources("movie/watch-m3gan-91330", "91330"); 180 | console.log(data); 181 | })(); 182 | ``` 183 | returns a promise which resolves into an object of media sources and subtitles. 184 | 185 | ### search 186 | | Parameter | Type | Description | 187 | | --------- | ---- | ----------- | 188 | | query | string | movie or tvseries name. | 189 | | page (optional) | number | page number (default: 1). | 190 | 191 | ```ts 192 | // Promise: 193 | flixhq.search("the last of us").then(data => console.log(data)); 194 | 195 | // Async/Await: 196 | (async () => { 197 | const data = await flixhq.search("the last of us"); 198 | console.log(data); 199 | })(); 200 | ``` 201 | returns a promise which resolves into an array of movies/tvseries. (*[`Promise>`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L74-L80)*). 202 | 203 | ### fetchFiltersList 204 | ```ts 205 | // Promise: 206 | flixhq. fetchFiltersList().then(data => console.log(data)); 207 | 208 | // Async/AwaitL 209 | (async () => { 210 | const data = await flixhq.fetchFiltersList(); 211 | console.log(data); 212 | })(); 213 | ``` 214 | returns a promise which resolves into an object of filters info. (*[`Promise`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L142-L149)*). 215 | 216 | ### filter 217 | | Parameter | Type | Description | 218 | | --------- |-------------------------------------------------------------------------------------------------| ----------- | 219 | | options | [`IMovieFilter`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L142-L149) | (*Includes: type, quality, released, genre, country. Can be found in the filters list as shown on the above method.*) | 220 | | page (optional) | number | page number (default: 1). | 221 | 222 | ```ts 223 | // Promise: 224 | const options = { type: 'all', quality: 'all', released: 'all', genre: 'all', country: 'all' }; 225 | 226 | flixhq.filter(options).then(data => console.log(data)); 227 | 228 | // Async/Await: 229 | (async () => { 230 | const data = await flixhq.filter(options); 231 | console.log(data); 232 | })(); 233 | ``` 234 | returns a promise which resolves into an array of movies/tvseries. (*[`Promise>`](https://github.com/shin202/flixhq-core/blob/main/src/types/types.ts#L74-L80)*). 235 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | "rootDir": "./src", /* Specify the root folder within your source files. */ 30 | "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "resolveJsonModule": true, /* Enable importing .json files. */ 39 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 40 | 41 | /* JavaScript Support */ 42 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 43 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 44 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 45 | 46 | /* Emit */ 47 | "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 48 | "declarationMap": true, /* Create sourcemaps for d.ts files. */ 49 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 50 | "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 51 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 52 | "outDir": "./dist", /* Specify an output folder for all emitted files. */ 53 | // "removeComments": true, /* Disable emitting comments. */ 54 | // "noEmit": true, /* Disable emitting files from a compilation. */ 55 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 56 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 57 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 58 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 60 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 61 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 62 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 63 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 64 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 65 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 66 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 67 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 68 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 69 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 70 | 71 | /* Interop Constraints */ 72 | "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 73 | "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 74 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 75 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 76 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 77 | 78 | /* Type Checking */ 79 | "strict": true, /* Enable all strict type-checking options. */ 80 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 81 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 82 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 83 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 84 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 85 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 86 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 87 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 88 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 89 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 90 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 91 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 92 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 93 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 94 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 95 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 96 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 97 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 98 | 99 | /* Completeness */ 100 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 101 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 102 | }, 103 | "include": ["./src/**/*"] 104 | } 105 | -------------------------------------------------------------------------------- /dist/crawler/movies/flixhq.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"flixhq.js","sourceRoot":"","sources":["../../../src/crawler/movies/flixhq.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,qCAA6D;AAC7D,6CAgB2B;AAC3B,uCAAyD;AACzD,iDAAqD;AAErD,MAAM,MAAM;IACC,IAAI,GAAG,QAAQ,CAAC;IACf,OAAO,GAAG,mBAAmB,CAAC;IAC9B,SAAS,GAAG,eAAe,CAAC;IAC5B,cAAc,GAAG,CAAC,iBAAS,CAAC,KAAK,EAAE,iBAAS,CAAC,QAAQ,CAAC,CAAC;IAEzD,WAAW,GAAG,CAAC,CAAa,EAAE,MAAiB,EAAE,EAAE;QACvD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,gCAAgC,CAAC,CAAC;QAEtE,CAAC,CAAC,iDAAiD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;YAChE,MAAM,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;YAClD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAE,CAAC;YAC7C,MAAM,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAE,CAAC;YAC3D,MAAM,WAAW,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AAC,CAAC,CAAC;YAEH,OAAO,YAAY,CAAC;SACvB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;SAC3C;IACL,CAAC,CAAA;CACJ;AAED,kBAAe,MAAM,CAAC"} -------------------------------------------------------------------------------- /dist/crawler/movies/flixhq.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | const axios_1 = __importDefault(require("axios")); 7 | const cheerio_1 = require("cheerio"); 8 | const types_1 = require("../../types/types"); 9 | const utils_1 = require("../../utils"); 10 | const extractors_1 = require("../../extractors"); 11 | class FlixHQ { 12 | name = 'FlixHQ'; 13 | baseUrl = 'https://flixhq.to'; 14 | classPath = 'MOVIES.FlixHQ'; 15 | supportedTypes = [types_1.MovieType.MOVIE, types_1.MovieType.TVSERIES]; 16 | fetchSlider = ($, slider) => { 17 | const sliderImageRegex = new RegExp(/^background-image: url\((.*)\)/); 18 | $('#slider > div.swiper-wrapper > div.swiper-slide').each((_, el) => { 19 | const image = $(el).attr('style')?.split(';')[0]; 20 | const match = image.match(sliderImageRegex); 21 | const title = $(el).find('.film-title > a').attr('title'); 22 | const movieDetail = $(el).find('.sc-detail > .scd-item'); 23 | const movieGenre = $(movieDetail.get()[3]).find('a').get(); 24 | slider.push({ 25 | image: match[1], 26 | title: title, 27 | detail: { 28 | quality: $(movieDetail).find('span.quality').text(), 29 | duration: $(movieDetail.get()[1]).find('strong').text(), 30 | imdb: $(movieDetail.get()[2]).find('strong').text(), 31 | genres: movieGenre.map(el => $(el).attr('title')), 32 | }, 33 | description: $(el).find('.sc-desc').text(), 34 | }); 35 | }); 36 | }; 37 | fetchTrendingMovies = ($, trendingMoviesSelector, trendingMovies) => { 38 | $.find(trendingMoviesSelector).each((_, el) => { 39 | trendingMovies.push((0, utils_1.setMovieData)($._make(el), this.baseUrl)); 40 | }); 41 | }; 42 | fetchTrendingTvShows = ($, trendingTvShowSelector, trendingTVShows) => { 43 | $.find(trendingTvShowSelector).each((_, el) => { 44 | trendingTVShows.push((0, utils_1.setMovieData)($._make(el), this.baseUrl)); 45 | }); 46 | }; 47 | fetchMovieSections = ($, options) => { 48 | const { trendingMovies, trendingTVShows, latestTvShows, latestMovies, comingSoon } = options; 49 | const moviesListSelector = '.block_area-content.film_list > .film_list-wrap > .flw-item'; 50 | const trendingMoviesSelector = `.tab-content > #trending-movies > ${moviesListSelector}`; 51 | const trendingTvShowSelector = `.tab-content > #trending-tv > ${moviesListSelector}`; 52 | $('.block_area.block_area_home').each((_, el) => { 53 | const title = $(el).find('h2.cat-heading').text(); 54 | switch (title) { 55 | case types_1.MovieReport.TRENDING: 56 | this.fetchTrendingMovies($(el), trendingMoviesSelector, trendingMovies); 57 | this.fetchTrendingTvShows($(el), trendingTvShowSelector, trendingTVShows); 58 | break; 59 | case types_1.MovieReport.LATEST_MOVIE: 60 | $(el).find(moviesListSelector).each((_, el) => { 61 | latestMovies.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 62 | }); 63 | break; 64 | case types_1.MovieReport.LATEST_TV_SHOWS: 65 | $(el).find(moviesListSelector).each((_, el) => { 66 | latestTvShows.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 67 | }); 68 | break; 69 | case types_1.MovieReport.COMING_SOON: 70 | $(el).find(moviesListSelector).each((_, el) => { 71 | comingSoon.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 72 | }); 73 | break; 74 | default: 75 | break; 76 | } 77 | }); 78 | }; 79 | home = async () => { 80 | const homeResult = { 81 | slider: [], 82 | moviesSection: { 83 | trending: { 84 | trendingMovies: [], 85 | trendingTVShows: [], 86 | }, 87 | latestTvShows: [], 88 | latestMovies: [], 89 | comingSoon: [], 90 | } 91 | }; 92 | const { slider, moviesSection: { trending: { trendingMovies, trendingTVShows, }, latestTvShows, latestMovies, comingSoon } } = homeResult; 93 | const movieSections = { 94 | trendingMovies, 95 | trendingTVShows, 96 | latestTvShows, 97 | latestMovies, 98 | comingSoon: comingSoon 99 | }; 100 | try { 101 | const { data } = await axios_1.default.get(`${this.baseUrl}/home`); 102 | const $ = (0, cheerio_1.load)(data); 103 | this.fetchSlider($, slider); 104 | this.fetchMovieSections($, movieSections); 105 | return homeResult; 106 | } 107 | catch (err) { 108 | throw new Error(err.message); 109 | } 110 | }; 111 | fetchGenresList = async () => { 112 | const genreResult = []; 113 | try { 114 | const { data } = await axios_1.default.get(`${this.baseUrl}/home`); 115 | const $ = (0, cheerio_1.load)(data); 116 | const genreSelector = '#header_menu > .header_menu-list > .nav-item:contains("Genre") > .header_menu-sub > .sub-menu > li'; 117 | $(genreSelector).each((_, el) => { 118 | genreResult.push({ 119 | title: $(el).find('a').attr('title'), 120 | url: $(el).find('a').attr('href')?.slice(1), 121 | }); 122 | }); 123 | return genreResult; 124 | } 125 | catch (err) { 126 | throw new Error(err.message); 127 | } 128 | }; 129 | fetchCountriesList = async () => { 130 | const countryResult = []; 131 | try { 132 | const { data } = await axios_1.default.get(`${this.baseUrl}/home`); 133 | const $ = (0, cheerio_1.load)(data); 134 | const countrySelector = '#header_menu > .header_menu-list > .nav-item:contains("Country") > .header_menu-sub > .sub-menu > li'; 135 | $(countrySelector).each((_, el) => { 136 | countryResult.push({ 137 | title: $(el).find('a').attr('title'), 138 | url: $(el).find('a').attr('href')?.slice(1), 139 | }); 140 | }); 141 | return countryResult; 142 | } 143 | catch (err) { 144 | throw new Error(err.message); 145 | } 146 | }; 147 | /** 148 | * 149 | * @param filterBy Type of the filter 150 | * @param query Query depend on the filter 151 | * @param page 152 | * @returns 153 | */ 154 | fetchMovieByGenreOrCountry = async (filterBy, query, page = 1) => { 155 | const filterResult = { 156 | currentPage: page, 157 | hasNextPage: false, 158 | results: [], 159 | }; 160 | try { 161 | const { data } = await axios_1.default.get(`${this.baseUrl}/${filterBy}/${query}?page=${page}`); 162 | const $ = (0, cheerio_1.load)(data); 163 | const navSelector = '.pre-pagination > nav > ul'; 164 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 165 | $('.film_list-wrap > .flw-item').each((_, el) => { 166 | filterResult.results.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 167 | }); 168 | return filterResult; 169 | } 170 | catch (err) { 171 | throw new Error(err.message); 172 | } 173 | }; 174 | /** 175 | * 176 | * @param type Type of the video (MOVIE or TVSERIES) 177 | * @param page 178 | * @returns 179 | */ 180 | fetchMovieByType = async (type, page = 1) => { 181 | const filterResult = { 182 | currentPage: page, 183 | hasNextPage: false, 184 | results: [], 185 | }; 186 | try { 187 | const { data } = await axios_1.default.get(`${this.baseUrl}/${type}?page=${page}`); 188 | const $ = (0, cheerio_1.load)(data); 189 | const navSelector = '.pre-pagination > nav > ul'; 190 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 191 | $('.film_list-wrap > .flw-item').each((_, el) => { 192 | filterResult.results.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 193 | }); 194 | return filterResult; 195 | } 196 | catch (err) { 197 | throw new Error(err.message); 198 | } 199 | }; 200 | /** 201 | * 202 | * @param type 203 | * @param page 204 | * @returns 205 | */ 206 | fetchMovieByTopIMDB = async (type = types_1.MovieType.ALL, page = 1) => { 207 | const filterResult = { 208 | currentPage: page, 209 | hasNextPage: false, 210 | results: [], 211 | }; 212 | try { 213 | const { data } = await axios_1.default.get(`${this.baseUrl}/top-imdb?type=${type}&page=${page}`); 214 | const $ = (0, cheerio_1.load)(data); 215 | const navSelector = '.pre-pagination > nav > ul'; 216 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 217 | $('.film_list-wrap > .flw-item').each((_, el) => { 218 | filterResult.results.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 219 | }); 220 | return filterResult; 221 | } 222 | catch (err) { 223 | throw new Error(err.message); 224 | } 225 | }; 226 | fetchTvShowSeasons = async (id) => { 227 | try { 228 | const { data } = await axios_1.default.get(`${this.baseUrl}/ajax/v2/tv/seasons/${id}`); 229 | return (0, cheerio_1.load)(data); 230 | } 231 | catch (err) { 232 | throw new Error(err.message); 233 | } 234 | }; 235 | fetchTvShowEpisodes = async (seasonsId) => { 236 | try { 237 | const { data } = await axios_1.default.get(`${this.baseUrl}/ajax/v2/season/episodes/${seasonsId}`); 238 | return (0, cheerio_1.load)(data); 239 | } 240 | catch (err) { 241 | throw new Error(err.message); 242 | } 243 | }; 244 | fetchTvShowEpisodeInfo = async (seasonId, currentSeason, episodes) => { 245 | const $ = await this.fetchTvShowEpisodes(seasonId); 246 | $(`.nav > .nav-item`).map((_, el) => { 247 | const episode = { 248 | id: $(el).find('a').attr('data-id'), 249 | title: $(el).find('a').attr('title'), 250 | episode: parseInt($(el).find('a').attr('title').split(':')[0].slice(3).trim()), 251 | season: currentSeason, 252 | url: `${this.baseUrl}/ajax/v2/episode/servers/${$(el).find('a').attr('data-id')}`, 253 | }; 254 | episodes.push(episode); 255 | }); 256 | }; 257 | fetchTvShowSeasonInfo = async (uid, episodes) => { 258 | const $ = await this.fetchTvShowSeasons(uid); 259 | const seasonIds = $('.slt-seasons-dropdown > .dropdown-menu > a') 260 | .map((_, el) => $(el) 261 | .attr('data-id')) 262 | .get(); 263 | let currentSeason = 1; 264 | for (const id of seasonIds) { 265 | await this.fetchTvShowEpisodeInfo(id, currentSeason, episodes); 266 | currentSeason++; 267 | } 268 | }; 269 | /** 270 | * Get Info of the video 271 | * 272 | * @param mediaId 273 | * @returns 274 | */ 275 | fetchMovieInfo = async (mediaId) => { 276 | const movieInfo = { 277 | id: mediaId, 278 | title: "", 279 | url: "", 280 | cover: "", 281 | image: "", 282 | description: "", 283 | episodes: [], 284 | }; 285 | try { 286 | const { data } = await axios_1.default.get(`${this.baseUrl}/${mediaId}`); 287 | const $ = (0, cheerio_1.load)(data); 288 | const uid = $('.watch_block').attr('data-id'); 289 | (0, utils_1.setMovieInfo)($, movieInfo, this.baseUrl); 290 | if (movieInfo.type === types_1.MovieType.MOVIE) { 291 | movieInfo.episodes = [ 292 | { 293 | id: uid, 294 | title: `${movieInfo.title} Movie`, 295 | url: `${this.baseUrl}/ajax/movie/episodes/${uid}`, 296 | } 297 | ]; 298 | return movieInfo; 299 | } 300 | await this.fetchTvShowSeasonInfo(uid, movieInfo.episodes); 301 | return movieInfo; 302 | } 303 | catch (err) { 304 | throw new Error(err.message); 305 | } 306 | }; 307 | fetchEpisodeServers = async (mediaId, episodeId) => { 308 | if (!mediaId.includes('movie')) { 309 | episodeId = `${this.baseUrl}/ajax/v2/episode/servers/${episodeId}`; 310 | } 311 | else { 312 | episodeId = `${this.baseUrl}/ajax/movie/episodes/${episodeId}`; 313 | } 314 | try { 315 | const { data } = await axios_1.default.get(episodeId); 316 | const $ = (0, cheerio_1.load)(data); 317 | const servers = $('.nav > .nav-item').map((_, el) => { 318 | const server = { 319 | id: mediaId.includes('movie') ? $(el).find('a').attr('data-linkid') : $(el).find('a').attr('data-id'), 320 | name: $(el).find('a').find('span').text(), 321 | url: `${this.baseUrl}${$(el).find('a').attr('href')}`, 322 | }; 323 | return server; 324 | }).get(); 325 | return servers; 326 | } 327 | catch (err) { 328 | throw new Error(err.message); 329 | } 330 | }; 331 | fetchEpisodeSources = async (mediaId, episodeId, server = types_1.StreamingServers.UpCloud) => { 332 | if (episodeId.startsWith('http')) { 333 | const serverUrl = new URL(episodeId); 334 | switch (server) { 335 | case types_1.StreamingServers.MixDrop: 336 | return { 337 | headers: { 338 | Referer: serverUrl.href, 339 | }, 340 | ...(await new extractors_1.MixDrop().extract(serverUrl)), 341 | }; 342 | case types_1.StreamingServers.VidCloud: 343 | return { 344 | headers: { 345 | Referer: serverUrl.href, 346 | }, 347 | ...(await new extractors_1.VidCloud().extract(serverUrl, true)), 348 | }; 349 | case types_1.StreamingServers.UpCloud: 350 | return { 351 | headers: { 352 | Referer: serverUrl.href, 353 | }, 354 | ...(await new extractors_1.VidCloud().extract(serverUrl)), 355 | }; 356 | default: 357 | return { 358 | headers: { 359 | Referer: serverUrl.href, 360 | }, 361 | ...(await new extractors_1.MixDrop().extract(serverUrl)), 362 | }; 363 | } 364 | } 365 | try { 366 | const servers = await this.fetchEpisodeServers(mediaId, episodeId); 367 | const i = servers.findIndex(s => s.name === server); 368 | if (i === -1) 369 | throw new Error(`Server ${server} not found.`); 370 | // Send request to the streaming server to get the video url. 371 | const { data } = await axios_1.default.get(`${this.baseUrl}/ajax/sources/${servers[i].id}`); 372 | const serverUrl = new URL(data.link); 373 | return await this.fetchEpisodeSources(mediaId, serverUrl.href, server); 374 | } 375 | catch (err) { 376 | throw new Error(err.message); 377 | } 378 | }; 379 | search = async (query, page = 1) => { 380 | const searchResult = { 381 | currentPage: page, 382 | hasNextPage: false, 383 | results: [], 384 | }; 385 | query = query.replaceAll(' ', '-'); 386 | try { 387 | const { data } = await axios_1.default.get(`${this.baseUrl}/search/${query}?page=${page}`); 388 | const $ = (0, cheerio_1.load)(data); 389 | const navSelector = '.pre-pagination > nav > ul'; 390 | searchResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 391 | $('.film_list-wrap > .flw-item').each((_, el) => { 392 | searchResult.results.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 393 | }); 394 | return searchResult; 395 | } 396 | catch (err) { 397 | throw new Error(err.message); 398 | } 399 | }; 400 | fetchFiltersList = async () => { 401 | const filtersList = { 402 | types: [], 403 | qualities: [], 404 | releaseYear: [], 405 | genres: [], 406 | countries: [] 407 | }; 408 | const { types = [], qualities = [], releaseYear = [], genres = [], countries = [] } = filtersList; 409 | try { 410 | const { data } = await axios_1.default.get(`${this.baseUrl}/movie`); 411 | const $ = (0, cheerio_1.load)(data); 412 | const filterWrapper = '.category_filter-content'; 413 | const typeSelector = `${filterWrapper} .row > div:nth-child(1) > .cfc-item > .ni-list > .form-check`; 414 | const qualitySelector = `${filterWrapper} .row > div:nth-child(2) > .cfc-item > .ni-list > .form-check`; 415 | const releaseSelector = `${filterWrapper} .row > div:nth-child(3) > .cfc-item > .ni-list > .form-check`; 416 | const genreSelector = `${filterWrapper} > div:nth-child(2) > .ni-list > .form-check`; 417 | const countrySelector = `${filterWrapper} > div:nth-child(3) > .ni-list > .form-check`; 418 | $(typeSelector).each((_, el) => { 419 | types.push({ 420 | label: $(el).find('input').attr('value'), 421 | value: $(el).find('input').attr('value'), 422 | }); 423 | }); 424 | $(qualitySelector).each((_, el) => { 425 | qualities.push({ 426 | label: $(el).find('input').attr('value'), 427 | value: $(el).find('input').attr('value'), 428 | }); 429 | }); 430 | $(releaseSelector).each((_, el) => { 431 | releaseYear.push({ 432 | label: $(el).find('input').attr('value'), 433 | value: $(el).find('input').attr('value'), 434 | }); 435 | }); 436 | $(genreSelector).each((_, el) => { 437 | genres.push({ 438 | label: $(el).find('label').text(), 439 | value: parseInt($(el).find('input').attr('value')), 440 | }); 441 | }); 442 | $(countrySelector).each((_, el) => { 443 | countries.push({ 444 | label: $(el).find('label').text(), 445 | value: parseInt($(el).find('input').attr('value')), 446 | }); 447 | }); 448 | return filtersList; 449 | } 450 | catch (err) { 451 | throw new Error(err.message); 452 | } 453 | }; 454 | filter = async (options, page = 1) => { 455 | const { type = 'all', quality = 'all', released = 'all', genre = 'all', country = 'all' } = options; 456 | const filterResult = { 457 | currentPage: page, 458 | hasNextPage: false, 459 | results: [], 460 | }; 461 | try { 462 | const reqParams = { 463 | type, 464 | quality, 465 | release_year: released, 466 | genre: Array.isArray(genre) ? genre.join('-') : 'all', 467 | country: Array.isArray(country) ? country.join('-') : 'all', 468 | }; 469 | const { data } = await axios_1.default.get(`${this.baseUrl}/filter`, { 470 | params: { 471 | ...reqParams, 472 | } 473 | }); 474 | const $ = (0, cheerio_1.load)(data); 475 | const navSelector = '.pre-pagination > nav > ul'; 476 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 477 | $('.film_list-wrap > .flw-item').each((_, el) => { 478 | filterResult.results.push((0, utils_1.setMovieData)($(el), this.baseUrl)); 479 | }); 480 | return filterResult; 481 | } 482 | catch (err) { 483 | throw new Error(err.message); 484 | } 485 | }; 486 | } 487 | exports.default = FlixHQ; 488 | //# sourceMappingURL=flixhq.js.map -------------------------------------------------------------------------------- /src/crawler/movies/flixhq.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { AnyNode, Cheerio, CheerioAPI, load } from "cheerio"; 3 | import { 4 | Filter, 5 | ICountry, 6 | IEpisodeServer, 7 | IGenre, 8 | IHomeResult, 9 | IMovieEpisode, 10 | IMovieFilter, 11 | IMovieInfo, 12 | IMovieResult, 13 | IMovieSection, 14 | ISearch, 15 | ISlider, 16 | MovieReport, 17 | MovieType, 18 | StreamingServers 19 | } from "../../types/types"; 20 | import { setMovieData, setMovieInfo } from "../../utils"; 21 | import { MixDrop, VidCloud } from '../../extractors'; 22 | 23 | class FlixHQ { 24 | readonly name = 'FlixHQ'; 25 | protected baseUrl = 'https://flixhq.to'; 26 | protected classPath = 'MOVIES.FlixHQ'; 27 | protected supportedTypes = [MovieType.MOVIE, MovieType.TVSERIES]; 28 | 29 | private fetchSlider = ($: CheerioAPI, slider: ISlider[]) => { 30 | const sliderImageRegex = new RegExp(/^background-image: url\((.*)\)/); 31 | 32 | $('#slider > div.swiper-wrapper > div.swiper-slide').each((_, el) => { 33 | const image = $(el).attr('style')?.split(';')[0]!; 34 | const match = image.match(sliderImageRegex)!; 35 | const title = $(el).find('.film-title > a').attr('title')!; 36 | const movieDetail = $(el).find('.sc-detail > .scd-item'); 37 | const movieGenre = $(movieDetail.get()[3]).find('a').get(); 38 | 39 | slider.push({ 40 | image: match[1], 41 | title: title, 42 | detail: { 43 | quality: $(movieDetail).find('span.quality').text(), 44 | duration: $(movieDetail.get()[1]).find('strong').text(), 45 | imdb: $(movieDetail.get()[2]).find('strong').text(), 46 | genres: movieGenre.map(el => $(el).attr('title')!), 47 | }, 48 | description: $(el).find('.sc-desc').text(), 49 | }); 50 | }); 51 | } 52 | 53 | private fetchTrendingMovies = ($: Cheerio, trendingMoviesSelector: string, trendingMovies: IMovieResult[]) => { 54 | $.find(trendingMoviesSelector).each((_, el) => { 55 | trendingMovies.push(setMovieData($._make(el), this.baseUrl)); 56 | }); 57 | } 58 | 59 | private fetchTrendingTvShows = ($: Cheerio, trendingTvShowSelector: string, trendingTVShows: IMovieResult[]) => { 60 | $.find(trendingTvShowSelector).each((_, el) => { 61 | trendingTVShows.push(setMovieData($._make(el), this.baseUrl)); 62 | }); 63 | } 64 | 65 | private fetchMovieSections = ($: CheerioAPI, options: IMovieSection) => { 66 | const { trendingMovies, trendingTVShows, latestTvShows, latestMovies, comingSoon } = options; 67 | 68 | const moviesListSelector = '.block_area-content.film_list > .film_list-wrap > .flw-item'; 69 | const trendingMoviesSelector = `.tab-content > #trending-movies > ${moviesListSelector}`; 70 | const trendingTvShowSelector = `.tab-content > #trending-tv > ${moviesListSelector}`; 71 | 72 | $('.block_area.block_area_home').each((_, el) => { 73 | const title = $(el).find('h2.cat-heading').text(); 74 | 75 | switch (title) { 76 | case MovieReport.TRENDING: 77 | this.fetchTrendingMovies($(el), trendingMoviesSelector, trendingMovies); 78 | this.fetchTrendingTvShows($(el), trendingTvShowSelector, trendingTVShows); 79 | break; 80 | 81 | case MovieReport.LATEST_MOVIE: 82 | $(el).find(moviesListSelector).each((_, el) => { 83 | latestMovies.push(setMovieData($(el), this.baseUrl)); 84 | }); 85 | break; 86 | 87 | case MovieReport.LATEST_TV_SHOWS: 88 | $(el).find(moviesListSelector).each((_, el) => { 89 | latestTvShows.push(setMovieData($(el), this.baseUrl)); 90 | }); 91 | break; 92 | 93 | case MovieReport.COMING_SOON: 94 | $(el).find(moviesListSelector).each((_, el) => { 95 | comingSoon.push(setMovieData($(el), this.baseUrl)); 96 | }); 97 | break; 98 | 99 | default: 100 | break; 101 | } 102 | }); 103 | } 104 | 105 | home = async (): Promise => { 106 | const homeResult: IHomeResult = { 107 | slider: [], 108 | moviesSection: { 109 | trending: { 110 | trendingMovies: [], 111 | trendingTVShows: [], 112 | }, 113 | latestTvShows: [], 114 | latestMovies: [], 115 | comingSoon: [], 116 | } 117 | }; 118 | const { 119 | slider, moviesSection: { 120 | trending: { 121 | trendingMovies, 122 | trendingTVShows, 123 | }, 124 | latestTvShows, 125 | latestMovies, 126 | comingSoon 127 | } 128 | } = homeResult; 129 | const movieSections: IMovieSection = { 130 | trendingMovies, 131 | trendingTVShows, 132 | latestTvShows, 133 | latestMovies, 134 | comingSoon: comingSoon 135 | }; 136 | 137 | try { 138 | const { data } = await axios.get(`${this.baseUrl}/home`); 139 | const $ = load(data); 140 | 141 | this.fetchSlider($, slider); 142 | this.fetchMovieSections($, movieSections); 143 | 144 | return homeResult; 145 | } catch (err) { 146 | throw new Error((err as Error).message); 147 | } 148 | } 149 | 150 | fetchGenresList = async (): Promise => { 151 | const genreResult: IGenre[] = []; 152 | 153 | try { 154 | const { data } = await axios.get(`${this.baseUrl}/home`); 155 | const $ = load(data); 156 | 157 | const genreSelector = '#header_menu > .header_menu-list > .nav-item:contains("Genre") > .header_menu-sub > .sub-menu > li'; 158 | $(genreSelector).each((_, el) => { 159 | genreResult.push({ 160 | title: $(el).find('a').attr('title')!, 161 | url: $(el).find('a').attr('href')?.slice(1)!, 162 | }); 163 | }); 164 | 165 | return genreResult; 166 | } catch (err) { 167 | throw new Error((err as Error).message); 168 | } 169 | } 170 | 171 | fetchCountriesList = async (): Promise => { 172 | const countryResult: ICountry[] = []; 173 | 174 | try { 175 | const { data } = await axios.get(`${this.baseUrl}/home`); 176 | const $ = load(data); 177 | 178 | const countrySelector = '#header_menu > .header_menu-list > .nav-item:contains("Country") > .header_menu-sub > .sub-menu > li'; 179 | $(countrySelector).each((_, el) => { 180 | countryResult.push({ 181 | title: $(el).find('a').attr('title')!, 182 | url: $(el).find('a').attr('href')?.slice(1)!, 183 | }); 184 | }); 185 | 186 | return countryResult; 187 | } catch (err) { 188 | throw new Error((err as Error).message); 189 | } 190 | } 191 | 192 | /** 193 | * 194 | * @param filterBy Type of the filter 195 | * @param query Query depend on the filter 196 | * @param page 197 | * @returns 198 | */ 199 | fetchMovieByGenreOrCountry = async (filterBy: Filter, query: string, page: number = 1): Promise> => { 200 | const filterResult: ISearch = { 201 | currentPage: page, 202 | hasNextPage: false, 203 | results: [], 204 | } 205 | 206 | try { 207 | const { data } = await axios.get(`${this.baseUrl}/${filterBy}/${query}?page=${page}`); 208 | const $ = load(data); 209 | 210 | const navSelector = '.pre-pagination > nav > ul'; 211 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 212 | 213 | $('.film_list-wrap > .flw-item').each((_, el) => { 214 | filterResult.results.push(setMovieData($(el), this.baseUrl)); 215 | }); 216 | 217 | return filterResult; 218 | } catch (err) { 219 | throw new Error((err as Error).message); 220 | } 221 | } 222 | 223 | /** 224 | * 225 | * @param type Type of the video (MOVIE or TVSERIES) 226 | * @param page 227 | * @returns 228 | */ 229 | fetchMovieByType = async (type: MovieType, page: number = 1): Promise> => { 230 | const filterResult: ISearch = { 231 | currentPage: page, 232 | hasNextPage: false, 233 | results: [], 234 | } 235 | 236 | try { 237 | const { data } = await axios.get(`${this.baseUrl}/${type}?page=${page}`); 238 | const $ = load(data); 239 | 240 | const navSelector = '.pre-pagination > nav > ul'; 241 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 242 | 243 | $('.film_list-wrap > .flw-item').each((_, el) => { 244 | filterResult.results.push(setMovieData($(el), this.baseUrl)); 245 | }); 246 | 247 | return filterResult; 248 | } catch (err) { 249 | throw new Error((err as Error).message); 250 | } 251 | } 252 | 253 | /** 254 | * 255 | * @param type 256 | * @param page 257 | * @returns 258 | */ 259 | fetchMovieByTopIMDB = async (type: MovieType = MovieType.ALL, page: number = 1): Promise> => { 260 | const filterResult: ISearch = { 261 | currentPage: page, 262 | hasNextPage: false, 263 | results: [], 264 | } 265 | 266 | try { 267 | const { data } = await axios.get(`${this.baseUrl}/top-imdb?type=${type}&page=${page}`); 268 | const $ = load(data); 269 | 270 | const navSelector = '.pre-pagination > nav > ul'; 271 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 272 | 273 | $('.film_list-wrap > .flw-item').each((_, el) => { 274 | filterResult.results.push(setMovieData($(el), this.baseUrl)); 275 | }); 276 | 277 | return filterResult; 278 | } catch (err) { 279 | throw new Error((err as Error).message); 280 | } 281 | } 282 | 283 | private fetchTvShowSeasons = async (id: string): Promise => { 284 | try { 285 | const { data } = await axios.get(`${this.baseUrl}/ajax/v2/tv/seasons/${id}`); 286 | return load(data); 287 | } catch (err) { 288 | throw new Error((err as Error).message); 289 | } 290 | } 291 | 292 | private fetchTvShowEpisodes = async (seasonsId: string): Promise => { 293 | try { 294 | const { data } = await axios.get(`${this.baseUrl}/ajax/v2/season/episodes/${seasonsId}`); 295 | return load(data); 296 | } catch (err) { 297 | throw new Error((err as Error).message); 298 | } 299 | } 300 | 301 | private fetchTvShowEpisodeInfo = async (seasonId: string, currentSeason: number, episodes: IMovieEpisode[]): Promise => { 302 | const $ = await this.fetchTvShowEpisodes(seasonId); 303 | 304 | $(`.nav > .nav-item`).map((_, el) => { 305 | const episode: IMovieEpisode = { 306 | id: $(el).find('a').attr('data-id')!, 307 | title: $(el).find('a').attr('title')!, 308 | episode: parseInt($(el).find('a').attr('title')!.split(':')[0].slice(3).trim()), 309 | season: currentSeason, 310 | url: `${this.baseUrl}/ajax/v2/episode/servers/${$(el).find('a').attr('data-id')}`, 311 | } 312 | 313 | episodes.push(episode); 314 | }); 315 | } 316 | 317 | private fetchTvShowSeasonInfo = async (uid: string, episodes: IMovieEpisode[]): Promise => { 318 | const $ = await this.fetchTvShowSeasons(uid); 319 | 320 | const seasonIds = $('.slt-seasons-dropdown > .dropdown-menu > a') 321 | .map((_, el) => $(el) 322 | .attr('data-id')) 323 | .get(); 324 | 325 | let currentSeason = 1; 326 | for (const id of seasonIds) { 327 | await this.fetchTvShowEpisodeInfo(id, currentSeason, episodes); 328 | currentSeason++; 329 | } 330 | } 331 | 332 | /** 333 | * Get Info of the video 334 | * 335 | * @param mediaId 336 | * @returns 337 | */ 338 | fetchMovieInfo = async (mediaId: string): Promise => { 339 | const movieInfo: IMovieInfo = { 340 | id: mediaId, 341 | title: "", 342 | url: "", 343 | cover: "", 344 | image: "", 345 | description: "", 346 | episodes: [], 347 | } 348 | 349 | try { 350 | const { data } = await axios.get(`${this.baseUrl}/${mediaId}`); 351 | const $ = load(data); 352 | 353 | const uid = $('.watch_block').attr('data-id')!; 354 | 355 | setMovieInfo($, movieInfo, this.baseUrl); 356 | 357 | if (movieInfo.type === MovieType.MOVIE) { 358 | movieInfo.episodes = [ 359 | { 360 | id: uid, 361 | title: `${movieInfo.title} Movie`, 362 | url: `${this.baseUrl}/ajax/movie/episodes/${uid}`, 363 | } 364 | ]; 365 | 366 | return movieInfo; 367 | } 368 | 369 | await this.fetchTvShowSeasonInfo(uid, movieInfo.episodes); 370 | return movieInfo; 371 | } catch (err) { 372 | throw new Error((err as Error).message); 373 | } 374 | } 375 | 376 | fetchEpisodeServers = async (mediaId: string, episodeId: string): Promise => { 377 | if (!mediaId.includes('movie')) { 378 | episodeId = `${this.baseUrl}/ajax/v2/episode/servers/${episodeId}`; 379 | } else { 380 | episodeId = `${this.baseUrl}/ajax/movie/episodes/${episodeId}`; 381 | } 382 | 383 | try { 384 | const { data } = await axios.get(episodeId); 385 | const $ = load(data); 386 | 387 | const servers = $('.nav > .nav-item').map((_, el) => { 388 | const server: IEpisodeServer = { 389 | id: mediaId.includes('movie') ? $(el).find('a').attr('data-linkid')! : $(el).find('a').attr('data-id')!, 390 | name: $(el).find('a').find('span').text(), 391 | url: `${this.baseUrl}${$(el).find('a').attr('href')}`, 392 | } 393 | 394 | return server; 395 | }).get(); 396 | 397 | return servers; 398 | } catch (err) { 399 | throw new Error((err as Error).message); 400 | } 401 | } 402 | 403 | fetchEpisodeSources = async (mediaId: string, episodeId: string, server: StreamingServers = StreamingServers.UpCloud): Promise => { 404 | if (episodeId.startsWith('http')) { 405 | const serverUrl = new URL(episodeId); 406 | 407 | switch (server) { 408 | case StreamingServers.MixDrop: 409 | return { 410 | headers: { 411 | Referer: serverUrl.href, 412 | }, 413 | ...(await new MixDrop().extract(serverUrl)), 414 | } 415 | 416 | case StreamingServers.VidCloud: 417 | return { 418 | headers: { 419 | Referer: serverUrl.href, 420 | }, 421 | ...(await new VidCloud().extract(serverUrl, true)), 422 | } 423 | 424 | case StreamingServers.UpCloud: 425 | return { 426 | headers: { 427 | Referer: serverUrl.href, 428 | }, 429 | ...(await new VidCloud().extract(serverUrl)), 430 | } 431 | 432 | default: 433 | return { 434 | headers: { 435 | Referer: serverUrl.href, 436 | }, 437 | ...(await new MixDrop().extract(serverUrl)), 438 | } 439 | } 440 | } 441 | 442 | try { 443 | const servers = await this.fetchEpisodeServers(mediaId, episodeId); 444 | 445 | const i = servers.findIndex(s => s.name === server); 446 | 447 | if (i === -1) throw new Error(`Server ${server} not found.`); 448 | 449 | // Send request to the streaming server to get the video url. 450 | const { data } = await axios.get(`${this.baseUrl}/ajax/sources/${servers[i].id}`); 451 | const serverUrl: URL = new URL(data.link); 452 | 453 | return await this.fetchEpisodeSources(mediaId, serverUrl.href, server); 454 | } catch (err) { 455 | throw new Error((err as Error).message); 456 | } 457 | } 458 | 459 | search = async (query: string, page: number = 1): Promise> => { 460 | const searchResult: ISearch = { 461 | currentPage: page, 462 | hasNextPage: false, 463 | results: [], 464 | } 465 | 466 | query = query.replaceAll(' ', '-'); 467 | 468 | try { 469 | const { data } = await axios.get(`${this.baseUrl}/search/${query}?page=${page}`); 470 | const $ = load(data); 471 | 472 | const navSelector = '.pre-pagination > nav > ul'; 473 | searchResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 474 | 475 | $('.film_list-wrap > .flw-item').each((_, el) => { 476 | searchResult.results.push(setMovieData($(el), this.baseUrl)); 477 | }); 478 | 479 | return searchResult; 480 | } catch (err) { 481 | throw new Error((err as Error).message); 482 | } 483 | } 484 | 485 | fetchFiltersList = async (): Promise => { 486 | const filtersList: IMovieFilter = { 487 | types: [], 488 | qualities: [], 489 | releaseYear: [], 490 | genres: [], 491 | countries: [] 492 | }; 493 | const { types = [], qualities = [], releaseYear = [], genres = [], countries = [] } = filtersList; 494 | 495 | try { 496 | const { data } = await axios.get(`${this.baseUrl}/movie`); 497 | const $ = load(data); 498 | 499 | const filterWrapper = '.category_filter-content'; 500 | const typeSelector = `${filterWrapper} .row > div:nth-child(1) > .cfc-item > .ni-list > .form-check`; 501 | const qualitySelector = `${filterWrapper} .row > div:nth-child(2) > .cfc-item > .ni-list > .form-check`; 502 | const releaseSelector = `${filterWrapper} .row > div:nth-child(3) > .cfc-item > .ni-list > .form-check`; 503 | const genreSelector = `${filterWrapper} > div:nth-child(2) > .ni-list > .form-check`; 504 | const countrySelector = `${filterWrapper} > div:nth-child(3) > .ni-list > .form-check`; 505 | 506 | $(typeSelector).each((_, el) => { 507 | types.push({ 508 | label: $(el).find('input').attr('value')!, 509 | value: $(el).find('input').attr('value')!, 510 | }); 511 | }); 512 | 513 | $(qualitySelector).each((_, el) => { 514 | qualities.push({ 515 | label: $(el).find('input').attr('value')!, 516 | value: $(el).find('input').attr('value')!, 517 | }); 518 | }); 519 | 520 | $(releaseSelector).each((_, el) => { 521 | releaseYear.push({ 522 | label: $(el).find('input').attr('value')!, 523 | value: $(el).find('input').attr('value')!, 524 | }); 525 | }); 526 | 527 | $(genreSelector).each((_, el) => { 528 | genres.push({ 529 | label: $(el).find('label').text(), 530 | value: parseInt($(el).find('input').attr('value')!), 531 | }); 532 | }); 533 | 534 | $(countrySelector).each((_, el) => { 535 | countries.push({ 536 | label: $(el).find('label').text(), 537 | value: parseInt($(el).find('input').attr('value')!), 538 | }); 539 | }); 540 | 541 | return filtersList; 542 | } catch (err) { 543 | throw new Error((err as Error).message); 544 | } 545 | } 546 | 547 | filter = async (options: IMovieFilter, page: number = 1): Promise> => { 548 | const { type = 'all', quality = 'all', released = 'all', genre = 'all', country = 'all' } = options; 549 | const filterResult: ISearch = { 550 | currentPage: page, 551 | hasNextPage: false, 552 | results: [], 553 | } 554 | 555 | try { 556 | const reqParams = { 557 | type, 558 | quality, 559 | release_year: released, 560 | genre: Array.isArray(genre) ? genre.join('-') : 'all', 561 | country: Array.isArray(country) ? country.join('-') : 'all', 562 | } 563 | 564 | const { data } = await axios.get(`${this.baseUrl}/filter`, { 565 | params: { 566 | ...reqParams, 567 | } 568 | }); 569 | const $ = load(data); 570 | 571 | const navSelector = '.pre-pagination > nav > ul'; 572 | filterResult.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false; 573 | 574 | $('.film_list-wrap > .flw-item').each((_, el) => { 575 | filterResult.results.push(setMovieData($(el), this.baseUrl)); 576 | }); 577 | 578 | return filterResult; 579 | } catch (err) { 580 | throw new Error((err as Error).message); 581 | } 582 | } 583 | } 584 | 585 | export default FlixHQ; --------------------------------------------------------------------------------