├── dist ├── mjs │ ├── package.json │ ├── services │ │ ├── CDA │ │ │ ├── index.js │ │ │ ├── index.d.ts │ │ │ ├── Profile.d.ts │ │ │ ├── Folder.d.ts │ │ │ └── Profile.js │ │ ├── wordpress │ │ │ ├── index.js │ │ │ ├── index.d.ts │ │ │ ├── Paldea.d.ts │ │ │ ├── DesuOnline.d.ts │ │ │ ├── MakiSubs.d.ts │ │ │ ├── MioroSubs.d.ts │ │ │ ├── JuniorSubs.d.ts │ │ │ ├── JuniorSubs.js │ │ │ ├── DesuOnline.js │ │ │ ├── Paldea.js │ │ │ ├── MioroSubs.js │ │ │ └── MakiSubs.js │ │ ├── Fumetsu.d.ts │ │ ├── GrupaMirai.d.ts │ │ ├── KathSubs.d.ts │ │ ├── NanaSubs.d.ts │ │ ├── Wbijam.d.ts │ │ ├── OkamiSubs.d.ts │ │ ├── ReikoProject.d.ts │ │ ├── index.js │ │ ├── index.d.ts │ │ ├── OkamiSubs.js │ │ ├── Fumetsu.js │ │ ├── GrupaMirai.js │ │ ├── KathSubs.js │ │ ├── NanaSubs.js │ │ ├── ReikoProject.js │ │ └── Wbijam.js │ ├── apis │ │ ├── MakiSubs.d.ts │ │ ├── MioroSubs.d.ts │ │ ├── Wbijam.d.ts │ │ ├── JuniorSubs.d.ts │ │ ├── indirect │ │ │ ├── OrfeuszSubsEpisodes.d.ts │ │ │ ├── OrfeuszSubsPlayers.d.ts │ │ │ ├── OrfeuszSubsEpisodes.js │ │ │ └── OrfeuszSubsPlayers.js │ │ ├── Docchi.d.ts │ │ ├── FrixySubs.d.ts │ │ ├── OrfeuszSubs.d.ts │ │ ├── index.js │ │ ├── index.d.ts │ │ ├── OrfeuszSubs.js │ │ ├── MakiSubs.js │ │ ├── MioroSubs.js │ │ ├── Wbijam.js │ │ ├── FrixySubs.js │ │ ├── Docchi.js │ │ └── JuniorSubs.js │ ├── utils │ │ ├── CompileEpisodeData.d.ts │ │ └── CompileEpisodeData.js │ └── app.d.ts └── cjs │ ├── package.json │ ├── services │ ├── CDA │ │ ├── index.d.ts │ │ ├── Profile.d.ts │ │ ├── Folder.d.ts │ │ └── index.js │ ├── wordpress │ │ ├── index.d.ts │ │ ├── Paldea.d.ts │ │ ├── DesuOnline.d.ts │ │ ├── MakiSubs.d.ts │ │ ├── MioroSubs.d.ts │ │ ├── JuniorSubs.d.ts │ │ ├── index.js │ │ ├── JuniorSubs.js │ │ ├── DesuOnline.js │ │ ├── MakiSubs.js │ │ ├── MioroSubs.js │ │ └── Paldea.js │ ├── Fumetsu.d.ts │ ├── GrupaMirai.d.ts │ ├── KathSubs.d.ts │ ├── NanaSubs.d.ts │ ├── Wbijam.d.ts │ ├── OkamiSubs.d.ts │ ├── ReikoProject.d.ts │ ├── index.d.ts │ ├── index.js │ ├── OkamiSubs.js │ ├── Fumetsu.js │ ├── GrupaMirai.js │ ├── KathSubs.js │ ├── ReikoProject.js │ └── NanaSubs.js │ ├── apis │ ├── MakiSubs.d.ts │ ├── MioroSubs.d.ts │ ├── Wbijam.d.ts │ ├── JuniorSubs.d.ts │ ├── indirect │ │ ├── OrfeuszSubsEpisodes.d.ts │ │ ├── OrfeuszSubsPlayers.d.ts │ │ ├── OrfeuszSubsEpisodes.js │ │ └── OrfeuszSubsPlayers.js │ ├── Docchi.d.ts │ ├── FrixySubs.d.ts │ ├── OrfeuszSubs.d.ts │ ├── index.d.ts │ ├── index.js │ ├── OrfeuszSubs.js │ ├── MakiSubs.js │ ├── MioroSubs.js │ ├── Wbijam.js │ ├── FrixySubs.js │ ├── Docchi.js │ └── JuniorSubs.js │ ├── utils │ ├── CompileEpisodeData.d.ts │ └── CompileEpisodeData.js │ └── app.d.ts ├── .npmignore ├── src ├── services │ ├── CDA │ │ ├── index.ts │ │ └── Profile.ts │ ├── wordpress │ │ ├── index.ts │ │ ├── JuniorSubs.ts │ │ ├── DesuOnline.ts │ │ ├── Paldea.ts │ │ ├── MioroSubs.ts │ │ └── MakiSubs.ts │ ├── index.ts │ ├── Fumetsu.ts │ ├── OkamiSubs.ts │ ├── GrupaMirai.ts │ ├── KathSubs.ts │ ├── NanaSubs.ts │ ├── ReikoProject.ts │ └── Wbijam.ts ├── apis │ ├── index.ts │ ├── OrfeuszSubs.ts │ ├── MakiSubs.ts │ ├── MioroSubs.ts │ ├── Wbijam.ts │ ├── indirect │ │ ├── OrfeuszSubsEpisodes.ts │ │ └── OrfeuszSubsPlayers.ts │ ├── FrixySubs.ts │ ├── Docchi.ts │ └── JuniorSubs.ts ├── tests │ └── CheckServices.test.ts └── utils │ └── CompileEpisodeData.ts ├── tsconfig.json ├── fixup.sh ├── tsconfig-cjs.json ├── jest.config.js ├── .github ├── dependabot.yml └── workflows │ └── npm-publish.yml ├── tsconfig-base.json ├── LICENSE ├── .gitignore └── package.json /dist/mjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /dist/cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "commonjs" 3 | } 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Dependency directories 2 | node_modules/ 3 | src/ 4 | package-lock.json 5 | fixup.sh -------------------------------------------------------------------------------- /src/services/CDA/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceCDAFolder } from "./Folder.js"; 2 | export { default as ServiceCDAProfile } from "./Profile.js"; -------------------------------------------------------------------------------- /dist/mjs/services/CDA/index.js: -------------------------------------------------------------------------------- 1 | export { default as ServiceCDAFolder } from "./Folder.js"; 2 | export { default as ServiceCDAProfile } from "./Profile.js"; 3 | -------------------------------------------------------------------------------- /dist/cjs/services/CDA/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceCDAFolder } from "./Folder.js"; 2 | export { default as ServiceCDAProfile } from "./Profile.js"; 3 | -------------------------------------------------------------------------------- /dist/mjs/services/CDA/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceCDAFolder } from "./Folder.js"; 2 | export { default as ServiceCDAProfile } from "./Profile.js"; 3 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig-base.json", 3 | "compilerOptions": { 4 | "module": "esnext", 5 | "outDir": "dist/mjs", 6 | "target": "esnext" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /dist/cjs/apis/MakiSubs.d.ts: -------------------------------------------------------------------------------- 1 | export default function MakiSubsAPI(action: string, post: string, nume: string, type: string): Promise<{ 2 | status: number; 3 | player?: string; 4 | }>; 5 | -------------------------------------------------------------------------------- /dist/mjs/apis/MakiSubs.d.ts: -------------------------------------------------------------------------------- 1 | export default function MakiSubsAPI(action: string, post: string, nume: string, type: string): Promise<{ 2 | status: number; 3 | player?: string; 4 | }>; 5 | -------------------------------------------------------------------------------- /fixup.sh: -------------------------------------------------------------------------------- 1 | cat >dist/cjs/package.json <dist/mjs/package.json <; 5 | -------------------------------------------------------------------------------- /dist/mjs/apis/MioroSubs.d.ts: -------------------------------------------------------------------------------- 1 | export default function MioroSubsAPI(action: string, post: string, nume: string, type: string): Promise<{ 2 | status: number; 3 | player?: string; 4 | }>; 5 | -------------------------------------------------------------------------------- /dist/cjs/apis/Wbijam.d.ts: -------------------------------------------------------------------------------- 1 | export default function Wbijam({ slug, anime, }: { 2 | slug: string; 3 | anime: string; 4 | }): Promise<{ 5 | status: number; 6 | player?: string; 7 | }>; 8 | -------------------------------------------------------------------------------- /dist/mjs/apis/Wbijam.d.ts: -------------------------------------------------------------------------------- 1 | export default function Wbijam({ slug, anime, }: { 2 | slug: string; 3 | anime: string; 4 | }): Promise<{ 5 | status: number; 6 | player?: string; 7 | }>; 8 | -------------------------------------------------------------------------------- /dist/cjs/apis/JuniorSubs.d.ts: -------------------------------------------------------------------------------- 1 | export default function JuniorSubs(category: string | number, anime: string, episode: string | number): Promise<{ 2 | status: number; 3 | thumbnail?: string | null; 4 | }>; 5 | -------------------------------------------------------------------------------- /dist/mjs/apis/JuniorSubs.d.ts: -------------------------------------------------------------------------------- 1 | export default function JuniorSubs(category: string | number, anime: string, episode: string | number): Promise<{ 2 | status: number; 3 | thumbnail?: string | null; 4 | }>; 5 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest').JestConfigWithTsJest} */ 2 | module.exports = { 3 | preset: 'ts-jest', 4 | testEnvironment: 'node', 5 | "moduleNameMapper": { 6 | "^(\\.\\.?\\/.+)\\.js$": "$1", 7 | }, 8 | }; -------------------------------------------------------------------------------- /dist/cjs/apis/indirect/OrfeuszSubsEpisodes.d.ts: -------------------------------------------------------------------------------- 1 | export default function OrfeuszSubsEpisodes(anime: string, episode: string | number): Promise<{ 2 | status: number; 3 | episode_id?: number; 4 | bg?: string | null; 5 | }>; 6 | -------------------------------------------------------------------------------- /dist/mjs/apis/indirect/OrfeuszSubsEpisodes.d.ts: -------------------------------------------------------------------------------- 1 | export default function OrfeuszSubsEpisodes(anime: string, episode: string | number): Promise<{ 2 | status: number; 3 | episode_id?: number; 4 | bg?: string | null; 5 | }>; 6 | -------------------------------------------------------------------------------- /dist/cjs/utils/CompileEpisodeData.d.ts: -------------------------------------------------------------------------------- 1 | interface ResponseSource { 2 | code: number; 3 | player_embed?: string; 4 | hosting?: string; 5 | player_id?: string; 6 | } 7 | export default function CompilePlayerData(player: string): ResponseSource; 8 | export {}; 9 | -------------------------------------------------------------------------------- /dist/mjs/utils/CompileEpisodeData.d.ts: -------------------------------------------------------------------------------- 1 | interface ResponseSource { 2 | code: number; 3 | player_embed?: string; 4 | hosting?: string; 5 | player_id?: string; 6 | } 7 | export default function CompilePlayerData(player: string): ResponseSource; 8 | export {}; 9 | -------------------------------------------------------------------------------- /src/services/wordpress/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceMioroSubs } from "./MioroSubs.js"; 2 | export { default as ServiceMakiSubs } from "./MakiSubs.js"; 3 | export { default as ServicePaldea } from "./Paldea.js"; 4 | export { default as ServiceDesuOnline } from "./DesuOnline.js"; 5 | export { default as ServiceJuniorSubs } from "./JuniorSubs.js"; -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/index.js: -------------------------------------------------------------------------------- 1 | export { default as ServiceMioroSubs } from "./MioroSubs.js"; 2 | export { default as ServiceMakiSubs } from "./MakiSubs.js"; 3 | export { default as ServicePaldea } from "./Paldea.js"; 4 | export { default as ServiceDesuOnline } from "./DesuOnline.js"; 5 | export { default as ServiceJuniorSubs } from "./JuniorSubs.js"; 6 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceMioroSubs } from "./MioroSubs.js"; 2 | export { default as ServiceMakiSubs } from "./MakiSubs.js"; 3 | export { default as ServicePaldea } from "./Paldea.js"; 4 | export { default as ServiceDesuOnline } from "./DesuOnline.js"; 5 | export { default as ServiceJuniorSubs } from "./JuniorSubs.js"; 6 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceMioroSubs } from "./MioroSubs.js"; 2 | export { default as ServiceMakiSubs } from "./MakiSubs.js"; 3 | export { default as ServicePaldea } from "./Paldea.js"; 4 | export { default as ServiceDesuOnline } from "./DesuOnline.js"; 5 | export { default as ServiceJuniorSubs } from "./JuniorSubs.js"; 6 | -------------------------------------------------------------------------------- /dist/cjs/apis/Docchi.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function Docchi(anime: string, episode: number | string): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/apis/Docchi.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function Docchi(anime: string, episode: number | string): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/apis/FrixySubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function FrixySubs(anime: string, episode: number | string): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/apis/FrixySubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function FrixySubs(anime: string, episode: number | string): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/apis/OrfeuszSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function OrfeuszSubs(anime: string, episode: number | string): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/Fumetsu.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceFumetsu(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/Paldea.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServicePaldea(episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number | null; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/apis/OrfeuszSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function OrfeuszSubs(anime: string, episode: number | string): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/Fumetsu.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceFumetsu(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/Paldea.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServicePaldea(episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number | null; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/GrupaMirai.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceGrupaMirai(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/KathSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceKathSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/NanaSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceNanaSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/Wbijam.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceWbijam(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number | null; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/GrupaMirai.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceGrupaMirai(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/KathSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceKathSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/NanaSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceNanaSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/Wbijam.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceWbijam(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number | null; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/OkamiSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceOkamiSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number | null; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/ReikoProject.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceReikoProject(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/OkamiSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceOkamiSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number | null; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/ReikoProject.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceReikoProject(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/DesuOnline.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceDesuOnline(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/MakiSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceMakiSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/MioroSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceMioroSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/DesuOnline.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceDesuOnline(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/MakiSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceMakiSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/MioroSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceMioroSubs(anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /src/apis/index.ts: -------------------------------------------------------------------------------- 1 | export { default as FrixySubsAPI } from "./FrixySubs.js"; 2 | export { default as DocchiAPI } from "./Docchi.js"; 3 | export { default as OrfeuszSubsAPI } from "./OrfeuszSubs.js"; 4 | export { default as MioroSubsAPI } from "./MioroSubs.js"; 5 | export { default as MakiSubsAPI } from "./MakiSubs.js"; 6 | export { default as JuniorSubsAPI } from "./JuniorSubs.js"; 7 | export { default as WbijamAPI } from "./Wbijam.js"; -------------------------------------------------------------------------------- /dist/cjs/apis/indirect/OrfeuszSubsPlayers.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function OrfeuszSubsPlayers(episode: number | string, episode_id: number, bg?: string | null): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/JuniorSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceJuniorSubs(category: string | number, anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/apis/index.js: -------------------------------------------------------------------------------- 1 | export { default as FrixySubsAPI } from "./FrixySubs.js"; 2 | export { default as DocchiAPI } from "./Docchi.js"; 3 | export { default as OrfeuszSubsAPI } from "./OrfeuszSubs.js"; 4 | export { default as MioroSubsAPI } from "./MioroSubs.js"; 5 | export { default as MakiSubsAPI } from "./MakiSubs.js"; 6 | export { default as JuniorSubsAPI } from "./JuniorSubs.js"; 7 | export { default as WbijamAPI } from "./Wbijam.js"; 8 | -------------------------------------------------------------------------------- /dist/mjs/apis/indirect/OrfeuszSubsPlayers.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function OrfeuszSubsPlayers(episode: number | string, episode_id: number, bg?: string | null): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/JuniorSubs.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | } 5 | export default function ServiceJuniorSubs(category: string | number, anime: string, episode: string | number): Promise<{ 6 | status: number; 7 | message: string; 8 | episode_thumbnail?: string | null; 9 | episodes?: IPlayer[]; 10 | episode_next_url?: string | number; 11 | }>; 12 | export {}; 13 | -------------------------------------------------------------------------------- /dist/cjs/apis/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as FrixySubsAPI } from "./FrixySubs.js"; 2 | export { default as DocchiAPI } from "./Docchi.js"; 3 | export { default as OrfeuszSubsAPI } from "./OrfeuszSubs.js"; 4 | export { default as MioroSubsAPI } from "./MioroSubs.js"; 5 | export { default as MakiSubsAPI } from "./MakiSubs.js"; 6 | export { default as JuniorSubsAPI } from "./JuniorSubs.js"; 7 | export { default as WbijamAPI } from "./Wbijam.js"; 8 | -------------------------------------------------------------------------------- /dist/mjs/apis/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as FrixySubsAPI } from "./FrixySubs.js"; 2 | export { default as DocchiAPI } from "./Docchi.js"; 3 | export { default as OrfeuszSubsAPI } from "./OrfeuszSubs.js"; 4 | export { default as MioroSubsAPI } from "./MioroSubs.js"; 5 | export { default as MakiSubsAPI } from "./MakiSubs.js"; 6 | export { default as JuniorSubsAPI } from "./JuniorSubs.js"; 7 | export { default as WbijamAPI } from "./Wbijam.js"; 8 | -------------------------------------------------------------------------------- /src/services/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceFumetsu } from "./Fumetsu.js"; 2 | export { default as ServiceKathSubs } from "./KathSubs.js"; 3 | export { default as ServiceReikoProject } from "./ReikoProject.js"; 4 | export { default as ServiceGrupaMirai } from "./GrupaMirai.js"; 5 | export { default as ServiceNanaSubs } from "./NanaSubs.js"; 6 | export { default as ServiceOkamiSubs } from "./OkamiSubs.js"; 7 | export { default as ServiceWbijam } from "./Wbijam.js"; -------------------------------------------------------------------------------- /dist/mjs/services/index.js: -------------------------------------------------------------------------------- 1 | export { default as ServiceFumetsu } from "./Fumetsu.js"; 2 | export { default as ServiceKathSubs } from "./KathSubs.js"; 3 | export { default as ServiceReikoProject } from "./ReikoProject.js"; 4 | export { default as ServiceGrupaMirai } from "./GrupaMirai.js"; 5 | export { default as ServiceNanaSubs } from "./NanaSubs.js"; 6 | export { default as ServiceOkamiSubs } from "./OkamiSubs.js"; 7 | export { default as ServiceWbijam } from "./Wbijam.js"; 8 | -------------------------------------------------------------------------------- /dist/cjs/services/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceFumetsu } from "./Fumetsu.js"; 2 | export { default as ServiceKathSubs } from "./KathSubs.js"; 3 | export { default as ServiceReikoProject } from "./ReikoProject.js"; 4 | export { default as ServiceGrupaMirai } from "./GrupaMirai.js"; 5 | export { default as ServiceNanaSubs } from "./NanaSubs.js"; 6 | export { default as ServiceOkamiSubs } from "./OkamiSubs.js"; 7 | export { default as ServiceWbijam } from "./Wbijam.js"; 8 | -------------------------------------------------------------------------------- /dist/mjs/services/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ServiceFumetsu } from "./Fumetsu.js"; 2 | export { default as ServiceKathSubs } from "./KathSubs.js"; 3 | export { default as ServiceReikoProject } from "./ReikoProject.js"; 4 | export { default as ServiceGrupaMirai } from "./GrupaMirai.js"; 5 | export { default as ServiceNanaSubs } from "./NanaSubs.js"; 6 | export { default as ServiceOkamiSubs } from "./OkamiSubs.js"; 7 | export { default as ServiceWbijam } from "./Wbijam.js"; 8 | -------------------------------------------------------------------------------- /dist/cjs/services/CDA/Profile.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | episode_number?: number; 5 | episode_thumbnail?: string | null; 6 | } 7 | export default function ServiceCDAProfile(user: string, keyword: string, type: string, spaces: number, episode: number | string): Promise<{ 8 | status: number; 9 | message: string; 10 | episode_thumbnail?: string | null; 11 | episodes?: IPlayer[]; 12 | episode_next_url?: string | number; 13 | }>; 14 | export {}; 15 | -------------------------------------------------------------------------------- /dist/mjs/services/CDA/Profile.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | episode_number?: number; 5 | episode_thumbnail?: string | null; 6 | } 7 | export default function ServiceCDAProfile(user: string, keyword: string, type: string, spaces: number, episode: number | string): Promise<{ 8 | status: number; 9 | message: string; 10 | episode_thumbnail?: string | null; 11 | episodes?: IPlayer[]; 12 | episode_next_url?: string | number; 13 | }>; 14 | export {}; 15 | -------------------------------------------------------------------------------- /dist/cjs/services/CDA/Folder.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | episode_number?: number; 5 | episode_thumbnail?: string | null; 6 | } 7 | export default function ServiceCDAFolder(user: string, folder: string | number, type: string, spaces: number, episode: number | string): Promise<{ 8 | status: number; 9 | message: string; 10 | episode_thumbnail?: string | null; 11 | episodes?: IPlayer[]; 12 | episode_next_url?: string | number; 13 | }>; 14 | export {}; 15 | -------------------------------------------------------------------------------- /dist/mjs/services/CDA/Folder.d.ts: -------------------------------------------------------------------------------- 1 | interface IPlayer { 2 | player: string; 3 | url: string; 4 | episode_number?: number; 5 | episode_thumbnail?: string | null; 6 | } 7 | export default function ServiceCDAFolder(user: string, folder: string | number, type: string, spaces: number, episode: number | string): Promise<{ 8 | status: number; 9 | message: string; 10 | episode_thumbnail?: string | null; 11 | episodes?: IPlayer[]; 12 | episode_next_url?: string | number; 13 | }>; 14 | export {}; 15 | -------------------------------------------------------------------------------- /.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/mjs/apis/OrfeuszSubs.js: -------------------------------------------------------------------------------- 1 | import OrfeuszSubsEpisodes from "./indirect/OrfeuszSubsEpisodes.js"; 2 | import OrfeuszSubsPlayers from "./indirect/OrfeuszSubsPlayers.js"; 3 | export default async function OrfeuszSubs(anime, episode) { 4 | const episodeID = await OrfeuszSubsEpisodes(anime, episode); 5 | if (episodeID.status !== 200 || !episodeID.episode_id) { 6 | return { 7 | status: 500, 8 | message: "Something went wrong!", 9 | }; 10 | } 11 | const orfeusz = await OrfeuszSubsPlayers(episode, episodeID.episode_id, episodeID.bg); 12 | return orfeusz; 13 | } 14 | -------------------------------------------------------------------------------- /dist/cjs/services/CDA/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.ServiceCDAProfile = exports.ServiceCDAFolder = void 0; 7 | var Folder_js_1 = require("./Folder.js"); 8 | Object.defineProperty(exports, "ServiceCDAFolder", { enumerable: true, get: function () { return __importDefault(Folder_js_1).default; } }); 9 | var Profile_js_1 = require("./Profile.js"); 10 | Object.defineProperty(exports, "ServiceCDAProfile", { enumerable: true, get: function () { return __importDefault(Profile_js_1).default; } }); 11 | -------------------------------------------------------------------------------- /tsconfig-base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowSyntheticDefaultImports": true, 5 | "baseUrl": "src", 6 | "declaration": true, 7 | "esModuleInterop": true, 8 | "inlineSourceMap": false, 9 | "lib": ["esnext"], 10 | "listEmittedFiles": false, 11 | "listFiles": false, 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "pretty": true, 15 | "resolveJsonModule": true, 16 | "rootDir": "src", 17 | "skipLibCheck": true, 18 | "strict": true, 19 | "traceResolution": false, 20 | "types": ["node"] 21 | }, 22 | "compileOnSave": false, 23 | "include": ["src"], 24 | "exclude": ["node_modules", ".vscode", "dist", "src/**/*.test.ts"] 25 | } 26 | -------------------------------------------------------------------------------- /dist/cjs/app.d.ts: -------------------------------------------------------------------------------- 1 | interface ResponseSource { 2 | status: number; 3 | message: string; 4 | episode_thumbnail?: string | null; 5 | episodes?: { 6 | player: string; 7 | url: string; 8 | episode_number?: number; 9 | episode_thumbnail?: string | null; 10 | }[]; 11 | episode_next_url?: string | number | null; 12 | } 13 | interface FunctionTypes { 14 | anime?: string; 15 | episode: number | string; 16 | website: string; 17 | user?: string; 18 | folder?: number | string; 19 | type?: string; 20 | spaces?: number; 21 | keyword?: string; 22 | url?: string; 23 | } 24 | export default function runScript({ anime, episode, website, user, folder, type, spaces, keyword, }: FunctionTypes): Promise; 25 | export {}; 26 | -------------------------------------------------------------------------------- /dist/mjs/app.d.ts: -------------------------------------------------------------------------------- 1 | interface ResponseSource { 2 | status: number; 3 | message: string; 4 | episode_thumbnail?: string | null; 5 | episodes?: { 6 | player: string; 7 | url: string; 8 | episode_number?: number; 9 | episode_thumbnail?: string | null; 10 | }[]; 11 | episode_next_url?: string | number | null; 12 | } 13 | interface FunctionTypes { 14 | anime?: string; 15 | episode: number | string; 16 | website: string; 17 | user?: string; 18 | folder?: number | string; 19 | type?: string; 20 | spaces?: number; 21 | keyword?: string; 22 | url?: string; 23 | } 24 | export default function runScript({ anime, episode, website, user, folder, type, spaces, keyword, }: FunctionTypes): Promise; 25 | export {}; 26 | -------------------------------------------------------------------------------- /dist/mjs/apis/MakiSubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default async function MakiSubsAPI(action, post, nume, type) { 3 | try { 4 | const form = new URLSearchParams(); 5 | form.append("action", action); 6 | form.append("post", post); 7 | form.append("nume", nume); 8 | form.append("type", type); 9 | const response = await axios.post(`https://makisubs.online/wp-admin/admin-ajax.php`, form); 10 | if (!response.data.embed_url) { 11 | return { 12 | status: 500, 13 | }; 14 | } 15 | return { 16 | status: 200, 17 | player: response.data.embed_url, 18 | }; 19 | } 20 | catch (error) { 21 | return { 22 | status: 500, 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dist/mjs/apis/MioroSubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default async function MioroSubsAPI(action, post, nume, type) { 3 | try { 4 | const form = new URLSearchParams(); 5 | form.append("action", action); 6 | form.append("post", post); 7 | form.append("nume", nume); 8 | form.append("type", type); 9 | const response = await axios.post(`https://miorosubs.pl/wp-admin/admin-ajax.php`, form); 10 | if (!response.data.embed_url) { 11 | return { 12 | status: 500, 13 | }; 14 | } 15 | return { 16 | status: 200, 17 | player: response.data.embed_url, 18 | }; 19 | } 20 | catch (error) { 21 | return { 22 | status: 500, 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/apis/OrfeuszSubs.ts: -------------------------------------------------------------------------------- 1 | import OrfeuszSubsEpisodes from "./indirect/OrfeuszSubsEpisodes.js"; 2 | import OrfeuszSubsPlayers from "./indirect/OrfeuszSubsPlayers.js"; 3 | 4 | //Return Interfaces 5 | interface IPlayer { 6 | player: string; 7 | url: string; 8 | } 9 | 10 | export default async function OrfeuszSubs( 11 | anime: string, 12 | episode: number | string 13 | ): Promise<{ 14 | status: number; 15 | message: string; 16 | episode_thumbnail?: string | null; 17 | episodes?: IPlayer[]; 18 | episode_next_url?: string | number; 19 | }> { 20 | const episodeID = await OrfeuszSubsEpisodes(anime, episode); 21 | 22 | if(episodeID.status !== 200 || !episodeID.episode_id){ 23 | return { 24 | status: 500, 25 | message: "Something went wrong!", 26 | }; 27 | } 28 | const orfeusz = await OrfeuszSubsPlayers(episode, episodeID.episode_id, episodeID.bg); 29 | 30 | return orfeusz; 31 | } 32 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: 🚀 release 5 | 6 | on: 7 | push: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | release: 13 | name: 🚀 release 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: 📚 checkout 17 | uses: actions/checkout@v3 18 | - name: 🟢 node 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: '16.x' 22 | registry-url: https://registry.npmjs.org 23 | - name: 🚀 publish 24 | run: npm publish --access public 25 | env: 26 | NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} 27 | -------------------------------------------------------------------------------- /src/apis/MakiSubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | //Response Interfaces 4 | interface IPlayer { 5 | embed_url: string; 6 | } 7 | 8 | export default async function MakiSubsAPI( 9 | action: string, 10 | post: string, 11 | nume: string, 12 | type: string 13 | ): Promise<{ 14 | status: number; 15 | player?: string; 16 | }> { 17 | try { 18 | const form = new URLSearchParams(); 19 | form.append("action", action); 20 | form.append("post", post); 21 | form.append("nume", nume); 22 | form.append("type", type); 23 | const response: AxiosResponse = await axios.post( 24 | `https://makisubs.online/wp-admin/admin-ajax.php`, 25 | form 26 | ); 27 | 28 | if (!response.data.embed_url) { 29 | return { 30 | status: 500, 31 | }; 32 | } 33 | 34 | return { 35 | status: 200, 36 | player: response.data.embed_url, 37 | }; 38 | } catch (error) { 39 | return { 40 | status: 500, 41 | }; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/apis/MioroSubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | //Response Interfaces 4 | interface IPlayer { 5 | embed_url: string; 6 | } 7 | 8 | export default async function MioroSubsAPI( 9 | action: string, 10 | post: string, 11 | nume: string, 12 | type: string 13 | ): Promise<{ 14 | status: number; 15 | player?: string; 16 | }> { 17 | try { 18 | const form = new URLSearchParams(); 19 | form.append("action", action); 20 | form.append("post", post); 21 | form.append("nume", nume); 22 | form.append("type", type); 23 | const response: AxiosResponse = await axios.post( 24 | `https://miorosubs.pl/wp-admin/admin-ajax.php`, 25 | form 26 | ); 27 | 28 | if (!response.data.embed_url) { 29 | return { 30 | status: 500, 31 | }; 32 | } 33 | 34 | return { 35 | status: 200, 36 | player: response.data.embed_url, 37 | }; 38 | } catch (error) { 39 | return { 40 | status: 500, 41 | }; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /dist/mjs/apis/indirect/OrfeuszSubsEpisodes.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default async function OrfeuszSubsEpisodes(anime, episode) { 3 | try { 4 | const response = await axios.get(`https://api.orfeusz-subs.pl/api/episode/list?id=${anime}`, { 5 | headers: { 6 | Accept: `application/json`, 7 | }, 8 | }); 9 | if (response.data.length <= 0) { 10 | return { 11 | status: 500, 12 | }; 13 | } 14 | const indexOfObject = response.data.findIndex((object) => { 15 | return object.number === Number(episode); 16 | }); 17 | if (indexOfObject === -1) { 18 | return { 19 | status: 500, 20 | }; 21 | } 22 | return { 23 | status: 200, 24 | episode_id: response.data[indexOfObject].id, 25 | bg: null 26 | }; 27 | } 28 | catch (error) { 29 | return { 30 | status: 500, 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /dist/mjs/apis/Wbijam.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | export default async function Wbijam({ slug, anime, }) { 8 | try { 9 | const response = await axios.get(`https://${anime}.wbijam.pl/odtwarzacz-${slug}.html`, { 10 | headers: { 11 | Referer: `https://${anime}.wbijam.pl/odtwarzacz-${slug}.html`, 12 | "X-Requested-With": "XMLHttpRequest", 13 | }, 14 | }); 15 | const dom = new JSDOM(response.data, { virtualConsole }); 16 | const player_url = dom.window.document.querySelector("center iframe"); 17 | if (!player_url) { 18 | return { 19 | status: 500, 20 | }; 21 | } 22 | return { 23 | status: 200, 24 | player: player_url.src, 25 | }; 26 | } 27 | catch (error) { 28 | return { 29 | status: 500, 30 | }; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Docchi 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/mjs/apis/indirect/OrfeuszSubsPlayers.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default async function OrfeuszSubsPlayers(episode, episode_id, bg) { 3 | try { 4 | const response = await axios.get(`https://api.orfeusz-subs.pl/api/player/list?id=${episode_id}`, { 5 | headers: { 6 | Accept: `application/json`, 7 | }, 8 | }); 9 | if (response.data.length <= 0) { 10 | return { 11 | status: 500, 12 | message: "Something went wrong!", 13 | }; 14 | } 15 | return { 16 | status: 200, 17 | message: "Mission Accomplished!", 18 | episode_thumbnail: bg, 19 | episodes: response.data.map(function (x) { 20 | return { 21 | player: x.source, 22 | url: x.iframe, 23 | }; 24 | }), 25 | episode_next_url: Number(episode) + 1, 26 | }; 27 | } 28 | catch (error) { 29 | return { 30 | status: 500, 31 | message: "Something went wrong!", 32 | }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dist/mjs/apis/FrixySubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default async function FrixySubs(anime, episode) { 3 | try { 4 | const response = await axios.get(`https://frixysubs.pl/api/anime/${anime}/${episode}`, { 5 | headers: { 6 | Accept: `application/json`, 7 | }, 8 | }); 9 | const { episode: { poster, players }, } = response.data; 10 | if (players.length <= 0) { 11 | return { 12 | status: 500, 13 | message: "Something went wrong!", 14 | }; 15 | } 16 | return { 17 | status: 200, 18 | message: "Mission Accomplished!", 19 | episode_thumbnail: poster ?? null, 20 | episodes: players.map(function (x) { 21 | return { 22 | player: x.name, 23 | url: x.link, 24 | }; 25 | }), 26 | episode_next_url: Number(episode) + 1, 27 | }; 28 | } 29 | catch (error) { 30 | return { 31 | status: 500, 32 | message: "Something went wrong!", 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /dist/mjs/apis/Docchi.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default async function Docchi(anime, episode) { 3 | try { 4 | const response = await axios.get(`https://api.docchi.pl/v1/episodes/find/${anime}/${episode}`, { 5 | headers: { 6 | Accept: `application/json`, 7 | }, 8 | }); 9 | if (response.data.length <= 0) { 10 | return { 11 | status: 500, 12 | message: "Something went wrong!", 13 | }; 14 | } 15 | return { 16 | status: 200, 17 | message: "Mission Accomplished!", 18 | episode_thumbnail: response.data[0].bg ?? null, 19 | episodes: response.data.map(function (x) { 20 | return { 21 | player: x.player_hosting, 22 | url: x.player, 23 | translator: x.translator_title.trim() === "" ? "none" : x.translator_title.trim() 24 | }; 25 | }), 26 | episode_next_url: Number(episode) + 1, 27 | }; 28 | } 29 | catch (error) { 30 | return { 31 | status: 500, 32 | message: "Something went wrong!", 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/apis/Wbijam.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | 9 | export default async function Wbijam({ 10 | slug, 11 | anime, 12 | }: { 13 | slug: string; 14 | anime: string; 15 | }): Promise<{ 16 | status: number; 17 | player?: string; 18 | }> { 19 | try { 20 | const response: AxiosResponse = await axios.get( 21 | `https://${anime}.wbijam.pl/odtwarzacz-${slug}.html`, 22 | { 23 | headers: { 24 | Referer: `https://${anime}.wbijam.pl/odtwarzacz-${slug}.html`, 25 | "X-Requested-With": "XMLHttpRequest", 26 | }, 27 | } 28 | ); 29 | 30 | const dom = new JSDOM(response.data, { virtualConsole }); 31 | const player_url = dom.window.document.querySelector( 32 | "center iframe" 33 | ) as HTMLIFrameElement; 34 | 35 | if (!player_url) { 36 | return { 37 | status: 500, 38 | }; 39 | } 40 | 41 | return { 42 | status: 200, 43 | player: player_url.src, 44 | }; 45 | } catch (error) { 46 | return { 47 | status: 500, 48 | }; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/apis/indirect/OrfeuszSubsEpisodes.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | //Response Interfaces 4 | interface IPlayers { 5 | number: number; 6 | image: string; 7 | id: number; 8 | } 9 | 10 | export default async function OrfeuszSubsEpisodes( 11 | anime: string, 12 | episode: string | number 13 | ): Promise<{ 14 | status: number; 15 | episode_id?: number; 16 | bg?: string | null; 17 | }> { 18 | try { 19 | const response: AxiosResponse = await axios.get( 20 | `https://api.orfeusz-subs.pl/api/episode/list?id=${anime}`, 21 | { 22 | headers: { 23 | Accept: `application/json`, 24 | }, 25 | } 26 | ); 27 | 28 | if (response.data.length <= 0) { 29 | return { 30 | status: 500, 31 | }; 32 | } 33 | 34 | const indexOfObject = response.data.findIndex((object) => { 35 | return object.number === Number(episode); 36 | }); 37 | 38 | if (indexOfObject === -1) { 39 | return { 40 | status: 500, 41 | }; 42 | } 43 | 44 | return { 45 | status: 200, 46 | episode_id: response.data[indexOfObject].id, 47 | bg: null 48 | }; 49 | } catch (error) { 50 | return { 51 | status: 500, 52 | }; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/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.ServiceJuniorSubs = exports.ServiceDesuOnline = exports.ServicePaldea = exports.ServiceMakiSubs = exports.ServiceMioroSubs = void 0; 7 | var MioroSubs_js_1 = require("./MioroSubs.js"); 8 | Object.defineProperty(exports, "ServiceMioroSubs", { enumerable: true, get: function () { return __importDefault(MioroSubs_js_1).default; } }); 9 | var MakiSubs_js_1 = require("./MakiSubs.js"); 10 | Object.defineProperty(exports, "ServiceMakiSubs", { enumerable: true, get: function () { return __importDefault(MakiSubs_js_1).default; } }); 11 | var Paldea_js_1 = require("./Paldea.js"); 12 | Object.defineProperty(exports, "ServicePaldea", { enumerable: true, get: function () { return __importDefault(Paldea_js_1).default; } }); 13 | var DesuOnline_js_1 = require("./DesuOnline.js"); 14 | Object.defineProperty(exports, "ServiceDesuOnline", { enumerable: true, get: function () { return __importDefault(DesuOnline_js_1).default; } }); 15 | var JuniorSubs_js_1 = require("./JuniorSubs.js"); 16 | Object.defineProperty(exports, "ServiceJuniorSubs", { enumerable: true, get: function () { return __importDefault(JuniorSubs_js_1).default; } }); 17 | -------------------------------------------------------------------------------- /src/apis/indirect/OrfeuszSubsPlayers.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | //Response Interfaces 4 | interface IPlayers { 5 | source: string; 6 | iframe: string; 7 | } 8 | 9 | //Return Interfaces 10 | interface IPlayer { 11 | player: string; 12 | url: string; 13 | } 14 | 15 | export default async function OrfeuszSubsPlayers( 16 | episode: number | string, 17 | episode_id: number, 18 | bg?: string | null, 19 | ): Promise<{ 20 | status: number; 21 | message: string; 22 | episode_thumbnail?: string | null; 23 | episodes?: IPlayer[]; 24 | episode_next_url?: string | number; 25 | }> { 26 | try { 27 | const response: AxiosResponse = await axios.get( 28 | `https://api.orfeusz-subs.pl/api/player/list?id=${episode_id}`, 29 | { 30 | headers: { 31 | Accept: `application/json`, 32 | }, 33 | } 34 | ); 35 | 36 | if (response.data.length <= 0) { 37 | return { 38 | status: 500, 39 | message: "Something went wrong!", 40 | }; 41 | } 42 | 43 | return { 44 | status: 200, 45 | message: "Mission Accomplished!", 46 | episode_thumbnail: bg, 47 | episodes: response.data.map(function (x) { 48 | return { 49 | player: x.source, 50 | url: x.iframe, 51 | }; 52 | }), 53 | episode_next_url: Number(episode) + 1, 54 | }; 55 | 56 | } catch (error) { 57 | return { 58 | status: 500, 59 | message: "Something went wrong!", 60 | }; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/apis/FrixySubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | //Response Interfaces 4 | interface IEpisode { 5 | poster: string; 6 | players: IPlayers[]; 7 | } 8 | interface IPlayers { 9 | name: string; 10 | link: string; 11 | } 12 | 13 | //Return Interfaces 14 | interface IPlayer { 15 | player: string; 16 | url: string; 17 | } 18 | 19 | export default async function FrixySubs( 20 | anime: string, 21 | episode: number | string 22 | ): Promise<{ 23 | status: number; 24 | message: string; 25 | episode_thumbnail?: string | null; 26 | episodes?: IPlayer[]; 27 | episode_next_url?: string | number; 28 | }> { 29 | try { 30 | const response: AxiosResponse<{ episode: IEpisode }> = await axios.get( 31 | `https://frixysubs.pl/api/anime/${anime}/${episode}`, 32 | { 33 | headers: { 34 | Accept: `application/json`, 35 | }, 36 | } 37 | ); 38 | const { 39 | episode: { poster, players }, 40 | } = response.data; 41 | 42 | if (players.length <= 0) { 43 | return { 44 | status: 500, 45 | message: "Something went wrong!", 46 | }; 47 | } 48 | 49 | return { 50 | status: 200, 51 | message: "Mission Accomplished!", 52 | episode_thumbnail: poster ?? null, 53 | episodes: players.map(function (x) { 54 | return { 55 | player: x.name, 56 | url: x.link, 57 | }; 58 | }), 59 | episode_next_url: Number(episode) + 1, 60 | }; 61 | 62 | } catch (error) { 63 | return { 64 | status: 500, 65 | message: "Something went wrong!", 66 | }; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/apis/Docchi.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | //Response Interfaces 4 | interface IPlayers { 5 | bg: string; 6 | player: string; 7 | player_hosting: string; 8 | translator_title: string; 9 | } 10 | 11 | //Return Interfaces 12 | interface IPlayer { 13 | player: string; 14 | url: string; 15 | } 16 | 17 | export default async function Docchi( 18 | anime: string, 19 | episode: number | string 20 | ): Promise<{ 21 | status: number; 22 | message: string; 23 | episode_thumbnail?: string | null; 24 | episodes?: IPlayer[]; 25 | episode_next_url?: string | number; 26 | }> { 27 | try { 28 | const response: AxiosResponse = await axios.get( 29 | `https://api.docchi.pl/v1/episodes/find/${anime}/${episode}`, 30 | { 31 | headers: { 32 | Accept: `application/json`, 33 | }, 34 | } 35 | ); 36 | 37 | if (response.data.length <= 0) { 38 | return { 39 | status: 500, 40 | message: "Something went wrong!", 41 | }; 42 | } 43 | 44 | return { 45 | status: 200, 46 | message: "Mission Accomplished!", 47 | episode_thumbnail: response.data[0].bg ?? null, 48 | episodes: response.data.map(function (x) { 49 | return { 50 | player: x.player_hosting, 51 | url: x.player, 52 | translator: x.translator_title.trim() === "" ? "none" : x.translator_title.trim() 53 | }; 54 | }), 55 | episode_next_url: Number(episode) + 1, 56 | }; 57 | } catch (error) { 58 | return { 59 | status: 500, 60 | message: "Something went wrong!", 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/tests/CheckServices.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test } from "@jest/globals"; 2 | import { ServiceFumetsu, ServiceNanaSubs } from "../services/index"; 3 | 4 | describe("Custom Services", () => { 5 | test("Fumetsu", async () => { 6 | expect(await ServiceFumetsu("BartenderKamiNoGlass", "1")).toStrictEqual({ 7 | status: 200, 8 | episode_thumbnail: null, 9 | message: "Mission Accomplished!", 10 | episodes: [ 11 | { player: "cda", url: "https://ebd.cda.pl/620x368/19633967ff" }, 12 | { 13 | player: "mega", 14 | url: "https://mega.nz/embed/xfdCkBbK!dNEv00aEl6sCxBnMUs9cAGaGGeG4P9Bh5nKTKY6QhJQ", 15 | }, 16 | { 17 | player: "gdrive", 18 | url: "https://drive.google.com/file/d/1gQZHgoD6m0mHxZ2FItRrKEfVI7Q9xbgp/preview", 19 | }, 20 | { 21 | player: "mp4upload", 22 | url: "https://www.mp4upload.com/embed-1a6ht511uk79.html.html", 23 | }, 24 | ], 25 | episode_next_url: 2, 26 | }); 27 | }); 28 | 29 | test("Nana Subs", async () => { 30 | expect(await ServiceNanaSubs("one-piece", "1081")).toStrictEqual({ 31 | status: 200, 32 | episode_thumbnail: 33 | "https://nanasubs.com/images/episodes/one-piece-1081.webp", 34 | message: "Mission Accomplished!", 35 | episodes: [ 36 | { player: "cda", url: "https://ebd.cda.pl/620x395/18338327c0" }, 37 | { 38 | player: "gdrive", 39 | url: "https://drive.google.com/file/d/1zwbmG9_rOUVtwtHE-D5R-YqeSymu5UZo/preview", 40 | }, 41 | ], 42 | episode_next_url: 1082, 43 | }); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /dist/cjs/apis/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.WbijamAPI = exports.JuniorSubsAPI = exports.MakiSubsAPI = exports.MioroSubsAPI = exports.OrfeuszSubsAPI = exports.DocchiAPI = exports.FrixySubsAPI = void 0; 7 | var FrixySubs_js_1 = require("./FrixySubs.js"); 8 | Object.defineProperty(exports, "FrixySubsAPI", { enumerable: true, get: function () { return __importDefault(FrixySubs_js_1).default; } }); 9 | var Docchi_js_1 = require("./Docchi.js"); 10 | Object.defineProperty(exports, "DocchiAPI", { enumerable: true, get: function () { return __importDefault(Docchi_js_1).default; } }); 11 | var OrfeuszSubs_js_1 = require("./OrfeuszSubs.js"); 12 | Object.defineProperty(exports, "OrfeuszSubsAPI", { enumerable: true, get: function () { return __importDefault(OrfeuszSubs_js_1).default; } }); 13 | var MioroSubs_js_1 = require("./MioroSubs.js"); 14 | Object.defineProperty(exports, "MioroSubsAPI", { enumerable: true, get: function () { return __importDefault(MioroSubs_js_1).default; } }); 15 | var MakiSubs_js_1 = require("./MakiSubs.js"); 16 | Object.defineProperty(exports, "MakiSubsAPI", { enumerable: true, get: function () { return __importDefault(MakiSubs_js_1).default; } }); 17 | var JuniorSubs_js_1 = require("./JuniorSubs.js"); 18 | Object.defineProperty(exports, "JuniorSubsAPI", { enumerable: true, get: function () { return __importDefault(JuniorSubs_js_1).default; } }); 19 | var Wbijam_js_1 = require("./Wbijam.js"); 20 | Object.defineProperty(exports, "WbijamAPI", { enumerable: true, get: function () { return __importDefault(Wbijam_js_1).default; } }); 21 | -------------------------------------------------------------------------------- /dist/cjs/apis/OrfeuszSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const OrfeuszSubsEpisodes_js_1 = __importDefault(require("./indirect/OrfeuszSubsEpisodes.js")); 16 | const OrfeuszSubsPlayers_js_1 = __importDefault(require("./indirect/OrfeuszSubsPlayers.js")); 17 | function OrfeuszSubs(anime, episode) { 18 | return __awaiter(this, void 0, void 0, function* () { 19 | const episodeID = yield (0, OrfeuszSubsEpisodes_js_1.default)(anime, episode); 20 | if (episodeID.status !== 200 || !episodeID.episode_id) { 21 | return { 22 | status: 500, 23 | message: "Something went wrong!", 24 | }; 25 | } 26 | const orfeusz = yield (0, OrfeuszSubsPlayers_js_1.default)(episode, episodeID.episode_id, episodeID.bg); 27 | return orfeusz; 28 | }); 29 | } 30 | exports.default = OrfeuszSubs; 31 | -------------------------------------------------------------------------------- /dist/cjs/services/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.ServiceWbijam = exports.ServiceOkamiSubs = exports.ServiceNanaSubs = exports.ServiceGrupaMirai = exports.ServiceReikoProject = exports.ServiceKathSubs = exports.ServiceFumetsu = void 0; 7 | var Fumetsu_js_1 = require("./Fumetsu.js"); 8 | Object.defineProperty(exports, "ServiceFumetsu", { enumerable: true, get: function () { return __importDefault(Fumetsu_js_1).default; } }); 9 | var KathSubs_js_1 = require("./KathSubs.js"); 10 | Object.defineProperty(exports, "ServiceKathSubs", { enumerable: true, get: function () { return __importDefault(KathSubs_js_1).default; } }); 11 | var ReikoProject_js_1 = require("./ReikoProject.js"); 12 | Object.defineProperty(exports, "ServiceReikoProject", { enumerable: true, get: function () { return __importDefault(ReikoProject_js_1).default; } }); 13 | var GrupaMirai_js_1 = require("./GrupaMirai.js"); 14 | Object.defineProperty(exports, "ServiceGrupaMirai", { enumerable: true, get: function () { return __importDefault(GrupaMirai_js_1).default; } }); 15 | var NanaSubs_js_1 = require("./NanaSubs.js"); 16 | Object.defineProperty(exports, "ServiceNanaSubs", { enumerable: true, get: function () { return __importDefault(NanaSubs_js_1).default; } }); 17 | var OkamiSubs_js_1 = require("./OkamiSubs.js"); 18 | Object.defineProperty(exports, "ServiceOkamiSubs", { enumerable: true, get: function () { return __importDefault(OkamiSubs_js_1).default; } }); 19 | var Wbijam_js_1 = require("./Wbijam.js"); 20 | Object.defineProperty(exports, "ServiceWbijam", { enumerable: true, get: function () { return __importDefault(Wbijam_js_1).default; } }); 21 | -------------------------------------------------------------------------------- /dist/mjs/apis/JuniorSubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | export default async function JuniorSubs(category, anime, episode) { 8 | try { 9 | const response = await axios.get(`https://juniorsubs.pl/${category}/${anime}`, { 10 | headers: { 11 | Referer: `https://juniorsubs.pl/${category}/${anime}`, 12 | "X-Requested-With": "XMLHttpRequest", 13 | }, 14 | }); 15 | const dom = new JSDOM(response.data, { virtualConsole }); 16 | const items = dom.window.document.querySelectorAll(".elementor-container .elementor-column.elementor-element .elementor-widget-container .elementor-heading-title "); 17 | const thumbnails = dom.window.document.querySelectorAll(".elementor-container .elementor-column.elementor-element .elementor-widget-wrap .elementor-widget-image .elementor-widget-container"); 18 | let thumbnail = null; 19 | await Promise.all(Array.from(items).map(async function (x, index) { 20 | if (!x || !x.textContent) 21 | return; 22 | const title = x.textContent.toLowerCase(); 23 | if (!title.includes("odcinek")) 24 | return; 25 | if (episode !== Number(title.replaceAll("odcinek", ""))) 26 | return; 27 | if (!thumbnails || !thumbnails[index - 1]) 28 | return; 29 | const tN = thumbnails[index - 1]; 30 | const tNIMG = tN.querySelector("img"); 31 | thumbnail = tNIMG.src || null; 32 | })); 33 | return { 34 | status: 200, 35 | thumbnail: thumbnail, 36 | }; 37 | } 38 | catch (error) { 39 | return { 40 | status: 500, 41 | }; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /dist/cjs/apis/MakiSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | function MakiSubsAPI(action, post, nume, type) { 17 | return __awaiter(this, void 0, void 0, function* () { 18 | try { 19 | const form = new URLSearchParams(); 20 | form.append("action", action); 21 | form.append("post", post); 22 | form.append("nume", nume); 23 | form.append("type", type); 24 | const response = yield axios_1.default.post(`https://makisubs.online/wp-admin/admin-ajax.php`, form); 25 | if (!response.data.embed_url) { 26 | return { 27 | status: 500, 28 | }; 29 | } 30 | return { 31 | status: 200, 32 | player: response.data.embed_url, 33 | }; 34 | } 35 | catch (error) { 36 | return { 37 | status: 500, 38 | }; 39 | } 40 | }); 41 | } 42 | exports.default = MakiSubsAPI; 43 | -------------------------------------------------------------------------------- /dist/cjs/apis/MioroSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | function MioroSubsAPI(action, post, nume, type) { 17 | return __awaiter(this, void 0, void 0, function* () { 18 | try { 19 | const form = new URLSearchParams(); 20 | form.append("action", action); 21 | form.append("post", post); 22 | form.append("nume", nume); 23 | form.append("type", type); 24 | const response = yield axios_1.default.post(`https://miorosubs.pl/wp-admin/admin-ajax.php`, form); 25 | if (!response.data.embed_url) { 26 | return { 27 | status: 500, 28 | }; 29 | } 30 | return { 31 | status: 200, 32 | player: response.data.embed_url, 33 | }; 34 | } 35 | catch (error) { 36 | return { 37 | status: 500, 38 | }; 39 | } 40 | }); 41 | } 42 | exports.default = MioroSubsAPI; 43 | -------------------------------------------------------------------------------- /dist/mjs/services/OkamiSubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | export default async function ServiceOkamiSubs(anime, episode) { 8 | try { 9 | const response = await axios.get(`https://okami-subs.pl/anime/${anime}/odcinek/${episode}`); 10 | const dom = new JSDOM(response.data, { 11 | runScripts: "dangerously", 12 | virtualConsole, 13 | }).window; 14 | const okamiData = dom.InitData; 15 | let episode_next_url = null; 16 | let episodes_cleaning = []; 17 | if (!okamiData) { 18 | return { 19 | status: 500, 20 | message: "Something went wrong!", 21 | }; 22 | } 23 | await Promise.all(okamiData.episode_links.map(async function (x) { 24 | episodes_cleaning.push({ 25 | player: x.player, 26 | url: x.url, 27 | }); 28 | })); 29 | if (dom.document.querySelector(".col-md-4.col-xs-12 .button.pull-right")) { 30 | const item = dom.document.querySelector(".col-md-4.col-xs-12 .button.pull-right"); 31 | if (item) { 32 | episode_next_url = item.href.split("/").pop(); 33 | } 34 | } 35 | if (episodes_cleaning.length === 0) { 36 | return { 37 | status: 500, 38 | message: "Something went wrong!", 39 | }; 40 | } 41 | return { 42 | status: 200, 43 | message: "Mission Accomplished!", 44 | episode_thumbnail: null, 45 | episodes: episodes_cleaning, 46 | episode_next_url: episode_next_url, 47 | }; 48 | } 49 | catch (error) { 50 | return { 51 | status: 500, 52 | message: "Something went wrong!", 53 | }; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /dist/mjs/services/Fumetsu.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../utils/CompileEpisodeData.js"; 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | export default async function ServiceFumetsu(anime, episode) { 9 | try { 10 | const response = await axios.get(`https://fumetsu.pl/anime/${anime}/${episode}`, { 11 | headers: { 12 | Referer: `https://fumetsu.pl/anime/${anime}/${episode}`, 13 | "X-Requested-With": "XMLHttpRequest", 14 | }, 15 | }); 16 | const dom = new JSDOM(response.data, { virtualConsole }); 17 | const items = dom.window.document.querySelectorAll(".video_cont iframe"); 18 | let episodes_cleaning = []; 19 | if (!items) { 20 | return { 21 | status: 500, 22 | message: "Something went wrong!", 23 | }; 24 | } 25 | await Promise.all(Array.from(items).map(async function (x) { 26 | const item = x; 27 | const data = CompilePlayerData(item.src); 28 | if (!data.hosting || !data.player_embed) { 29 | return; 30 | } 31 | episodes_cleaning.push({ 32 | player: data.hosting, 33 | url: data.player_embed, 34 | }); 35 | })); 36 | if (episodes_cleaning.length === 0) { 37 | return { 38 | status: 500, 39 | message: "Something went wrong!", 40 | }; 41 | } 42 | return { 43 | status: 200, 44 | message: "Mission Accomplished!", 45 | episode_thumbnail: null, 46 | episodes: episodes_cleaning, 47 | episode_next_url: Number(episode) + 1, 48 | }; 49 | } 50 | catch (error) { 51 | return { 52 | status: 500, 53 | message: "Something went wrong!", 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/apis/JuniorSubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | 9 | export default async function JuniorSubs( 10 | category: string | number, 11 | anime: string, 12 | episode: string | number 13 | ): Promise<{ 14 | status: number; 15 | thumbnail?: string | null; 16 | }> { 17 | try { 18 | const response: AxiosResponse = await axios.get( 19 | `https://juniorsubs.pl/${category}/${anime}`, 20 | { 21 | headers: { 22 | Referer: `https://juniorsubs.pl/${category}/${anime}`, 23 | "X-Requested-With": "XMLHttpRequest", 24 | }, 25 | } 26 | ); 27 | 28 | const dom = new JSDOM(response.data, { virtualConsole }); 29 | const items = dom.window.document.querySelectorAll( 30 | ".elementor-container .elementor-column.elementor-element .elementor-widget-container .elementor-heading-title " 31 | ); 32 | const thumbnails = dom.window.document.querySelectorAll( 33 | ".elementor-container .elementor-column.elementor-element .elementor-widget-wrap .elementor-widget-image .elementor-widget-container" 34 | ); 35 | let thumbnail = null; 36 | 37 | await Promise.all( 38 | Array.from(items).map(async function (x, index) { 39 | if (!x || !x.textContent) return; 40 | 41 | const title = x.textContent.toLowerCase(); 42 | 43 | if (!title.includes("odcinek")) return; 44 | 45 | if (episode !== Number(title.replaceAll("odcinek", ""))) return; 46 | 47 | if (!thumbnails || !thumbnails[index - 1]) return; 48 | const tN = thumbnails[index - 1] as Element; 49 | const tNIMG = tN.querySelector("img") as HTMLImageElement; 50 | thumbnail = tNIMG.src || null; 51 | }) 52 | ); 53 | 54 | return { 55 | status: 200, 56 | thumbnail: thumbnail, 57 | }; 58 | } catch (error) { 59 | return { 60 | status: 500, 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | 84 | # Gatsby files 85 | .cache/ 86 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 87 | # https://nextjs.org/blog/next-9-1#public-directory-support 88 | # public 89 | 90 | # vuepress build output 91 | .vuepress/dist 92 | 93 | # Serverless directories 94 | .serverless/ 95 | 96 | # FuseBox cache 97 | .fusebox/ 98 | 99 | # DynamoDB Local files 100 | .dynamodb/ 101 | 102 | # TernJS port file 103 | .tern-port 104 | package-lock.json 105 | -------------------------------------------------------------------------------- /dist/cjs/apis/indirect/OrfeuszSubsEpisodes.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | function OrfeuszSubsEpisodes(anime, episode) { 17 | return __awaiter(this, void 0, void 0, function* () { 18 | try { 19 | const response = yield axios_1.default.get(`https://api.orfeusz-subs.pl/api/episode/list?id=${anime}`, { 20 | headers: { 21 | Accept: `application/json`, 22 | }, 23 | }); 24 | if (response.data.length <= 0) { 25 | return { 26 | status: 500, 27 | }; 28 | } 29 | const indexOfObject = response.data.findIndex((object) => { 30 | return object.number === Number(episode); 31 | }); 32 | if (indexOfObject === -1) { 33 | return { 34 | status: 500, 35 | }; 36 | } 37 | return { 38 | status: 200, 39 | episode_id: response.data[indexOfObject].id, 40 | bg: null 41 | }; 42 | } 43 | catch (error) { 44 | return { 45 | status: 500, 46 | }; 47 | } 48 | }); 49 | } 50 | exports.default = OrfeuszSubsEpisodes; 51 | -------------------------------------------------------------------------------- /dist/cjs/apis/Wbijam.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const virtualConsole = new jsdom_1.VirtualConsole(); 18 | virtualConsole.on("error", () => { 19 | // No-op to skip console errors. 20 | }); 21 | function Wbijam(_a) { 22 | return __awaiter(this, arguments, void 0, function* ({ slug, anime, }) { 23 | try { 24 | const response = yield axios_1.default.get(`https://${anime}.wbijam.pl/odtwarzacz-${slug}.html`, { 25 | headers: { 26 | Referer: `https://${anime}.wbijam.pl/odtwarzacz-${slug}.html`, 27 | "X-Requested-With": "XMLHttpRequest", 28 | }, 29 | }); 30 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 31 | const player_url = dom.window.document.querySelector("center iframe"); 32 | if (!player_url) { 33 | return { 34 | status: 500, 35 | }; 36 | } 37 | return { 38 | status: 200, 39 | player: player_url.src, 40 | }; 41 | } 42 | catch (error) { 43 | return { 44 | status: 500, 45 | }; 46 | } 47 | }); 48 | } 49 | exports.default = Wbijam; 50 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/JuniorSubs.js: -------------------------------------------------------------------------------- 1 | import { JuniorSubsAPI } from "../../apis/index.js"; 2 | import axios from "axios"; 3 | import { JSDOM, VirtualConsole } from "jsdom"; 4 | import CompilePlayerData from "../../utils/CompileEpisodeData.js"; 5 | const virtualConsole = new VirtualConsole(); 6 | virtualConsole.on("error", () => { 7 | // No-op to skip console errors. 8 | }); 9 | export default async function ServiceJuniorSubs(category, anime, episode) { 10 | try { 11 | const response = await axios.get(`https://juniorsubs.pl/${category}/${anime}/odcinek-${episode}`, { 12 | headers: { 13 | Referer: `https://juniorsubs.pl/${category}/${anime}/odcinek-${episode}`, 14 | "X-Requested-With": "XMLHttpRequest", 15 | }, 16 | }); 17 | const dom = new JSDOM(response.data, { virtualConsole }); 18 | const pIframe = dom.window.document.querySelector('.elementor-widget[data-element_type="widget"] .elementor-widget-container iframe'); 19 | if (!pIframe) { 20 | return { 21 | status: 500, 22 | message: "Something went wrong!", 23 | }; 24 | } 25 | const data = CompilePlayerData(pIframe.src); 26 | if (!data || 27 | !data.hosting || 28 | !data.player_embed || 29 | new URL(response.request.res.responseUrl).pathname !== 30 | `/${category}/${anime}/odcinek-${episode}/`) { 31 | return { 32 | status: 500, 33 | message: "Something went wrong!", 34 | }; 35 | } 36 | const thumbnail = await JuniorSubsAPI(category, anime, Number(episode)); 37 | return { 38 | status: 200, 39 | message: "Mission Accomplished!", 40 | episode_thumbnail: thumbnail && thumbnail.thumbnail ? thumbnail.thumbnail : null, 41 | episodes: [ 42 | { 43 | player: data.hosting, 44 | url: data.player_embed, 45 | }, 46 | ], 47 | episode_next_url: Number(episode) + 1, 48 | }; 49 | } 50 | catch (error) { 51 | return { 52 | status: 500, 53 | message: "Something went wrong!", 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /dist/cjs/apis/indirect/OrfeuszSubsPlayers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | function OrfeuszSubsPlayers(episode, episode_id, bg) { 17 | return __awaiter(this, void 0, void 0, function* () { 18 | try { 19 | const response = yield axios_1.default.get(`https://api.orfeusz-subs.pl/api/player/list?id=${episode_id}`, { 20 | headers: { 21 | Accept: `application/json`, 22 | }, 23 | }); 24 | if (response.data.length <= 0) { 25 | return { 26 | status: 500, 27 | message: "Something went wrong!", 28 | }; 29 | } 30 | return { 31 | status: 200, 32 | message: "Mission Accomplished!", 33 | episode_thumbnail: bg, 34 | episodes: response.data.map(function (x) { 35 | return { 36 | player: x.source, 37 | url: x.iframe, 38 | }; 39 | }), 40 | episode_next_url: Number(episode) + 1, 41 | }; 42 | } 43 | catch (error) { 44 | return { 45 | status: 500, 46 | message: "Something went wrong!", 47 | }; 48 | } 49 | }); 50 | } 51 | exports.default = OrfeuszSubsPlayers; 52 | -------------------------------------------------------------------------------- /src/services/Fumetsu.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../utils/CompileEpisodeData.js"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const virtualConsole = new VirtualConsole(); 12 | virtualConsole.on("error", () => { 13 | // No-op to skip console errors. 14 | }); 15 | 16 | export default async function ServiceFumetsu( 17 | anime: string, 18 | episode: string | number 19 | ): Promise<{ 20 | status: number; 21 | message: string; 22 | episode_thumbnail?: string | null; 23 | episodes?: IPlayer[]; 24 | episode_next_url?: string | number; 25 | }> { 26 | try { 27 | const response: AxiosResponse = await axios.get( 28 | `https://fumetsu.pl/anime/${anime}/${episode}`, 29 | { 30 | headers: { 31 | Referer: `https://fumetsu.pl/anime/${anime}/${episode}`, 32 | "X-Requested-With": "XMLHttpRequest", 33 | }, 34 | } 35 | ); 36 | 37 | const dom = new JSDOM(response.data, { virtualConsole }); 38 | const items = dom.window.document.querySelectorAll(".video_cont iframe"); 39 | let episodes_cleaning: IPlayer[] = []; 40 | 41 | if (!items) { 42 | return { 43 | status: 500, 44 | message: "Something went wrong!", 45 | }; 46 | } 47 | 48 | await Promise.all( 49 | Array.from(items).map(async function (x) { 50 | const item = x as HTMLIFrameElement; 51 | const data = CompilePlayerData(item.src); 52 | 53 | if (!data.hosting || !data.player_embed) { 54 | return; 55 | } 56 | 57 | episodes_cleaning.push({ 58 | player: data.hosting, 59 | url: data.player_embed, 60 | }); 61 | }) 62 | ); 63 | 64 | if (episodes_cleaning.length === 0) { 65 | return { 66 | status: 500, 67 | message: "Something went wrong!", 68 | }; 69 | } 70 | 71 | return { 72 | status: 200, 73 | message: "Mission Accomplished!", 74 | episode_thumbnail: null, 75 | episodes: episodes_cleaning, 76 | episode_next_url: Number(episode) + 1, 77 | }; 78 | } catch (error) { 79 | return { 80 | status: 500, 81 | message: "Something went wrong!", 82 | }; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/services/OkamiSubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | //Return Interfaces 5 | interface IPlayer { 6 | player: string; 7 | url: string; 8 | } 9 | 10 | const virtualConsole = new VirtualConsole(); 11 | virtualConsole.on("error", () => { 12 | // No-op to skip console errors. 13 | }); 14 | 15 | export default async function ServiceOkamiSubs( 16 | anime: string, 17 | episode: string | number 18 | ): Promise<{ 19 | status: number; 20 | message: string; 21 | episode_thumbnail?: string | null; 22 | episodes?: IPlayer[]; 23 | episode_next_url?: string | number | null; 24 | }> { 25 | try { 26 | const response: AxiosResponse = await axios.get( 27 | `https://okami-subs.pl/anime/${anime}/odcinek/${episode}` 28 | ); 29 | 30 | const dom = new JSDOM(response.data, { 31 | runScripts: "dangerously", 32 | virtualConsole, 33 | }).window; 34 | const okamiData = dom.InitData; 35 | let episode_next_url = null; 36 | let episodes_cleaning: IPlayer[] = []; 37 | 38 | if (!okamiData) { 39 | return { 40 | status: 500, 41 | message: "Something went wrong!", 42 | }; 43 | } 44 | 45 | await Promise.all( 46 | okamiData.episode_links.map(async function (x: { 47 | player: string; 48 | url: string; 49 | }) { 50 | episodes_cleaning.push({ 51 | player: x.player, 52 | url: x.url, 53 | }); 54 | }) 55 | ); 56 | 57 | if (dom.document.querySelector(".col-md-4.col-xs-12 .button.pull-right")) { 58 | const item = dom.document.querySelector( 59 | ".col-md-4.col-xs-12 .button.pull-right" 60 | ) as HTMLAnchorElement; 61 | 62 | if (item) { 63 | episode_next_url = item.href.split("/").pop(); 64 | } 65 | } 66 | 67 | if (episodes_cleaning.length === 0) { 68 | return { 69 | status: 500, 70 | message: "Something went wrong!", 71 | }; 72 | } 73 | 74 | return { 75 | status: 200, 76 | message: "Mission Accomplished!", 77 | episode_thumbnail: null, 78 | episodes: episodes_cleaning, 79 | episode_next_url: episode_next_url, 80 | }; 81 | } catch (error) { 82 | return { 83 | status: 500, 84 | message: "Something went wrong!", 85 | }; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /dist/cjs/apis/FrixySubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | function FrixySubs(anime, episode) { 17 | return __awaiter(this, void 0, void 0, function* () { 18 | try { 19 | const response = yield axios_1.default.get(`https://frixysubs.pl/api/anime/${anime}/${episode}`, { 20 | headers: { 21 | Accept: `application/json`, 22 | }, 23 | }); 24 | const { episode: { poster, players }, } = response.data; 25 | if (players.length <= 0) { 26 | return { 27 | status: 500, 28 | message: "Something went wrong!", 29 | }; 30 | } 31 | return { 32 | status: 200, 33 | message: "Mission Accomplished!", 34 | episode_thumbnail: poster !== null && poster !== void 0 ? poster : null, 35 | episodes: players.map(function (x) { 36 | return { 37 | player: x.name, 38 | url: x.link, 39 | }; 40 | }), 41 | episode_next_url: Number(episode) + 1, 42 | }; 43 | } 44 | catch (error) { 45 | return { 46 | status: 500, 47 | message: "Something went wrong!", 48 | }; 49 | } 50 | }); 51 | } 52 | exports.default = FrixySubs; 53 | -------------------------------------------------------------------------------- /dist/mjs/services/GrupaMirai.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | export default async function ServiceGrupaMirai(anime, episode) { 8 | try { 9 | const response = await axios.get(`https://www.grupa-mirai.pl/${anime}`, { 10 | headers: { 11 | Referer: `https://www.grupa-mirai.pl/${anime}`, 12 | "X-Requested-With": "XMLHttpRequest", 13 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 14 | }, 15 | }); 16 | const dom = new JSDOM(response.data, { runScripts: 'dangerously', virtualConsole }); 17 | const cdaPlayer = dom.window.epCda || dom.window.epCDA; 18 | const megaPlayer = dom.window.epMega; 19 | const sibnetPlayer = dom.window.epSibnet; 20 | let episodes_cleaning = []; 21 | if (cdaPlayer && cdaPlayer[episode]) { 22 | episodes_cleaning.push({ 23 | player: "CDA", 24 | url: "https://ebd.cda.pl/620x395/" + cdaPlayer[episode], 25 | }); 26 | } 27 | if (megaPlayer && megaPlayer[episode]) { 28 | episodes_cleaning.push({ 29 | player: "MEGA", 30 | url: "https://mega.nz/embed/" + megaPlayer[episode], 31 | }); 32 | } 33 | if (sibnetPlayer && sibnetPlayer[episode]) { 34 | episodes_cleaning.push({ 35 | player: "SIBNET", 36 | url: "https://video.sibnet.ru/shell.php?videoid=" + sibnetPlayer[episode], 37 | }); 38 | } 39 | if (episodes_cleaning.length === 0) { 40 | return { 41 | status: 500, 42 | message: "Something went wrong!", 43 | }; 44 | } 45 | return { 46 | status: 200, 47 | message: "Mission Accomplished!", 48 | episode_thumbnail: null, 49 | episodes: episodes_cleaning, 50 | episode_next_url: Number(episode) + 1, 51 | }; 52 | } 53 | catch (error) { 54 | return { 55 | status: 500, 56 | message: "Something went wrong!", 57 | }; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@docchi/scraping-anime-websites-poland", 3 | "version": "1.0.46", 4 | "description": "Moduł do pobierania linków z popularnych polskich strony z anime", 5 | "main": "dist/cjs/app.js", 6 | "module": "dist/mjs/app.js", 7 | "exports": { 8 | ".": { 9 | "import": "./dist/mjs/app.js", 10 | "require": "./dist/cjs/app.js" 11 | } 12 | }, 13 | "files": [ 14 | "dist/**/*" 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/docchipl/Pobieranie-anime-z-polskich-stron.git" 19 | }, 20 | "scripts": { 21 | "start": "node dist/cjs/app.js", 22 | "build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && bash ./fixup.sh", 23 | "build:run": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && bash ./fixup.sh && node dist/cjs/app.js", 24 | "lint": "eslint . --ext .ts", 25 | "test": "jest" 26 | }, 27 | "bugs": { 28 | "url": "https://github.com/docchipl/Pobieranie-anime-z-polskich-stron/issues" 29 | }, 30 | "homepage": "https://github.com/docchipl/Pobieranie-anime-z-polskich-stron#readme", 31 | "keywords": [ 32 | "anime", 33 | "poland", 34 | "frrixysubs", 35 | "okami-subs", 36 | "okamisubs", 37 | "miorosubs", 38 | "mioro-subs", 39 | "maousubs", 40 | "docchi", 41 | "fumetsu", 42 | "nanasubs", 43 | "cda", 44 | "cdaprofile", 45 | "kathsubs", 46 | "katherinemay", 47 | "reikoproject", 48 | "reiko", 49 | "grupamirai", 50 | "grupa-mirai", 51 | "mirai", 52 | "wbijam", 53 | "tmj", 54 | "twojamalajaponia", 55 | "juniorsubs", 56 | "junior-subs", 57 | "paldea", 58 | "makisubs", 59 | "maki-subs", 60 | "pl", 61 | "napisy" 62 | ], 63 | "author": "3xanax", 64 | "license": "MIT", 65 | "dependencies": { 66 | "axios": "^1.4.0", 67 | "form-data": "^4.0.0", 68 | "jsdom": "^22.1.0", 69 | "unraw": "^2.0.1" 70 | }, 71 | "devDependencies": { 72 | "@jest/globals": "^29.7.0", 73 | "@types/jest": "^29.5.7", 74 | "@types/jsdom": "^21.1.1", 75 | "@types/node": "^20.8.10", 76 | "@typescript-eslint/eslint-plugin": "^6.4.0", 77 | "@typescript-eslint/parser": "^6.4.0", 78 | "eslint": "^8.47.0", 79 | "jest": "^29.7.0", 80 | "ts-jest": "^29.1.1", 81 | "ts-node": "^10.9.1", 82 | "typescript": "^5.1.6" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /dist/mjs/services/KathSubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../utils/CompileEpisodeData.js"; 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | export default async function ServiceKathSubs(anime, episode) { 9 | try { 10 | const response = await axios.get(`https://kathsubs.blogspot.com/p/${anime}.html`, { 11 | headers: { 12 | Referer: `https://kathsubs.blogspot.com/p/${anime}.html`, 13 | "X-Requested-With": "XMLHttpRequest", 14 | }, 15 | }); 16 | const dom = new JSDOM(response.data, { virtualConsole }); 17 | const items = dom.window.document.querySelectorAll(".post-body.entry-content span"); 18 | let episodes_cleaning = []; 19 | if (!items) { 20 | return { 21 | status: 500, 22 | message: "Something went wrong!", 23 | }; 24 | } 25 | await Promise.all(Array.from(items).map(function (x) { 26 | if (!x || !x.textContent) 27 | return; 28 | const link = x.querySelector("a"); 29 | const text = x.textContent; 30 | const episodeNumber = text.match(/(\d+)/); 31 | if (!link || !episodeNumber) 32 | return; 33 | const data = CompilePlayerData(link.href); 34 | if (!data.hosting || !data.player_embed) 35 | return; 36 | if (Number(episodeNumber[0]) === Number(episode)) { 37 | episodes_cleaning.push({ 38 | player: data.hosting, 39 | url: data.player_embed, 40 | }); 41 | } 42 | })); 43 | if (episodes_cleaning.length === 0) { 44 | return { 45 | status: 500, 46 | message: "Something went wrong!", 47 | }; 48 | } 49 | return { 50 | status: 200, 51 | message: "Mission Accomplished!", 52 | episode_thumbnail: null, 53 | episodes: episodes_cleaning, 54 | episode_next_url: Number(episode) + 1, 55 | }; 56 | } 57 | catch (error) { 58 | return { 59 | status: 500, 60 | message: "Something went wrong!", 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /dist/cjs/apis/Docchi.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | function Docchi(anime, episode) { 17 | return __awaiter(this, void 0, void 0, function* () { 18 | var _a; 19 | try { 20 | const response = yield axios_1.default.get(`https://api.docchi.pl/v1/episodes/find/${anime}/${episode}`, { 21 | headers: { 22 | Accept: `application/json`, 23 | }, 24 | }); 25 | if (response.data.length <= 0) { 26 | return { 27 | status: 500, 28 | message: "Something went wrong!", 29 | }; 30 | } 31 | return { 32 | status: 200, 33 | message: "Mission Accomplished!", 34 | episode_thumbnail: (_a = response.data[0].bg) !== null && _a !== void 0 ? _a : null, 35 | episodes: response.data.map(function (x) { 36 | return { 37 | player: x.player_hosting, 38 | url: x.player, 39 | translator: x.translator_title.trim() === "" ? "none" : x.translator_title.trim() 40 | }; 41 | }), 42 | episode_next_url: Number(episode) + 1, 43 | }; 44 | } 45 | catch (error) { 46 | return { 47 | status: 500, 48 | message: "Something went wrong!", 49 | }; 50 | } 51 | }); 52 | } 53 | exports.default = Docchi; 54 | -------------------------------------------------------------------------------- /dist/mjs/services/NanaSubs.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | export default async function ServiceNanaSubs(anime, episode) { 8 | try { 9 | const response = await axios.get(`https://nanasubs.com/anime/${anime}/odcinek-${episode}`, { 10 | headers: { 11 | Referer: `https://nanasubs.com/anime/${anime}/odcinek-${episode}`, 12 | "X-Requested-With": "XMLHttpRequest", 13 | }, 14 | }); 15 | const dom = new JSDOM(response.data, { virtualConsole }); 16 | const nanaArray = dom.window.document.querySelectorAll(`script[type="application/ld+json"]`); 17 | const items = dom.window.document.querySelectorAll(".ns-episode-players-option"); 18 | let episodes_cleaning = []; 19 | if (!items || !nanaArray) { 20 | return { 21 | status: 500, 22 | message: "Something went wrong!", 23 | }; 24 | } 25 | const nD = Array.from(nanaArray); 26 | if (!nD || nD.length <= 1 || !nD[1].textContent) { 27 | return { 28 | status: 500, 29 | message: "Something went wrong!", 30 | }; 31 | } 32 | const nanaData = JSON.parse(nD[1].textContent); 33 | await Promise.all(Array.from(items).map(async function (x) { 34 | if (!x || 35 | !x.getAttribute("data-player") || 36 | !x.getAttribute("data-player-url")) { 37 | return; 38 | } 39 | episodes_cleaning.push({ 40 | player: x.getAttribute("data-player"), 41 | url: x.getAttribute("data-player-url"), 42 | }); 43 | })); 44 | if (episodes_cleaning.length === 0) { 45 | return { 46 | status: 500, 47 | message: "Something went wrong!", 48 | }; 49 | } 50 | return { 51 | status: 200, 52 | message: "Mission Accomplished!", 53 | episode_thumbnail: nanaData.thumbnailUrl || null, 54 | episodes: episodes_cleaning, 55 | episode_next_url: Number(episode) + 1, 56 | }; 57 | } 58 | catch (error) { 59 | return { 60 | status: 500, 61 | message: "Something went wrong!", 62 | }; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /dist/mjs/services/ReikoProject.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../utils/CompileEpisodeData.js"; 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | export default async function ServiceReikoProject(anime, episode) { 9 | try { 10 | const response = await axios.get(`https://reikoproject.blogspot.com/${anime}.html`, { 11 | headers: { 12 | Referer: `https://reikoproject.blogspot.com/${anime}.html`, 13 | "X-Requested-With": "XMLHttpRequest", 14 | }, 15 | }); 16 | const dom = new JSDOM(response.data, { virtualConsole }); 17 | const items = dom.window.document.querySelectorAll(`div[style='font-family: "times new roman";'] i b`); 18 | let episodes_cleaning = []; 19 | if (!items) { 20 | return { 21 | status: 500, 22 | message: "Something went wrong!", 23 | }; 24 | } 25 | await Promise.all(Array.from(items).map(function (x) { 26 | if (!x || !x.textContent || !x.querySelector("a")) 27 | return; 28 | const text = x.textContent; 29 | const link = x.querySelector("a"); 30 | const episodeNumber = text.match(/(\d+)/); 31 | if (!link || !episodeNumber) 32 | return; 33 | const data = CompilePlayerData(link.href); 34 | if (!data.hosting || !data.player_embed) { 35 | return; 36 | } 37 | const defineNumber = Number(episodeNumber === null ? 9999 : episodeNumber[0]); 38 | if (defineNumber === Number(episode)) { 39 | episodes_cleaning.push({ 40 | player: data.hosting, 41 | url: data.player_embed, 42 | }); 43 | } 44 | })); 45 | if (episodes_cleaning.length === 0) { 46 | return { 47 | status: 500, 48 | message: "Something went wrong!", 49 | }; 50 | } 51 | return { 52 | status: 200, 53 | message: "Mission Accomplished!", 54 | episode_thumbnail: null, 55 | episodes: episodes_cleaning, 56 | episode_next_url: Number(episode) + 1, 57 | }; 58 | } 59 | catch (error) { 60 | return { 61 | status: 500, 62 | message: "Something went wrong!", 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/services/wordpress/JuniorSubs.ts: -------------------------------------------------------------------------------- 1 | import { JuniorSubsAPI } from "../../apis/index.js"; 2 | import axios, { AxiosResponse } from "axios"; 3 | import { JSDOM, VirtualConsole } from "jsdom"; 4 | import CompilePlayerData from "../../utils/CompileEpisodeData.js"; 5 | 6 | //Return Interfaces 7 | interface IPlayer { 8 | player: string; 9 | url: string; 10 | } 11 | 12 | const virtualConsole = new VirtualConsole(); 13 | virtualConsole.on("error", () => { 14 | // No-op to skip console errors. 15 | }); 16 | 17 | export default async function ServiceJuniorSubs( 18 | category: string | number, 19 | anime: string, 20 | episode: string | number 21 | ): Promise<{ 22 | status: number; 23 | message: string; 24 | episode_thumbnail?: string | null; 25 | episodes?: IPlayer[]; 26 | episode_next_url?: string | number; 27 | }> { 28 | try { 29 | const response: AxiosResponse = await axios.get( 30 | `https://juniorsubs.pl/${category}/${anime}/odcinek-${episode}`, 31 | { 32 | headers: { 33 | Referer: `https://juniorsubs.pl/${category}/${anime}/odcinek-${episode}`, 34 | "X-Requested-With": "XMLHttpRequest", 35 | }, 36 | } 37 | ); 38 | 39 | const dom = new JSDOM(response.data, { virtualConsole }); 40 | const pIframe = dom.window.document.querySelector( 41 | '.elementor-widget[data-element_type="widget"] .elementor-widget-container iframe' 42 | ) as HTMLIFrameElement; 43 | 44 | if (!pIframe) { 45 | return { 46 | status: 500, 47 | message: "Something went wrong!", 48 | }; 49 | } 50 | 51 | const data = CompilePlayerData(pIframe.src); 52 | 53 | if ( 54 | !data || 55 | !data.hosting || 56 | !data.player_embed || 57 | new URL(response.request.res.responseUrl).pathname !== 58 | `/${category}/${anime}/odcinek-${episode}/` 59 | ) { 60 | return { 61 | status: 500, 62 | message: "Something went wrong!", 63 | }; 64 | } 65 | 66 | const thumbnail = await JuniorSubsAPI(category, anime, Number(episode)); 67 | 68 | return { 69 | status: 200, 70 | message: "Mission Accomplished!", 71 | episode_thumbnail: 72 | thumbnail && thumbnail.thumbnail ? thumbnail.thumbnail : null, 73 | episodes: [ 74 | { 75 | player: data.hosting, 76 | url: data.player_embed, 77 | }, 78 | ], 79 | episode_next_url: Number(episode) + 1, 80 | }; 81 | } catch (error) { 82 | return { 83 | status: 500, 84 | message: "Something went wrong!", 85 | }; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/services/GrupaMirai.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | //Return Interfaces 5 | interface IPlayer { 6 | player: string; 7 | url: string; 8 | } 9 | 10 | const virtualConsole = new VirtualConsole(); 11 | virtualConsole.on("error", () => { 12 | // No-op to skip console errors. 13 | }); 14 | 15 | export default async function ServiceGrupaMirai( 16 | anime: string, 17 | episode: string | number 18 | ): Promise<{ 19 | status: number; 20 | message: string; 21 | episode_thumbnail?: string | null; 22 | episodes?: IPlayer[]; 23 | episode_next_url?: string | number; 24 | }> { 25 | try { 26 | const response: AxiosResponse = await axios.get( 27 | `https://www.grupa-mirai.pl/${anime}`, 28 | { 29 | headers: { 30 | Referer: `https://www.grupa-mirai.pl/${anime}`, 31 | "X-Requested-With": "XMLHttpRequest", 32 | "User-Agent": 33 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 34 | }, 35 | } 36 | ); 37 | 38 | const dom = new JSDOM(response.data, { runScripts: 'dangerously', virtualConsole }); 39 | const cdaPlayer = dom.window.epCda || dom.window.epCDA; 40 | const megaPlayer = dom.window.epMega; 41 | const sibnetPlayer = dom.window.epSibnet; 42 | let episodes_cleaning: IPlayer[] = []; 43 | 44 | if (cdaPlayer && cdaPlayer[episode]) { 45 | episodes_cleaning.push({ 46 | player: "CDA", 47 | url: "https://ebd.cda.pl/620x395/" + cdaPlayer[episode], 48 | }); 49 | } 50 | 51 | if (megaPlayer && megaPlayer[episode]) { 52 | episodes_cleaning.push({ 53 | player: "MEGA", 54 | url: "https://mega.nz/embed/" + megaPlayer[episode], 55 | }); 56 | } 57 | 58 | if (sibnetPlayer && sibnetPlayer[episode]) { 59 | episodes_cleaning.push({ 60 | player: "SIBNET", 61 | url: 62 | "https://video.sibnet.ru/shell.php?videoid=" + sibnetPlayer[episode], 63 | }); 64 | } 65 | 66 | if (episodes_cleaning.length === 0) { 67 | return { 68 | status: 500, 69 | message: "Something went wrong!", 70 | }; 71 | } 72 | 73 | return { 74 | status: 200, 75 | message: "Mission Accomplished!", 76 | episode_thumbnail: null, 77 | episodes: episodes_cleaning, 78 | episode_next_url: Number(episode) + 1, 79 | }; 80 | } catch (error) { 81 | return { 82 | status: 500, 83 | message: "Something went wrong!", 84 | }; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/DesuOnline.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | export default async function ServiceDesuOnline(anime, episode) { 8 | try { 9 | const response = await axios.get(`https://desu-online.pl/${anime}-odcinek-${episode}`, { 10 | headers: { 11 | Referer: `https://desu-online.pl/${anime}-odcinek-${episode}`, 12 | "X-Requested-With": "XMLHttpRequest", 13 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 14 | }, 15 | }); 16 | const dom = new JSDOM(response.data, { virtualConsole }); 17 | const items = dom.window.document.querySelectorAll(".mobius select.mirror option"); 18 | let episodes_cleaning = []; 19 | await Promise.all(Array.from(items).map(async function (x) { 20 | const item = x; 21 | if (!item || !item.textContent || !item.value) { 22 | return; 23 | } 24 | if (item.textContent.toLowerCase().includes("wybierz")) 25 | return; 26 | const player_url = Buffer.from(item.value, "base64") 27 | .toString("utf8") 28 | .match(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim); 29 | if (!player_url) { 30 | return; 31 | } 32 | const playerURL = player_url && typeof player_url !== "string" 33 | ? player_url[0] 34 | : player_url; 35 | episodes_cleaning.push({ 36 | player: item.textContent.toUpperCase().replaceAll("\n", "").trim(), 37 | url: playerURL, 38 | }); 39 | })); 40 | if (episodes_cleaning.length === 0) { 41 | return { 42 | status: 500, 43 | message: "Something went wrong!", 44 | }; 45 | } 46 | return { 47 | status: 200, 48 | message: "Mission Accomplished!", 49 | episode_thumbnail: null, 50 | episodes: episodes_cleaning, 51 | episode_next_url: Number(episode) + 1, 52 | }; 53 | } 54 | catch (error) { 55 | return { 56 | status: 500, 57 | message: "Something went wrong!", 58 | }; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/services/KathSubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../utils/CompileEpisodeData.js"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const virtualConsole = new VirtualConsole(); 12 | virtualConsole.on("error", () => { 13 | // No-op to skip console errors. 14 | }); 15 | 16 | export default async function ServiceKathSubs( 17 | anime: string, 18 | episode: string | number 19 | ): Promise<{ 20 | status: number; 21 | message: string; 22 | episode_thumbnail?: string | null; 23 | episodes?: IPlayer[]; 24 | episode_next_url?: string | number; 25 | }> { 26 | try { 27 | const response: AxiosResponse = await axios.get( 28 | `https://kathsubs.blogspot.com/p/${anime}.html`, 29 | { 30 | headers: { 31 | Referer: `https://kathsubs.blogspot.com/p/${anime}.html`, 32 | "X-Requested-With": "XMLHttpRequest", 33 | }, 34 | } 35 | ); 36 | 37 | const dom = new JSDOM(response.data, { virtualConsole }); 38 | const items = dom.window.document.querySelectorAll( 39 | ".post-body.entry-content span" 40 | ); 41 | let episodes_cleaning: IPlayer[] = []; 42 | 43 | if (!items) { 44 | return { 45 | status: 500, 46 | message: "Something went wrong!", 47 | }; 48 | } 49 | 50 | await Promise.all( 51 | Array.from(items).map(function (x) { 52 | if (!x || !x.textContent) return; 53 | 54 | const link = x.querySelector("a"); 55 | const text = x.textContent; 56 | const episodeNumber = text.match(/(\d+)/); 57 | 58 | if (!link || !episodeNumber) return; 59 | 60 | const data = CompilePlayerData(link.href); 61 | 62 | if (!data.hosting || !data.player_embed) return; 63 | 64 | if (Number(episodeNumber[0]) === Number(episode)) { 65 | episodes_cleaning.push({ 66 | player: data.hosting, 67 | url: data.player_embed, 68 | }); 69 | } 70 | }) 71 | ); 72 | 73 | if (episodes_cleaning.length === 0) { 74 | return { 75 | status: 500, 76 | message: "Something went wrong!", 77 | }; 78 | } 79 | 80 | return { 81 | status: 200, 82 | message: "Mission Accomplished!", 83 | episode_thumbnail: null, 84 | episodes: episodes_cleaning, 85 | episode_next_url: Number(episode) + 1, 86 | }; 87 | } catch (error) { 88 | return { 89 | status: 500, 90 | message: "Something went wrong!", 91 | }; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/Paldea.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../../utils/CompileEpisodeData.js"; 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | export default async function ServicePaldea(episode) { 9 | try { 10 | const response = await axios.get(`https://paldea.pl/odcinek/${episode}`, { 11 | headers: { 12 | Referer: `https://paldea.pl/odcinek/${episode}`, 13 | "X-Requested-With": "XMLHttpRequest", 14 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 15 | }, 16 | }); 17 | const dom = new JSDOM(response.data, { virtualConsole }); 18 | const vC = dom.window.document.querySelectorAll(".video-container"); 19 | const urls = dom.window.document.querySelectorAll(".post-content .fusion-layout-column .fusion-column-wrapper a.fusion-button"); 20 | let episodes_cleaning = []; 21 | let episode_next_url = null; 22 | await Promise.all(Array.from(urls).map(async function (x) { 23 | const item = x; 24 | const urlArray = item.href.split("/"); 25 | if (!urlArray.includes("odcinek")) { 26 | return; 27 | } 28 | const episodeNumber = urlArray.length >= 6 ? urlArray[4] : urlArray.pop(); 29 | if (!episodeNumber || episodeNumber === episode) { 30 | return; 31 | } 32 | episode_next_url = episodeNumber ?? null; 33 | })); 34 | await Promise.all(Array.from(vC).map(async function (x) { 35 | if (!x) 36 | return; 37 | const player = x.querySelector("iframe"); 38 | const data = CompilePlayerData(player.src); 39 | if (!data || !data.player_embed || !data.hosting) { 40 | return; 41 | } 42 | episodes_cleaning.push({ 43 | player: data.hosting, 44 | url: data.player_embed, 45 | }); 46 | })); 47 | if (episodes_cleaning.length === 0) { 48 | return { 49 | status: 500, 50 | message: "Something went wrong!", 51 | }; 52 | } 53 | return { 54 | status: 200, 55 | message: "Mission Accomplished!", 56 | episode_thumbnail: null, 57 | episodes: episodes_cleaning, 58 | episode_next_url: episode_next_url, 59 | }; 60 | } 61 | catch (error) { 62 | return { 63 | status: 500, 64 | message: "Something went wrong!", 65 | }; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/services/NanaSubs.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | //Return Interfaces 5 | interface IPlayer { 6 | player: string; 7 | url: string; 8 | } 9 | 10 | const virtualConsole = new VirtualConsole(); 11 | virtualConsole.on("error", () => { 12 | // No-op to skip console errors. 13 | }); 14 | 15 | export default async function ServiceNanaSubs( 16 | anime: string, 17 | episode: string | number 18 | ): Promise<{ 19 | status: number; 20 | message: string; 21 | episode_thumbnail?: string | null; 22 | episodes?: IPlayer[]; 23 | episode_next_url?: string | number; 24 | }> { 25 | try { 26 | const response: AxiosResponse = await axios.get( 27 | `https://nanasubs.com/anime/${anime}/odcinek-${episode}`, 28 | { 29 | headers: { 30 | Referer: `https://nanasubs.com/anime/${anime}/odcinek-${episode}`, 31 | "X-Requested-With": "XMLHttpRequest", 32 | }, 33 | } 34 | ); 35 | 36 | const dom = new JSDOM(response.data, { virtualConsole }); 37 | const nanaArray = dom.window.document.querySelectorAll( 38 | `script[type="application/ld+json"]` 39 | ); 40 | const items = dom.window.document.querySelectorAll( 41 | ".ns-episode-players-option" 42 | ); 43 | let episodes_cleaning: IPlayer[] = []; 44 | 45 | if (!items || !nanaArray) { 46 | return { 47 | status: 500, 48 | message: "Something went wrong!", 49 | }; 50 | } 51 | const nD = Array.from(nanaArray); 52 | 53 | if (!nD || nD.length <= 1 || !nD[1].textContent) { 54 | return { 55 | status: 500, 56 | message: "Something went wrong!", 57 | }; 58 | } 59 | 60 | const nanaData = JSON.parse(nD[1].textContent); 61 | 62 | await Promise.all( 63 | Array.from(items).map(async function (x) { 64 | if ( 65 | !x || 66 | !x.getAttribute("data-player") || 67 | !x.getAttribute("data-player-url") 68 | ) { 69 | return; 70 | } 71 | 72 | episodes_cleaning.push({ 73 | player: x.getAttribute("data-player") as string, 74 | url: x.getAttribute("data-player-url") as string, 75 | }); 76 | }) 77 | ); 78 | 79 | if (episodes_cleaning.length === 0) { 80 | return { 81 | status: 500, 82 | message: "Something went wrong!", 83 | }; 84 | } 85 | 86 | return { 87 | status: 200, 88 | message: "Mission Accomplished!", 89 | episode_thumbnail: nanaData.thumbnailUrl || null, 90 | episodes: episodes_cleaning, 91 | episode_next_url: Number(episode) + 1, 92 | }; 93 | } catch (error) { 94 | return { 95 | status: 500, 96 | message: "Something went wrong!", 97 | }; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/services/ReikoProject.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../utils/CompileEpisodeData.js"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const virtualConsole = new VirtualConsole(); 12 | virtualConsole.on("error", () => { 13 | // No-op to skip console errors. 14 | }); 15 | 16 | export default async function ServiceReikoProject( 17 | anime: string, 18 | episode: string | number 19 | ): Promise<{ 20 | status: number; 21 | message: string; 22 | episode_thumbnail?: string | null; 23 | episodes?: IPlayer[]; 24 | episode_next_url?: string | number; 25 | }> { 26 | try { 27 | const response: AxiosResponse = await axios.get( 28 | `https://reikoproject.blogspot.com/${anime}.html`, 29 | { 30 | headers: { 31 | Referer: `https://reikoproject.blogspot.com/${anime}.html`, 32 | "X-Requested-With": "XMLHttpRequest", 33 | }, 34 | } 35 | ); 36 | 37 | const dom = new JSDOM(response.data, { virtualConsole }); 38 | const items = dom.window.document.querySelectorAll( 39 | `div[style='font-family: "times new roman";'] i b` 40 | ); 41 | let episodes_cleaning: IPlayer[] = []; 42 | 43 | if (!items) { 44 | return { 45 | status: 500, 46 | message: "Something went wrong!", 47 | }; 48 | } 49 | 50 | await Promise.all( 51 | Array.from(items).map(function (x) { 52 | if (!x || !x.textContent || !x.querySelector("a")) return; 53 | 54 | const text = x.textContent; 55 | const link = x.querySelector("a"); 56 | const episodeNumber = text.match(/(\d+)/); 57 | 58 | if (!link || !episodeNumber) return; 59 | 60 | const data = CompilePlayerData(link.href); 61 | 62 | if (!data.hosting || !data.player_embed) { 63 | return; 64 | } 65 | 66 | const defineNumber = Number( 67 | episodeNumber === null ? 9999 : episodeNumber[0] 68 | ); 69 | 70 | if (defineNumber === Number(episode)) { 71 | episodes_cleaning.push({ 72 | player: data.hosting, 73 | url: data.player_embed, 74 | }); 75 | } 76 | }) 77 | ); 78 | 79 | if (episodes_cleaning.length === 0) { 80 | return { 81 | status: 500, 82 | message: "Something went wrong!", 83 | }; 84 | } 85 | 86 | return { 87 | status: 200, 88 | message: "Mission Accomplished!", 89 | episode_thumbnail: null, 90 | episodes: episodes_cleaning, 91 | episode_next_url: Number(episode) + 1, 92 | }; 93 | } catch (error) { 94 | return { 95 | status: 500, 96 | message: "Something went wrong!", 97 | }; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/MioroSubs.js: -------------------------------------------------------------------------------- 1 | import { MioroSubsAPI } from "../../apis/index.js"; 2 | import axios from "axios"; 3 | import { JSDOM, VirtualConsole } from "jsdom"; 4 | const tNFun = (tn) => { 5 | const imgElement = tn; 6 | return imgElement.href; 7 | }; 8 | const virtualConsole = new VirtualConsole(); 9 | virtualConsole.on("error", () => { 10 | // No-op to skip console errors. 11 | }); 12 | export default async function ServiceMioroSubs(anime, episode) { 13 | try { 14 | const response = await axios.get(`https://miorosubs.pl/episodes/${anime}x${episode}`, { 15 | headers: { 16 | Referer: `https://miorosubs.pl/episodes/${anime}x${episode}`, 17 | "X-Requested-With": "XMLHttpRequest", 18 | }, 19 | }); 20 | const dom = new JSDOM(response.data, { virtualConsole }); 21 | const thumbnail = dom.window.document.querySelector(".g-item a"); 22 | const pO = dom.window.document.querySelector("#playeroptionsul"); 23 | let episodes_cleaning = []; 24 | if (!pO) { 25 | return { 26 | status: 500, 27 | message: "Something went wrong!", 28 | }; 29 | } 30 | const items = pO.querySelectorAll("li.dooplay_player_option"); 31 | await Promise.all(Array.from(items).map(async function (x) { 32 | const pT = x.querySelector(".title"); 33 | if (!pT || !pT.textContent) 34 | return; 35 | const data = x; 36 | if (!data || 37 | !data.getAttribute("data-post") || 38 | !data.getAttribute("data-nume") || 39 | !data.getAttribute("data-type")) { 40 | return { 41 | status: 500, 42 | message: "Something went wrong!", 43 | }; 44 | } 45 | const playerInfo = await MioroSubsAPI("doo_player_ajax", x.getAttribute("data-post"), x.getAttribute("data-nume"), x.getAttribute("data-type")); 46 | if (playerInfo.status !== 200 || !playerInfo.player) { 47 | return; 48 | } 49 | episodes_cleaning.push({ 50 | player: pT.textContent, 51 | url: playerInfo.player, 52 | }); 53 | })); 54 | if (episodes_cleaning.length === 0) { 55 | return { 56 | status: 500, 57 | message: "Something went wrong!", 58 | }; 59 | } 60 | return { 61 | status: 200, 62 | message: "Mission Accomplished!", 63 | episode_thumbnail: thumbnail ? tNFun(thumbnail) : null, 64 | episodes: episodes_cleaning, 65 | episode_next_url: Number(episode) + 1, 66 | }; 67 | } 68 | catch (error) { 69 | return { 70 | status: 500, 71 | message: "Something went wrong!", 72 | }; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /dist/mjs/services/wordpress/MakiSubs.js: -------------------------------------------------------------------------------- 1 | import { MakiSubsAPI } from "../../apis/index.js"; 2 | import axios from "axios"; 3 | import { JSDOM, VirtualConsole } from "jsdom"; 4 | const tNFun = (tn) => { 5 | const imgElement = tn; 6 | return imgElement.href; 7 | }; 8 | const virtualConsole = new VirtualConsole(); 9 | virtualConsole.on("error", () => { 10 | // No-op to skip console errors. 11 | }); 12 | export default async function ServiceMakiSubs(anime, episode) { 13 | try { 14 | const response = await axios.get(`https://makisubs.online/episodes/${anime}x${episode}`, { 15 | headers: { 16 | Referer: `https://makisubs.online/episodes/${anime}x${episode}`, 17 | "X-Requested-With": "XMLHttpRequest", 18 | }, 19 | }); 20 | const dom = new JSDOM(response.data, { virtualConsole }); 21 | const thumbnail = dom.window.document.querySelector(".g-item a"); 22 | const pO = dom.window.document.querySelector("#playeroptionsul"); 23 | let episodes_cleaning = []; 24 | if (!pO) { 25 | return { 26 | status: 500, 27 | message: "Something went wrong!", 28 | }; 29 | } 30 | const items = pO.querySelectorAll("li.dooplay_player_option"); 31 | await Promise.all(Array.from(items).map(async function (x) { 32 | const pT = x.querySelector(".title"); 33 | if (!pT || !pT.textContent) 34 | return; 35 | const data = x; 36 | if (!data || 37 | !data.getAttribute("data-post") || 38 | !data.getAttribute("data-nume") || 39 | !data.getAttribute("data-type")) { 40 | return { 41 | status: 500, 42 | message: "Something went wrong!", 43 | }; 44 | } 45 | const playerInfo = await MakiSubsAPI("doo_player_ajax", x.getAttribute("data-post"), x.getAttribute("data-nume"), x.getAttribute("data-type")); 46 | if (playerInfo.status !== 200 || !playerInfo.player) { 47 | return; 48 | } 49 | episodes_cleaning.push({ 50 | player: pT.textContent, 51 | url: playerInfo.player, 52 | }); 53 | })); 54 | if (episodes_cleaning.length === 0) { 55 | return { 56 | status: 500, 57 | message: "Something went wrong!", 58 | }; 59 | } 60 | return { 61 | status: 200, 62 | message: "Mission Accomplished!", 63 | episode_thumbnail: thumbnail ? tNFun(thumbnail) : null, 64 | episodes: episodes_cleaning, 65 | episode_next_url: Number(episode) + 1, 66 | }; 67 | } 68 | catch (error) { 69 | return { 70 | status: 500, 71 | message: "Something went wrong!", 72 | }; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/services/wordpress/DesuOnline.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | //Return Interfaces 5 | interface IPlayer { 6 | player: string; 7 | url: string; 8 | } 9 | 10 | const virtualConsole = new VirtualConsole(); 11 | virtualConsole.on("error", () => { 12 | // No-op to skip console errors. 13 | }); 14 | 15 | export default async function ServiceDesuOnline( 16 | anime: string, 17 | episode: string | number 18 | ): Promise<{ 19 | status: number; 20 | message: string; 21 | episode_thumbnail?: string | null; 22 | episodes?: IPlayer[]; 23 | episode_next_url?: string | number; 24 | }> { 25 | try { 26 | const response: AxiosResponse = await axios.get( 27 | `https://desu-online.pl/${anime}-odcinek-${episode}`, 28 | { 29 | headers: { 30 | Referer: `https://desu-online.pl/${anime}-odcinek-${episode}`, 31 | "X-Requested-With": "XMLHttpRequest", 32 | "User-Agent": 33 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 34 | }, 35 | } 36 | ); 37 | 38 | const dom = new JSDOM(response.data, { virtualConsole }); 39 | const items = dom.window.document.querySelectorAll( 40 | ".mobius select.mirror option" 41 | ); 42 | let episodes_cleaning: IPlayer[] = []; 43 | 44 | await Promise.all( 45 | Array.from(items).map(async function (x: Element) { 46 | const item = x as HTMLOptionElement; 47 | if (!item || !item.textContent || !item.value) { 48 | return; 49 | } 50 | 51 | if (item.textContent.toLowerCase().includes("wybierz")) return; 52 | 53 | const player_url = Buffer.from(item.value, "base64") 54 | .toString("utf8") 55 | .match( 56 | /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim 57 | ); 58 | 59 | if (!player_url) { 60 | return; 61 | } 62 | 63 | const playerURL = 64 | player_url && typeof player_url !== "string" 65 | ? player_url[0] 66 | : player_url; 67 | 68 | episodes_cleaning.push({ 69 | player: item.textContent.toUpperCase().replaceAll("\n", "").trim(), 70 | url: playerURL, 71 | }); 72 | }) 73 | ); 74 | 75 | if (episodes_cleaning.length === 0) { 76 | return { 77 | status: 500, 78 | message: "Something went wrong!", 79 | }; 80 | } 81 | 82 | return { 83 | status: 200, 84 | message: "Mission Accomplished!", 85 | episode_thumbnail: null, 86 | episodes: episodes_cleaning, 87 | episode_next_url: Number(episode) + 1, 88 | }; 89 | } catch (error) { 90 | return { 91 | status: 500, 92 | message: "Something went wrong!", 93 | }; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /dist/cjs/apis/JuniorSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const virtualConsole = new jsdom_1.VirtualConsole(); 18 | virtualConsole.on("error", () => { 19 | // No-op to skip console errors. 20 | }); 21 | function JuniorSubs(category, anime, episode) { 22 | return __awaiter(this, void 0, void 0, function* () { 23 | try { 24 | const response = yield axios_1.default.get(`https://juniorsubs.pl/${category}/${anime}`, { 25 | headers: { 26 | Referer: `https://juniorsubs.pl/${category}/${anime}`, 27 | "X-Requested-With": "XMLHttpRequest", 28 | }, 29 | }); 30 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 31 | const items = dom.window.document.querySelectorAll(".elementor-container .elementor-column.elementor-element .elementor-widget-container .elementor-heading-title "); 32 | const thumbnails = dom.window.document.querySelectorAll(".elementor-container .elementor-column.elementor-element .elementor-widget-wrap .elementor-widget-image .elementor-widget-container"); 33 | let thumbnail = null; 34 | yield Promise.all(Array.from(items).map(function (x, index) { 35 | return __awaiter(this, void 0, void 0, function* () { 36 | if (!x || !x.textContent) 37 | return; 38 | const title = x.textContent.toLowerCase(); 39 | if (!title.includes("odcinek")) 40 | return; 41 | if (episode !== Number(title.replaceAll("odcinek", ""))) 42 | return; 43 | if (!thumbnails || !thumbnails[index - 1]) 44 | return; 45 | const tN = thumbnails[index - 1]; 46 | const tNIMG = tN.querySelector("img"); 47 | thumbnail = tNIMG.src || null; 48 | }); 49 | })); 50 | return { 51 | status: 200, 52 | thumbnail: thumbnail, 53 | }; 54 | } 55 | catch (error) { 56 | return { 57 | status: 500, 58 | }; 59 | } 60 | }); 61 | } 62 | exports.default = JuniorSubs; 63 | -------------------------------------------------------------------------------- /src/services/wordpress/Paldea.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import CompilePlayerData from "../../utils/CompileEpisodeData.js"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const virtualConsole = new VirtualConsole(); 12 | virtualConsole.on("error", () => { 13 | // No-op to skip console errors. 14 | }); 15 | 16 | export default async function ServicePaldea(episode: string | number): Promise<{ 17 | status: number; 18 | message: string; 19 | episode_thumbnail?: string | null; 20 | episodes?: IPlayer[]; 21 | episode_next_url?: string | number | null; 22 | }> { 23 | try { 24 | const response: AxiosResponse = await axios.get( 25 | `https://paldea.pl/odcinek/${episode}`, 26 | { 27 | headers: { 28 | Referer: `https://paldea.pl/odcinek/${episode}`, 29 | "X-Requested-With": "XMLHttpRequest", 30 | "User-Agent": 31 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 32 | }, 33 | } 34 | ); 35 | 36 | const dom = new JSDOM(response.data, { virtualConsole }); 37 | const vC = dom.window.document.querySelectorAll(".video-container"); 38 | const urls = dom.window.document.querySelectorAll( 39 | ".post-content .fusion-layout-column .fusion-column-wrapper a.fusion-button" 40 | ); 41 | let episodes_cleaning: IPlayer[] = []; 42 | let episode_next_url: string | null = null; 43 | 44 | await Promise.all( 45 | Array.from(urls).map(async function (x: Element) { 46 | const item = x as HTMLAnchorElement; 47 | const urlArray = item.href.split("/"); 48 | 49 | if (!urlArray.includes("odcinek")) { 50 | return; 51 | } 52 | 53 | const episodeNumber = 54 | urlArray.length >= 6 ? urlArray[4] : urlArray.pop(); 55 | 56 | if (!episodeNumber || episodeNumber === episode) { 57 | return; 58 | } 59 | 60 | episode_next_url = episodeNumber ?? null; 61 | }) 62 | ); 63 | 64 | await Promise.all( 65 | Array.from(vC).map(async function (x) { 66 | if (!x) return; 67 | 68 | const player = x.querySelector("iframe") as HTMLIFrameElement; 69 | const data = CompilePlayerData(player.src); 70 | 71 | if (!data || !data.player_embed || !data.hosting) { 72 | return; 73 | } 74 | 75 | episodes_cleaning.push({ 76 | player: data.hosting, 77 | url: data.player_embed, 78 | }); 79 | }) 80 | ); 81 | 82 | if (episodes_cleaning.length === 0) { 83 | return { 84 | status: 500, 85 | message: "Something went wrong!", 86 | }; 87 | } 88 | 89 | return { 90 | status: 200, 91 | message: "Mission Accomplished!", 92 | episode_thumbnail: null, 93 | episodes: episodes_cleaning, 94 | episode_next_url: episode_next_url, 95 | }; 96 | } catch (error) { 97 | return { 98 | status: 500, 99 | message: "Something went wrong!", 100 | }; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /dist/cjs/services/OkamiSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const virtualConsole = new jsdom_1.VirtualConsole(); 18 | virtualConsole.on("error", () => { 19 | // No-op to skip console errors. 20 | }); 21 | function ServiceOkamiSubs(anime, episode) { 22 | return __awaiter(this, void 0, void 0, function* () { 23 | try { 24 | const response = yield axios_1.default.get(`https://okami-subs.pl/anime/${anime}/odcinek/${episode}`); 25 | const dom = new jsdom_1.JSDOM(response.data, { 26 | runScripts: "dangerously", 27 | virtualConsole, 28 | }).window; 29 | const okamiData = dom.InitData; 30 | let episode_next_url = null; 31 | let episodes_cleaning = []; 32 | if (!okamiData) { 33 | return { 34 | status: 500, 35 | message: "Something went wrong!", 36 | }; 37 | } 38 | yield Promise.all(okamiData.episode_links.map(function (x) { 39 | return __awaiter(this, void 0, void 0, function* () { 40 | episodes_cleaning.push({ 41 | player: x.player, 42 | url: x.url, 43 | }); 44 | }); 45 | })); 46 | if (dom.document.querySelector(".col-md-4.col-xs-12 .button.pull-right")) { 47 | const item = dom.document.querySelector(".col-md-4.col-xs-12 .button.pull-right"); 48 | if (item) { 49 | episode_next_url = item.href.split("/").pop(); 50 | } 51 | } 52 | if (episodes_cleaning.length === 0) { 53 | return { 54 | status: 500, 55 | message: "Something went wrong!", 56 | }; 57 | } 58 | return { 59 | status: 200, 60 | message: "Mission Accomplished!", 61 | episode_thumbnail: null, 62 | episodes: episodes_cleaning, 63 | episode_next_url: episode_next_url, 64 | }; 65 | } 66 | catch (error) { 67 | return { 68 | status: 500, 69 | message: "Something went wrong!", 70 | }; 71 | } 72 | }); 73 | } 74 | exports.default = ServiceOkamiSubs; 75 | -------------------------------------------------------------------------------- /dist/cjs/services/Fumetsu.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const CompileEpisodeData_js_1 = __importDefault(require("../utils/CompileEpisodeData.js")); 18 | const virtualConsole = new jsdom_1.VirtualConsole(); 19 | virtualConsole.on("error", () => { 20 | // No-op to skip console errors. 21 | }); 22 | function ServiceFumetsu(anime, episode) { 23 | return __awaiter(this, void 0, void 0, function* () { 24 | try { 25 | const response = yield axios_1.default.get(`https://fumetsu.pl/anime/${anime}/${episode}`, { 26 | headers: { 27 | Referer: `https://fumetsu.pl/anime/${anime}/${episode}`, 28 | "X-Requested-With": "XMLHttpRequest", 29 | }, 30 | }); 31 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 32 | const items = dom.window.document.querySelectorAll(".video_cont iframe"); 33 | let episodes_cleaning = []; 34 | if (!items) { 35 | return { 36 | status: 500, 37 | message: "Something went wrong!", 38 | }; 39 | } 40 | yield Promise.all(Array.from(items).map(function (x) { 41 | return __awaiter(this, void 0, void 0, function* () { 42 | const item = x; 43 | const data = (0, CompileEpisodeData_js_1.default)(item.src); 44 | if (!data.hosting || !data.player_embed) { 45 | return; 46 | } 47 | episodes_cleaning.push({ 48 | player: data.hosting, 49 | url: data.player_embed, 50 | }); 51 | }); 52 | })); 53 | if (episodes_cleaning.length === 0) { 54 | return { 55 | status: 500, 56 | message: "Something went wrong!", 57 | }; 58 | } 59 | return { 60 | status: 200, 61 | message: "Mission Accomplished!", 62 | episode_thumbnail: null, 63 | episodes: episodes_cleaning, 64 | episode_next_url: Number(episode) + 1, 65 | }; 66 | } 67 | catch (error) { 68 | return { 69 | status: 500, 70 | message: "Something went wrong!", 71 | }; 72 | } 73 | }); 74 | } 75 | exports.default = ServiceFumetsu; 76 | -------------------------------------------------------------------------------- /src/services/wordpress/MioroSubs.ts: -------------------------------------------------------------------------------- 1 | import { MioroSubsAPI } from "../../apis/index.js"; 2 | import axios, { AxiosResponse } from "axios"; 3 | import { JSDOM, VirtualConsole } from "jsdom"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const tNFun = (tn:Element):string => { 12 | const imgElement = tn as HTMLAnchorElement; 13 | return imgElement.href; 14 | } 15 | 16 | const virtualConsole = new VirtualConsole(); 17 | virtualConsole.on("error", () => { 18 | // No-op to skip console errors. 19 | }); 20 | 21 | export default async function ServiceMioroSubs( 22 | anime: string, 23 | episode: string | number 24 | ): Promise<{ 25 | status: number; 26 | message: string; 27 | episode_thumbnail?: string | null; 28 | episodes?: IPlayer[]; 29 | episode_next_url?: string | number; 30 | }> { 31 | try { 32 | const response: AxiosResponse = await axios.get( 33 | `https://miorosubs.pl/episodes/${anime}x${episode}`, 34 | { 35 | headers: { 36 | Referer: `https://miorosubs.pl/episodes/${anime}x${episode}`, 37 | "X-Requested-With": "XMLHttpRequest", 38 | }, 39 | } 40 | ); 41 | 42 | const dom = new JSDOM(response.data, { virtualConsole }); 43 | const thumbnail = dom.window.document.querySelector(".g-item a"); 44 | const pO = dom.window.document.querySelector("#playeroptionsul"); 45 | let episodes_cleaning: IPlayer[] = []; 46 | 47 | if (!pO) { 48 | return { 49 | status: 500, 50 | message: "Something went wrong!", 51 | }; 52 | } 53 | 54 | const items = pO.querySelectorAll("li.dooplay_player_option"); 55 | 56 | await Promise.all( 57 | Array.from(items).map(async function (x) { 58 | const pT = x.querySelector(".title"); 59 | 60 | if (!pT || !pT.textContent) return; 61 | 62 | const data: Element = x; 63 | 64 | if ( 65 | !data || 66 | !data.getAttribute("data-post") || 67 | !data.getAttribute("data-nume") || 68 | !data.getAttribute("data-type") 69 | ) { 70 | return { 71 | status: 500, 72 | message: "Something went wrong!", 73 | }; 74 | } 75 | 76 | const playerInfo: { 77 | status: number; 78 | player?: string; 79 | } = await MioroSubsAPI( 80 | "doo_player_ajax", 81 | x.getAttribute("data-post") as string, 82 | x.getAttribute("data-nume") as string, 83 | x.getAttribute("data-type") as string 84 | ); 85 | 86 | if (playerInfo.status !== 200 || !playerInfo.player) { 87 | return; 88 | } 89 | 90 | episodes_cleaning.push({ 91 | player: pT.textContent, 92 | url: playerInfo.player, 93 | }); 94 | }) 95 | ); 96 | 97 | if (episodes_cleaning.length === 0) { 98 | return { 99 | status: 500, 100 | message: "Something went wrong!", 101 | }; 102 | } 103 | 104 | return { 105 | status: 200, 106 | message: "Mission Accomplished!", 107 | episode_thumbnail: thumbnail ? tNFun(thumbnail) : null, 108 | episodes: episodes_cleaning, 109 | episode_next_url: Number(episode) + 1, 110 | }; 111 | } catch (error) { 112 | return { 113 | status: 500, 114 | message: "Something went wrong!", 115 | }; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/services/wordpress/MakiSubs.ts: -------------------------------------------------------------------------------- 1 | import { MakiSubsAPI } from "../../apis/index.js"; 2 | import axios, { AxiosResponse } from "axios"; 3 | import { JSDOM, VirtualConsole } from "jsdom"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const tNFun = (tn:Element):string => { 12 | const imgElement = tn as HTMLAnchorElement; 13 | return imgElement.href; 14 | } 15 | 16 | const virtualConsole = new VirtualConsole(); 17 | virtualConsole.on("error", () => { 18 | // No-op to skip console errors. 19 | }); 20 | 21 | export default async function ServiceMakiSubs( 22 | anime: string, 23 | episode: string | number 24 | ): Promise<{ 25 | status: number; 26 | message: string; 27 | episode_thumbnail?: string | null; 28 | episodes?: IPlayer[]; 29 | episode_next_url?: string | number; 30 | }> { 31 | try { 32 | const response: AxiosResponse = await axios.get( 33 | `https://makisubs.online/episodes/${anime}x${episode}`, 34 | { 35 | headers: { 36 | Referer: `https://makisubs.online/episodes/${anime}x${episode}`, 37 | "X-Requested-With": "XMLHttpRequest", 38 | }, 39 | } 40 | ); 41 | 42 | const dom = new JSDOM(response.data, { virtualConsole }); 43 | const thumbnail = dom.window.document.querySelector(".g-item a"); 44 | const pO = dom.window.document.querySelector("#playeroptionsul"); 45 | let episodes_cleaning: IPlayer[] = []; 46 | 47 | if (!pO) { 48 | return { 49 | status: 500, 50 | message: "Something went wrong!", 51 | }; 52 | } 53 | 54 | const items = pO.querySelectorAll("li.dooplay_player_option"); 55 | 56 | await Promise.all( 57 | Array.from(items).map(async function (x) { 58 | const pT = x.querySelector(".title"); 59 | 60 | if (!pT || !pT.textContent) return; 61 | 62 | const data: Element = x; 63 | 64 | if ( 65 | !data || 66 | !data.getAttribute("data-post") || 67 | !data.getAttribute("data-nume") || 68 | !data.getAttribute("data-type") 69 | ) { 70 | return { 71 | status: 500, 72 | message: "Something went wrong!", 73 | }; 74 | } 75 | 76 | const playerInfo: { 77 | status: number; 78 | player?: string; 79 | } = await MakiSubsAPI( 80 | "doo_player_ajax", 81 | x.getAttribute("data-post") as string, 82 | x.getAttribute("data-nume") as string, 83 | x.getAttribute("data-type") as string 84 | ); 85 | 86 | if (playerInfo.status !== 200 || !playerInfo.player) { 87 | return; 88 | } 89 | 90 | episodes_cleaning.push({ 91 | player: pT.textContent, 92 | url: playerInfo.player, 93 | }); 94 | }) 95 | ); 96 | 97 | if (episodes_cleaning.length === 0) { 98 | return { 99 | status: 500, 100 | message: "Something went wrong!", 101 | }; 102 | } 103 | 104 | return { 105 | status: 200, 106 | message: "Mission Accomplished!", 107 | episode_thumbnail: thumbnail ? tNFun(thumbnail) : null, 108 | episodes: episodes_cleaning, 109 | episode_next_url: Number(episode) + 1, 110 | }; 111 | } catch (error) { 112 | return { 113 | status: 500, 114 | message: "Something went wrong!", 115 | }; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/JuniorSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const index_js_1 = require("../../apis/index.js"); 16 | const axios_1 = __importDefault(require("axios")); 17 | const jsdom_1 = require("jsdom"); 18 | const CompileEpisodeData_js_1 = __importDefault(require("../../utils/CompileEpisodeData.js")); 19 | const virtualConsole = new jsdom_1.VirtualConsole(); 20 | virtualConsole.on("error", () => { 21 | // No-op to skip console errors. 22 | }); 23 | function ServiceJuniorSubs(category, anime, episode) { 24 | return __awaiter(this, void 0, void 0, function* () { 25 | try { 26 | const response = yield axios_1.default.get(`https://juniorsubs.pl/${category}/${anime}/odcinek-${episode}`, { 27 | headers: { 28 | Referer: `https://juniorsubs.pl/${category}/${anime}/odcinek-${episode}`, 29 | "X-Requested-With": "XMLHttpRequest", 30 | }, 31 | }); 32 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 33 | const pIframe = dom.window.document.querySelector('.elementor-widget[data-element_type="widget"] .elementor-widget-container iframe'); 34 | if (!pIframe) { 35 | return { 36 | status: 500, 37 | message: "Something went wrong!", 38 | }; 39 | } 40 | const data = (0, CompileEpisodeData_js_1.default)(pIframe.src); 41 | if (!data || 42 | !data.hosting || 43 | !data.player_embed || 44 | new URL(response.request.res.responseUrl).pathname !== 45 | `/${category}/${anime}/odcinek-${episode}/`) { 46 | return { 47 | status: 500, 48 | message: "Something went wrong!", 49 | }; 50 | } 51 | const thumbnail = yield (0, index_js_1.JuniorSubsAPI)(category, anime, Number(episode)); 52 | return { 53 | status: 200, 54 | message: "Mission Accomplished!", 55 | episode_thumbnail: thumbnail && thumbnail.thumbnail ? thumbnail.thumbnail : null, 56 | episodes: [ 57 | { 58 | player: data.hosting, 59 | url: data.player_embed, 60 | }, 61 | ], 62 | episode_next_url: Number(episode) + 1, 63 | }; 64 | } 65 | catch (error) { 66 | return { 67 | status: 500, 68 | message: "Something went wrong!", 69 | }; 70 | } 71 | }); 72 | } 73 | exports.default = ServiceJuniorSubs; 74 | -------------------------------------------------------------------------------- /dist/mjs/utils/CompileEpisodeData.js: -------------------------------------------------------------------------------- 1 | export default function CompilePlayerData(player) { 2 | if (player.includes("https://") || player.includes("http://")) { 3 | const domain = new URL(player); 4 | const host = domain.hostname.replace("www.", "").toLocaleLowerCase(); 5 | const path = domain.pathname; 6 | const query = domain.searchParams; 7 | switch (host) { 8 | case "ebd.cda.pl": 9 | case "m.cda.pl": 10 | case "cda.pl": { 11 | const splitPath = path.split("/"); 12 | const playerID = splitPath[2]; 13 | return { 14 | code: 200, 15 | player_embed: `https://ebd.cda.pl/620x368/${playerID}`, 16 | hosting: "cda", 17 | player_id: playerID, 18 | }; 19 | } 20 | case "mega.nz": 21 | case "mega.io": { 22 | let playerID; 23 | if (!player.replaceAll("#", "!").split("/")[4]) { 24 | const splitPath = player.replaceAll("#", "!").split("/"); 25 | playerID = splitPath[3].replaceAll("embed!!", ""); 26 | } 27 | else { 28 | const splitPath = player.replaceAll("#", "!").split("/"); 29 | playerID = splitPath[4]; 30 | } 31 | return { 32 | code: 200, 33 | player_embed: `https://mega.nz/embed/${playerID}`, 34 | hosting: "mega", 35 | player_id: playerID, 36 | }; 37 | } 38 | case "drive.google.com": { 39 | const splitPath = path.split("/"); 40 | const playerID = splitPath[3]; 41 | return { 42 | code: 200, 43 | player_embed: `https://drive.google.com/file/d/${playerID}/preview`, 44 | hosting: "gdrive", 45 | player_id: playerID, 46 | }; 47 | } 48 | case "video.sibnet.ru": { 49 | const playerID = query.get("videoid"); 50 | return { 51 | code: 200, 52 | player_embed: `https://video.sibnet.ru/shell.php?videoid=${playerID}`, 53 | hosting: "sibnet", 54 | player_id: playerID, 55 | }; 56 | } 57 | case "mp4upload.com": 58 | case "www.mp4upload.com": { 59 | const splitPath = path.split("-"); 60 | const playerID = splitPath.pop(); 61 | return { 62 | code: 200, 63 | player_embed: `https://www.mp4upload.com/embed-${playerID}.html`, 64 | hosting: "mp4upload", 65 | player_id: playerID, 66 | }; 67 | } 68 | case "dailymotion.com": 69 | case "www.dailymotion.com": { 70 | const splitPath = path.split("/"); 71 | const playerID = splitPath.pop(); 72 | return { 73 | code: 200, 74 | player_embed: `https://www.dailymotion.com/embed/video/${playerID}`, 75 | hosting: "dailymotion", 76 | player_id: playerID, 77 | }; 78 | } 79 | default: 80 | return { 81 | code: 501, 82 | }; 83 | } 84 | } 85 | return { 86 | code: 400, 87 | }; 88 | } 89 | -------------------------------------------------------------------------------- /src/utils/CompileEpisodeData.ts: -------------------------------------------------------------------------------- 1 | interface URL { 2 | hash: string; 3 | host: string; 4 | hostname: string; 5 | href: string; 6 | readonly origin: string; 7 | password: string; 8 | pathname: string; 9 | port: string; 10 | protocol: string; 11 | search: string; 12 | username: string; 13 | toString(): string; 14 | searchParams: any; 15 | } 16 | 17 | interface ResponseSource { 18 | code: number; 19 | player_embed?: string; 20 | hosting?: string; 21 | player_id?: string; 22 | } 23 | 24 | export default function CompilePlayerData(player: string): ResponseSource { 25 | if (player.includes("https://") || player.includes("http://")) { 26 | const domain: URL = new URL(player); 27 | const host = domain.hostname.replace("www.", "").toLocaleLowerCase(); 28 | const path = domain.pathname; 29 | const query = domain.searchParams; 30 | 31 | switch (host) { 32 | case "ebd.cda.pl": 33 | case "m.cda.pl": 34 | case "cda.pl": { 35 | const splitPath = path.split("/"); 36 | const playerID = splitPath[2]; 37 | 38 | return { 39 | code: 200, 40 | player_embed: `https://ebd.cda.pl/620x368/${playerID}`, 41 | hosting: "cda", 42 | player_id: playerID, 43 | }; 44 | } 45 | case "mega.nz": 46 | case "mega.io": { 47 | let playerID; 48 | 49 | if (!player.replaceAll("#", "!").split("/")[4]) { 50 | const splitPath = player.replaceAll("#", "!").split("/"); 51 | playerID = splitPath[3].replaceAll("embed!!", ""); 52 | } else { 53 | const splitPath = player.replaceAll("#", "!").split("/"); 54 | playerID = splitPath[4]; 55 | } 56 | 57 | return { 58 | code: 200, 59 | player_embed: `https://mega.nz/embed/${playerID}`, 60 | hosting: "mega", 61 | player_id: playerID, 62 | }; 63 | } 64 | case "drive.google.com": { 65 | const splitPath = path.split("/"); 66 | const playerID = splitPath[3]; 67 | 68 | return { 69 | code: 200, 70 | player_embed: `https://drive.google.com/file/d/${playerID}/preview`, 71 | hosting: "gdrive", 72 | player_id: playerID, 73 | }; 74 | } 75 | case "video.sibnet.ru": { 76 | const playerID = query.get("videoid"); 77 | 78 | return { 79 | code: 200, 80 | player_embed: `https://video.sibnet.ru/shell.php?videoid=${playerID}`, 81 | hosting: "sibnet", 82 | player_id: playerID, 83 | }; 84 | } 85 | case "mp4upload.com": 86 | case "www.mp4upload.com": { 87 | const splitPath = path.split("-"); 88 | const playerID = splitPath.pop(); 89 | 90 | return { 91 | code: 200, 92 | player_embed: `https://www.mp4upload.com/embed-${playerID}.html`, 93 | hosting: "mp4upload", 94 | player_id: playerID, 95 | }; 96 | } 97 | case "dailymotion.com": 98 | case "www.dailymotion.com": { 99 | const splitPath = path.split("/"); 100 | const playerID = splitPath.pop(); 101 | 102 | return { 103 | code: 200, 104 | player_embed: `https://www.dailymotion.com/embed/video/${playerID}`, 105 | hosting: "dailymotion", 106 | player_id: playerID, 107 | }; 108 | } 109 | default: 110 | return { 111 | code: 501, 112 | }; 113 | } 114 | } 115 | 116 | return { 117 | code: 400, 118 | }; 119 | } 120 | -------------------------------------------------------------------------------- /dist/cjs/services/GrupaMirai.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const virtualConsole = new jsdom_1.VirtualConsole(); 18 | virtualConsole.on("error", () => { 19 | // No-op to skip console errors. 20 | }); 21 | function ServiceGrupaMirai(anime, episode) { 22 | return __awaiter(this, void 0, void 0, function* () { 23 | try { 24 | const response = yield axios_1.default.get(`https://www.grupa-mirai.pl/${anime}`, { 25 | headers: { 26 | Referer: `https://www.grupa-mirai.pl/${anime}`, 27 | "X-Requested-With": "XMLHttpRequest", 28 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 29 | }, 30 | }); 31 | const dom = new jsdom_1.JSDOM(response.data, { runScripts: 'dangerously', virtualConsole }); 32 | const cdaPlayer = dom.window.epCda || dom.window.epCDA; 33 | const megaPlayer = dom.window.epMega; 34 | const sibnetPlayer = dom.window.epSibnet; 35 | let episodes_cleaning = []; 36 | if (cdaPlayer && cdaPlayer[episode]) { 37 | episodes_cleaning.push({ 38 | player: "CDA", 39 | url: "https://ebd.cda.pl/620x395/" + cdaPlayer[episode], 40 | }); 41 | } 42 | if (megaPlayer && megaPlayer[episode]) { 43 | episodes_cleaning.push({ 44 | player: "MEGA", 45 | url: "https://mega.nz/embed/" + megaPlayer[episode], 46 | }); 47 | } 48 | if (sibnetPlayer && sibnetPlayer[episode]) { 49 | episodes_cleaning.push({ 50 | player: "SIBNET", 51 | url: "https://video.sibnet.ru/shell.php?videoid=" + sibnetPlayer[episode], 52 | }); 53 | } 54 | if (episodes_cleaning.length === 0) { 55 | return { 56 | status: 500, 57 | message: "Something went wrong!", 58 | }; 59 | } 60 | return { 61 | status: 200, 62 | message: "Mission Accomplished!", 63 | episode_thumbnail: null, 64 | episodes: episodes_cleaning, 65 | episode_next_url: Number(episode) + 1, 66 | }; 67 | } 68 | catch (error) { 69 | return { 70 | status: 500, 71 | message: "Something went wrong!", 72 | }; 73 | } 74 | }); 75 | } 76 | exports.default = ServiceGrupaMirai; 77 | -------------------------------------------------------------------------------- /dist/mjs/services/CDA/Profile.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | const virtualConsole = new VirtualConsole(); 4 | virtualConsole.on("error", () => { 5 | // No-op to skip console errors. 6 | }); 7 | const tNFun = (tn) => { 8 | const imgElement = tn; 9 | return imgElement.src.replaceAll("192x108.jpg", "1280x720.jpg"); 10 | }; 11 | export default async function ServiceCDAProfile(user, keyword, type, spaces, episode) { 12 | try { 13 | const response = await axios.get(`https://www.cda.pl/${user}`, { 14 | headers: { 15 | Referer: `https://www.cda.pl/${user}`, 16 | "X-Requested-With": "XMLHttpRequest", 17 | }, 18 | }); 19 | if (!["spaces", "s0e0"].includes(type)) { 20 | return { 21 | status: 400, 22 | message: "Invalid request type. Only accept (spaces, s0e0) format.", 23 | }; 24 | } 25 | const dom = new JSDOM(response.data, { virtualConsole }); 26 | const thumbnails = dom.window.document.querySelectorAll('.list-when-small.tip .thumbnail.viewList-inline .wrapper-thumb-link .thumbnail-link img.thumb'); 27 | const items = dom.window.document.querySelectorAll('.list-when-small.tip .thumbnail.viewList-inline .caption .caption-label'); 28 | let episodes_cleaning = []; 29 | await Promise.all(Array.from(items).map(function (x, index) { 30 | const pT = x.querySelector("a"); 31 | if (!pT || !pT.textContent || !pT.href) 32 | return; 33 | if (!pT.textContent.includes(keyword)) 34 | return; 35 | const tN = thumbnails[index]; 36 | if (type.toLowerCase() === "spaces") { 37 | const player_title = Number(pT.textContent.split(" ")[spaces]); 38 | /* Checking if the episode number is the same as the one you are looking for. */ 39 | if (player_title !== Number(episode)) 40 | return; 41 | /* Pushing the url to the array. */ 42 | return episodes_cleaning.push({ 43 | player: "CDA", 44 | url: `https://www.cda.pl${pT.href}`, 45 | episode_thumbnail: tN ? tNFun(tN) : null, 46 | }); 47 | } 48 | if (type.toLowerCase() === "s0e0") { 49 | const player_title = Number(pT.textContent 50 | .split(" ")[spaces].replace(/[A-Za-z]/g, " ") 51 | .split(" ")[2]); 52 | /* Checking if the episode number is the same as the one you are looking for. */ 53 | if (player_title !== Number(episode)) 54 | return; 55 | /* Pushing the url to the array. */ 56 | return episodes_cleaning.push({ 57 | player: "CDA", 58 | url: `https://www.cda.pl${pT.href}`, 59 | episode_thumbnail: tN ? tNFun(tN) : null, 60 | }); 61 | } 62 | return; 63 | })); 64 | if (episodes_cleaning.length === 0) { 65 | return { 66 | status: 500, 67 | message: "Something went wrong!", 68 | }; 69 | } 70 | return { 71 | status: 200, 72 | message: "Mission Accomplished!", 73 | episodes: episodes_cleaning, 74 | episode_next_url: Number(episode) + 1, 75 | }; 76 | } 77 | catch (error) { 78 | return { 79 | status: 500, 80 | message: "Something went wrong!", 81 | }; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /dist/cjs/utils/CompileEpisodeData.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | function CompilePlayerData(player) { 4 | if (player.includes("https://") || player.includes("http://")) { 5 | const domain = new URL(player); 6 | const host = domain.hostname.replace("www.", "").toLocaleLowerCase(); 7 | const path = domain.pathname; 8 | const query = domain.searchParams; 9 | switch (host) { 10 | case "ebd.cda.pl": 11 | case "m.cda.pl": 12 | case "cda.pl": { 13 | const splitPath = path.split("/"); 14 | const playerID = splitPath[2]; 15 | return { 16 | code: 200, 17 | player_embed: `https://ebd.cda.pl/620x368/${playerID}`, 18 | hosting: "cda", 19 | player_id: playerID, 20 | }; 21 | } 22 | case "mega.nz": 23 | case "mega.io": { 24 | let playerID; 25 | if (!player.replaceAll("#", "!").split("/")[4]) { 26 | const splitPath = player.replaceAll("#", "!").split("/"); 27 | playerID = splitPath[3].replaceAll("embed!!", ""); 28 | } 29 | else { 30 | const splitPath = player.replaceAll("#", "!").split("/"); 31 | playerID = splitPath[4]; 32 | } 33 | return { 34 | code: 200, 35 | player_embed: `https://mega.nz/embed/${playerID}`, 36 | hosting: "mega", 37 | player_id: playerID, 38 | }; 39 | } 40 | case "drive.google.com": { 41 | const splitPath = path.split("/"); 42 | const playerID = splitPath[3]; 43 | return { 44 | code: 200, 45 | player_embed: `https://drive.google.com/file/d/${playerID}/preview`, 46 | hosting: "gdrive", 47 | player_id: playerID, 48 | }; 49 | } 50 | case "video.sibnet.ru": { 51 | const playerID = query.get("videoid"); 52 | return { 53 | code: 200, 54 | player_embed: `https://video.sibnet.ru/shell.php?videoid=${playerID}`, 55 | hosting: "sibnet", 56 | player_id: playerID, 57 | }; 58 | } 59 | case "mp4upload.com": 60 | case "www.mp4upload.com": { 61 | const splitPath = path.split("-"); 62 | const playerID = splitPath.pop(); 63 | return { 64 | code: 200, 65 | player_embed: `https://www.mp4upload.com/embed-${playerID}.html`, 66 | hosting: "mp4upload", 67 | player_id: playerID, 68 | }; 69 | } 70 | case "dailymotion.com": 71 | case "www.dailymotion.com": { 72 | const splitPath = path.split("/"); 73 | const playerID = splitPath.pop(); 74 | return { 75 | code: 200, 76 | player_embed: `https://www.dailymotion.com/embed/video/${playerID}`, 77 | hosting: "dailymotion", 78 | player_id: playerID, 79 | }; 80 | } 81 | default: 82 | return { 83 | code: 501, 84 | }; 85 | } 86 | } 87 | return { 88 | code: 400, 89 | }; 90 | } 91 | exports.default = CompilePlayerData; 92 | -------------------------------------------------------------------------------- /dist/cjs/services/KathSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const CompileEpisodeData_js_1 = __importDefault(require("../utils/CompileEpisodeData.js")); 18 | const virtualConsole = new jsdom_1.VirtualConsole(); 19 | virtualConsole.on("error", () => { 20 | // No-op to skip console errors. 21 | }); 22 | function ServiceKathSubs(anime, episode) { 23 | return __awaiter(this, void 0, void 0, function* () { 24 | try { 25 | const response = yield axios_1.default.get(`https://kathsubs.blogspot.com/p/${anime}.html`, { 26 | headers: { 27 | Referer: `https://kathsubs.blogspot.com/p/${anime}.html`, 28 | "X-Requested-With": "XMLHttpRequest", 29 | }, 30 | }); 31 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 32 | const items = dom.window.document.querySelectorAll(".post-body.entry-content span"); 33 | let episodes_cleaning = []; 34 | if (!items) { 35 | return { 36 | status: 500, 37 | message: "Something went wrong!", 38 | }; 39 | } 40 | yield Promise.all(Array.from(items).map(function (x) { 41 | if (!x || !x.textContent) 42 | return; 43 | const link = x.querySelector("a"); 44 | const text = x.textContent; 45 | const episodeNumber = text.match(/(\d+)/); 46 | if (!link || !episodeNumber) 47 | return; 48 | const data = (0, CompileEpisodeData_js_1.default)(link.href); 49 | if (!data.hosting || !data.player_embed) 50 | return; 51 | if (Number(episodeNumber[0]) === Number(episode)) { 52 | episodes_cleaning.push({ 53 | player: data.hosting, 54 | url: data.player_embed, 55 | }); 56 | } 57 | })); 58 | if (episodes_cleaning.length === 0) { 59 | return { 60 | status: 500, 61 | message: "Something went wrong!", 62 | }; 63 | } 64 | return { 65 | status: 200, 66 | message: "Mission Accomplished!", 67 | episode_thumbnail: null, 68 | episodes: episodes_cleaning, 69 | episode_next_url: Number(episode) + 1, 70 | }; 71 | } 72 | catch (error) { 73 | return { 74 | status: 500, 75 | message: "Something went wrong!", 76 | }; 77 | } 78 | }); 79 | } 80 | exports.default = ServiceKathSubs; 81 | -------------------------------------------------------------------------------- /dist/mjs/services/Wbijam.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import { WbijamAPI } from "../apis/index.js"; 4 | const virtualConsole = new VirtualConsole(); 5 | virtualConsole.on("error", () => { 6 | // No-op to skip console errors. 7 | }); 8 | export default async function ServiceWbijam(anime, episode) { 9 | try { 10 | const response = await axios.get(`https://${anime}.wbijam.pl/${episode}.html`, { 11 | headers: { 12 | Referer: `https://${anime}.wbijam.pl/${episode}.html`, 13 | "X-Requested-With": "XMLHttpRequest", 14 | }, 15 | }); 16 | const dom = new JSDOM(response.data, { virtualConsole }); 17 | const items = dom.window.document.querySelectorAll("tr.lista_hover"); 18 | const nextEpisodeButton = dom.window.document.querySelector(".nawigacja_prawa a"); 19 | const episode_next_url = nextEpisodeButton ? nextEpisodeButton.href : null; 20 | const tURL = dom.window.document.querySelector(`a[rel="galeria"]`); 21 | const thumbnail = tURL ? `https://${anime}.wbijam.pl/${tURL.href}` : null; 22 | let episodes_cleaning = []; 23 | if (!items) { 24 | return { 25 | status: 500, 26 | message: "Something went wrong!", 27 | }; 28 | } 29 | const iArray = Array.from(items); 30 | if (iArray.length === 0 && 31 | !dom.window.document.querySelector(".pod_naglowek")) 32 | return { 33 | status: 500, 34 | message: "Something went wrong!", 35 | }; 36 | if (iArray.length === 0 && 37 | dom.window.document.querySelector(".pod_naglowek")) 38 | return { 39 | status: 204, 40 | message: "Page loads but doesn't have any players.", 41 | }; 42 | const iArrayElement = iArray[0]; 43 | const iArrayURL = iArrayElement.textContent; 44 | if (iArray.length === 1 && 45 | iArrayElement && 46 | iArrayURL && 47 | iArrayURL.includes("zwiastun")) 48 | return { 49 | status: 500, 50 | message: "Something went wrong!", 51 | }; 52 | await Promise.all(Array.from(items).map(async function (x) { 53 | if (!x) 54 | return; 55 | const pURL = x.querySelector(".odtwarzacz_link"); 56 | const pNAMES = x.querySelectorAll("td.center"); 57 | if (!pURL || !pNAMES || pNAMES.length <= 1 || !pNAMES[2].textContent) 58 | return; 59 | const player_info = { 60 | anime: anime, 61 | slug: pURL.getAttribute("rel"), 62 | player_name: pNAMES[2].textContent, 63 | }; 64 | if (player_info.player_name.toLowerCase() === "vk") 65 | return; 66 | const requestPlayer = await WbijamAPI(player_info); 67 | if (!requestPlayer || !requestPlayer.player) 68 | return; 69 | episodes_cleaning.push({ 70 | player: player_info.player_name, 71 | url: requestPlayer.player, 72 | }); 73 | })); 74 | if (episodes_cleaning.length === 0) { 75 | return { 76 | status: 500, 77 | message: "Something went wrong!", 78 | }; 79 | } 80 | return { 81 | status: 200, 82 | message: "Mission Accomplished!", 83 | episode_thumbnail: thumbnail, 84 | episodes: episodes_cleaning, 85 | episode_next_url: episode_next_url, 86 | }; 87 | } 88 | catch (error) { 89 | return { 90 | status: 500, 91 | message: "Something went wrong!", 92 | }; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /dist/cjs/services/ReikoProject.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const CompileEpisodeData_js_1 = __importDefault(require("../utils/CompileEpisodeData.js")); 18 | const virtualConsole = new jsdom_1.VirtualConsole(); 19 | virtualConsole.on("error", () => { 20 | // No-op to skip console errors. 21 | }); 22 | function ServiceReikoProject(anime, episode) { 23 | return __awaiter(this, void 0, void 0, function* () { 24 | try { 25 | const response = yield axios_1.default.get(`https://reikoproject.blogspot.com/${anime}.html`, { 26 | headers: { 27 | Referer: `https://reikoproject.blogspot.com/${anime}.html`, 28 | "X-Requested-With": "XMLHttpRequest", 29 | }, 30 | }); 31 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 32 | const items = dom.window.document.querySelectorAll(`div[style='font-family: "times new roman";'] i b`); 33 | let episodes_cleaning = []; 34 | if (!items) { 35 | return { 36 | status: 500, 37 | message: "Something went wrong!", 38 | }; 39 | } 40 | yield Promise.all(Array.from(items).map(function (x) { 41 | if (!x || !x.textContent || !x.querySelector("a")) 42 | return; 43 | const text = x.textContent; 44 | const link = x.querySelector("a"); 45 | const episodeNumber = text.match(/(\d+)/); 46 | if (!link || !episodeNumber) 47 | return; 48 | const data = (0, CompileEpisodeData_js_1.default)(link.href); 49 | if (!data.hosting || !data.player_embed) { 50 | return; 51 | } 52 | const defineNumber = Number(episodeNumber === null ? 9999 : episodeNumber[0]); 53 | if (defineNumber === Number(episode)) { 54 | episodes_cleaning.push({ 55 | player: data.hosting, 56 | url: data.player_embed, 57 | }); 58 | } 59 | })); 60 | if (episodes_cleaning.length === 0) { 61 | return { 62 | status: 500, 63 | message: "Something went wrong!", 64 | }; 65 | } 66 | return { 67 | status: 200, 68 | message: "Mission Accomplished!", 69 | episode_thumbnail: null, 70 | episodes: episodes_cleaning, 71 | episode_next_url: Number(episode) + 1, 72 | }; 73 | } 74 | catch (error) { 75 | return { 76 | status: 500, 77 | message: "Something went wrong!", 78 | }; 79 | } 80 | }); 81 | } 82 | exports.default = ServiceReikoProject; 83 | -------------------------------------------------------------------------------- /dist/cjs/services/NanaSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const virtualConsole = new jsdom_1.VirtualConsole(); 18 | virtualConsole.on("error", () => { 19 | // No-op to skip console errors. 20 | }); 21 | function ServiceNanaSubs(anime, episode) { 22 | return __awaiter(this, void 0, void 0, function* () { 23 | try { 24 | const response = yield axios_1.default.get(`https://nanasubs.com/anime/${anime}/odcinek-${episode}`, { 25 | headers: { 26 | Referer: `https://nanasubs.com/anime/${anime}/odcinek-${episode}`, 27 | "X-Requested-With": "XMLHttpRequest", 28 | }, 29 | }); 30 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 31 | const nanaArray = dom.window.document.querySelectorAll(`script[type="application/ld+json"]`); 32 | const items = dom.window.document.querySelectorAll(".ns-episode-players-option"); 33 | let episodes_cleaning = []; 34 | if (!items || !nanaArray) { 35 | return { 36 | status: 500, 37 | message: "Something went wrong!", 38 | }; 39 | } 40 | const nD = Array.from(nanaArray); 41 | if (!nD || nD.length <= 1 || !nD[1].textContent) { 42 | return { 43 | status: 500, 44 | message: "Something went wrong!", 45 | }; 46 | } 47 | const nanaData = JSON.parse(nD[1].textContent); 48 | yield Promise.all(Array.from(items).map(function (x) { 49 | return __awaiter(this, void 0, void 0, function* () { 50 | if (!x || 51 | !x.getAttribute("data-player") || 52 | !x.getAttribute("data-player-url")) { 53 | return; 54 | } 55 | episodes_cleaning.push({ 56 | player: x.getAttribute("data-player"), 57 | url: x.getAttribute("data-player-url"), 58 | }); 59 | }); 60 | })); 61 | if (episodes_cleaning.length === 0) { 62 | return { 63 | status: 500, 64 | message: "Something went wrong!", 65 | }; 66 | } 67 | return { 68 | status: 200, 69 | message: "Mission Accomplished!", 70 | episode_thumbnail: nanaData.thumbnailUrl || null, 71 | episodes: episodes_cleaning, 72 | episode_next_url: Number(episode) + 1, 73 | }; 74 | } 75 | catch (error) { 76 | return { 77 | status: 500, 78 | message: "Something went wrong!", 79 | }; 80 | } 81 | }); 82 | } 83 | exports.default = ServiceNanaSubs; 84 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/DesuOnline.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const virtualConsole = new jsdom_1.VirtualConsole(); 18 | virtualConsole.on("error", () => { 19 | // No-op to skip console errors. 20 | }); 21 | function ServiceDesuOnline(anime, episode) { 22 | return __awaiter(this, void 0, void 0, function* () { 23 | try { 24 | const response = yield axios_1.default.get(`https://desu-online.pl/${anime}-odcinek-${episode}`, { 25 | headers: { 26 | Referer: `https://desu-online.pl/${anime}-odcinek-${episode}`, 27 | "X-Requested-With": "XMLHttpRequest", 28 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 29 | }, 30 | }); 31 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 32 | const items = dom.window.document.querySelectorAll(".mobius select.mirror option"); 33 | let episodes_cleaning = []; 34 | yield Promise.all(Array.from(items).map(function (x) { 35 | return __awaiter(this, void 0, void 0, function* () { 36 | const item = x; 37 | if (!item || !item.textContent || !item.value) { 38 | return; 39 | } 40 | if (item.textContent.toLowerCase().includes("wybierz")) 41 | return; 42 | const player_url = Buffer.from(item.value, "base64") 43 | .toString("utf8") 44 | .match(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim); 45 | if (!player_url) { 46 | return; 47 | } 48 | const playerURL = player_url && typeof player_url !== "string" 49 | ? player_url[0] 50 | : player_url; 51 | episodes_cleaning.push({ 52 | player: item.textContent.toUpperCase().replaceAll("\n", "").trim(), 53 | url: playerURL, 54 | }); 55 | }); 56 | })); 57 | if (episodes_cleaning.length === 0) { 58 | return { 59 | status: 500, 60 | message: "Something went wrong!", 61 | }; 62 | } 63 | return { 64 | status: 200, 65 | message: "Mission Accomplished!", 66 | episode_thumbnail: null, 67 | episodes: episodes_cleaning, 68 | episode_next_url: Number(episode) + 1, 69 | }; 70 | } 71 | catch (error) { 72 | return { 73 | status: 500, 74 | message: "Something went wrong!", 75 | }; 76 | } 77 | }); 78 | } 79 | exports.default = ServiceDesuOnline; 80 | -------------------------------------------------------------------------------- /src/services/CDA/Profile.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | 4 | //Return Interfaces 5 | interface IPlayer { 6 | player: string; 7 | url: string; 8 | episode_number?: number; 9 | episode_thumbnail?: string | null; 10 | } 11 | 12 | const virtualConsole = new VirtualConsole(); 13 | virtualConsole.on("error", () => { 14 | // No-op to skip console errors. 15 | }); 16 | 17 | const tNFun = (tn:Element):string => { 18 | const imgElement = tn as HTMLImageElement; 19 | return imgElement.src.replaceAll("192x108.jpg", "1280x720.jpg"); 20 | } 21 | 22 | export default async function ServiceCDAProfile( 23 | user: string, 24 | keyword: string, 25 | type: string, 26 | spaces: number, 27 | episode: number | string 28 | ): Promise<{ 29 | status: number; 30 | message: string; 31 | episode_thumbnail?: string | null; 32 | episodes?: IPlayer[]; 33 | episode_next_url?: string | number; 34 | }> { 35 | try { 36 | const response: AxiosResponse = await axios.get( 37 | `https://www.cda.pl/${user}`, 38 | { 39 | headers: { 40 | Referer: `https://www.cda.pl/${user}`, 41 | "X-Requested-With": "XMLHttpRequest", 42 | }, 43 | } 44 | ); 45 | 46 | if (!["spaces", "s0e0"].includes(type)) { 47 | return { 48 | status: 400, 49 | message: "Invalid request type. Only accept (spaces, s0e0) format.", 50 | }; 51 | } 52 | 53 | const dom = new JSDOM(response.data, { virtualConsole }); 54 | const thumbnails = dom.window.document.querySelectorAll('.list-when-small.tip .thumbnail.viewList-inline .wrapper-thumb-link .thumbnail-link img.thumb'); 55 | const items = dom.window.document.querySelectorAll('.list-when-small.tip .thumbnail.viewList-inline .caption .caption-label'); 56 | 57 | let episodes_cleaning: IPlayer[] = []; 58 | 59 | await Promise.all( 60 | Array.from(items).map(function (x, index) { 61 | const pT = x.querySelector("a"); 62 | if (!pT || !pT.textContent || !pT.href) return; 63 | 64 | if(!pT.textContent.includes(keyword)) return; 65 | 66 | const tN = thumbnails[index]; 67 | 68 | if (type.toLowerCase() === "spaces") { 69 | const player_title = Number(pT.textContent.split(" ")[spaces]); 70 | 71 | /* Checking if the episode number is the same as the one you are looking for. */ 72 | if (player_title !== Number(episode)) return; 73 | 74 | /* Pushing the url to the array. */ 75 | return episodes_cleaning.push({ 76 | player: "CDA", 77 | url: `https://www.cda.pl${pT.href}`, 78 | episode_thumbnail: tN ? tNFun(tN) : null, 79 | }); 80 | } 81 | 82 | if (type.toLowerCase() === "s0e0") { 83 | const player_title = Number( 84 | pT.textContent 85 | .split(" ") 86 | [spaces].replace(/[A-Za-z]/g, " ") 87 | .split(" ")[2] 88 | ); 89 | 90 | /* Checking if the episode number is the same as the one you are looking for. */ 91 | if (player_title !== Number(episode)) return; 92 | 93 | /* Pushing the url to the array. */ 94 | return episodes_cleaning.push({ 95 | player: "CDA", 96 | url: `https://www.cda.pl${pT.href}`, 97 | episode_thumbnail: tN ? tNFun(tN) : null, 98 | }); 99 | } 100 | 101 | return; 102 | }) 103 | ); 104 | 105 | if (episodes_cleaning.length === 0) { 106 | return { 107 | status: 500, 108 | message: "Something went wrong!", 109 | }; 110 | } 111 | 112 | return { 113 | status: 200, 114 | message: "Mission Accomplished!", 115 | episodes: episodes_cleaning, 116 | episode_next_url: Number(episode) + 1, 117 | }; 118 | 119 | } catch (error) { 120 | return { 121 | status: 500, 122 | message: "Something went wrong!", 123 | }; 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/services/Wbijam.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | import { JSDOM, VirtualConsole } from "jsdom"; 3 | import { WbijamAPI } from "../apis/index.js"; 4 | 5 | //Return Interfaces 6 | interface IPlayer { 7 | player: string; 8 | url: string; 9 | } 10 | 11 | const virtualConsole = new VirtualConsole(); 12 | virtualConsole.on("error", () => { 13 | // No-op to skip console errors. 14 | }); 15 | 16 | export default async function ServiceWbijam( 17 | anime: string, 18 | episode: string | number 19 | ): Promise<{ 20 | status: number; 21 | message: string; 22 | episode_thumbnail?: string | null; 23 | episodes?: IPlayer[]; 24 | episode_next_url?: string | number | null; 25 | }> { 26 | try { 27 | const response: AxiosResponse = await axios.get( 28 | `https://${anime}.wbijam.pl/${episode}.html`, 29 | { 30 | headers: { 31 | Referer: `https://${anime}.wbijam.pl/${episode}.html`, 32 | "X-Requested-With": "XMLHttpRequest", 33 | }, 34 | } 35 | ); 36 | 37 | const dom = new JSDOM(response.data, { virtualConsole }); 38 | const items = dom.window.document.querySelectorAll("tr.lista_hover"); 39 | const nextEpisodeButton = dom.window.document.querySelector( 40 | ".nawigacja_prawa a" 41 | ) as HTMLAnchorElement; 42 | const episode_next_url = nextEpisodeButton ? nextEpisodeButton.href : null; 43 | const tURL = dom.window.document.querySelector( 44 | `a[rel="galeria"]` 45 | ) as HTMLAnchorElement; 46 | const thumbnail = tURL ? `https://${anime}.wbijam.pl/${tURL.href}` : null; 47 | 48 | let episodes_cleaning: IPlayer[] = []; 49 | 50 | if (!items) { 51 | return { 52 | status: 500, 53 | message: "Something went wrong!", 54 | }; 55 | } 56 | 57 | const iArray = Array.from(items); 58 | 59 | if ( 60 | iArray.length === 0 && 61 | !dom.window.document.querySelector(".pod_naglowek") 62 | ) 63 | return { 64 | status: 500, 65 | message: "Something went wrong!", 66 | }; 67 | if ( 68 | iArray.length === 0 && 69 | dom.window.document.querySelector(".pod_naglowek") 70 | ) 71 | return { 72 | status: 204, 73 | message: "Page loads but doesn't have any players.", 74 | }; 75 | 76 | const iArrayElement = iArray[0]; 77 | const iArrayURL = iArrayElement.textContent; 78 | if ( 79 | iArray.length === 1 && 80 | iArrayElement && 81 | iArrayURL && 82 | iArrayURL.includes("zwiastun") 83 | ) 84 | return { 85 | status: 500, 86 | message: "Something went wrong!", 87 | }; 88 | 89 | await Promise.all( 90 | Array.from(items).map(async function (x: Element) { 91 | if (!x) return; 92 | 93 | const pURL = x.querySelector(".odtwarzacz_link"); 94 | const pNAMES = x.querySelectorAll("td.center"); 95 | 96 | if (!pURL || !pNAMES || pNAMES.length <= 1 || !pNAMES[2].textContent) 97 | return; 98 | 99 | const player_info = { 100 | anime: anime, 101 | slug: pURL.getAttribute("rel") as string, 102 | player_name: pNAMES[2].textContent as string, 103 | }; 104 | 105 | if (player_info.player_name.toLowerCase() === "vk") return; 106 | 107 | const requestPlayer = await WbijamAPI(player_info); 108 | 109 | if (!requestPlayer || !requestPlayer.player) return; 110 | 111 | episodes_cleaning.push({ 112 | player: player_info.player_name, 113 | url: requestPlayer.player, 114 | }); 115 | }) 116 | ); 117 | 118 | if (episodes_cleaning.length === 0) { 119 | return { 120 | status: 500, 121 | message: "Something went wrong!", 122 | }; 123 | } 124 | 125 | return { 126 | status: 200, 127 | message: "Mission Accomplished!", 128 | episode_thumbnail: thumbnail, 129 | episodes: episodes_cleaning, 130 | episode_next_url: episode_next_url, 131 | }; 132 | } catch (error) { 133 | return { 134 | status: 500, 135 | message: "Something went wrong!", 136 | }; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/MakiSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const index_js_1 = require("../../apis/index.js"); 16 | const axios_1 = __importDefault(require("axios")); 17 | const jsdom_1 = require("jsdom"); 18 | const tNFun = (tn) => { 19 | const imgElement = tn; 20 | return imgElement.href; 21 | }; 22 | const virtualConsole = new jsdom_1.VirtualConsole(); 23 | virtualConsole.on("error", () => { 24 | // No-op to skip console errors. 25 | }); 26 | function ServiceMakiSubs(anime, episode) { 27 | return __awaiter(this, void 0, void 0, function* () { 28 | try { 29 | const response = yield axios_1.default.get(`https://makisubs.online/episodes/${anime}x${episode}`, { 30 | headers: { 31 | Referer: `https://makisubs.online/episodes/${anime}x${episode}`, 32 | "X-Requested-With": "XMLHttpRequest", 33 | }, 34 | }); 35 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 36 | const thumbnail = dom.window.document.querySelector(".g-item a"); 37 | const pO = dom.window.document.querySelector("#playeroptionsul"); 38 | let episodes_cleaning = []; 39 | if (!pO) { 40 | return { 41 | status: 500, 42 | message: "Something went wrong!", 43 | }; 44 | } 45 | const items = pO.querySelectorAll("li.dooplay_player_option"); 46 | yield Promise.all(Array.from(items).map(function (x) { 47 | return __awaiter(this, void 0, void 0, function* () { 48 | const pT = x.querySelector(".title"); 49 | if (!pT || !pT.textContent) 50 | return; 51 | const data = x; 52 | if (!data || 53 | !data.getAttribute("data-post") || 54 | !data.getAttribute("data-nume") || 55 | !data.getAttribute("data-type")) { 56 | return { 57 | status: 500, 58 | message: "Something went wrong!", 59 | }; 60 | } 61 | const playerInfo = yield (0, index_js_1.MakiSubsAPI)("doo_player_ajax", x.getAttribute("data-post"), x.getAttribute("data-nume"), x.getAttribute("data-type")); 62 | if (playerInfo.status !== 200 || !playerInfo.player) { 63 | return; 64 | } 65 | episodes_cleaning.push({ 66 | player: pT.textContent, 67 | url: playerInfo.player, 68 | }); 69 | }); 70 | })); 71 | if (episodes_cleaning.length === 0) { 72 | return { 73 | status: 500, 74 | message: "Something went wrong!", 75 | }; 76 | } 77 | return { 78 | status: 200, 79 | message: "Mission Accomplished!", 80 | episode_thumbnail: thumbnail ? tNFun(thumbnail) : null, 81 | episodes: episodes_cleaning, 82 | episode_next_url: Number(episode) + 1, 83 | }; 84 | } 85 | catch (error) { 86 | return { 87 | status: 500, 88 | message: "Something went wrong!", 89 | }; 90 | } 91 | }); 92 | } 93 | exports.default = ServiceMakiSubs; 94 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/MioroSubs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const index_js_1 = require("../../apis/index.js"); 16 | const axios_1 = __importDefault(require("axios")); 17 | const jsdom_1 = require("jsdom"); 18 | const tNFun = (tn) => { 19 | const imgElement = tn; 20 | return imgElement.href; 21 | }; 22 | const virtualConsole = new jsdom_1.VirtualConsole(); 23 | virtualConsole.on("error", () => { 24 | // No-op to skip console errors. 25 | }); 26 | function ServiceMioroSubs(anime, episode) { 27 | return __awaiter(this, void 0, void 0, function* () { 28 | try { 29 | const response = yield axios_1.default.get(`https://miorosubs.pl/episodes/${anime}x${episode}`, { 30 | headers: { 31 | Referer: `https://miorosubs.pl/episodes/${anime}x${episode}`, 32 | "X-Requested-With": "XMLHttpRequest", 33 | }, 34 | }); 35 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 36 | const thumbnail = dom.window.document.querySelector(".g-item a"); 37 | const pO = dom.window.document.querySelector("#playeroptionsul"); 38 | let episodes_cleaning = []; 39 | if (!pO) { 40 | return { 41 | status: 500, 42 | message: "Something went wrong!", 43 | }; 44 | } 45 | const items = pO.querySelectorAll("li.dooplay_player_option"); 46 | yield Promise.all(Array.from(items).map(function (x) { 47 | return __awaiter(this, void 0, void 0, function* () { 48 | const pT = x.querySelector(".title"); 49 | if (!pT || !pT.textContent) 50 | return; 51 | const data = x; 52 | if (!data || 53 | !data.getAttribute("data-post") || 54 | !data.getAttribute("data-nume") || 55 | !data.getAttribute("data-type")) { 56 | return { 57 | status: 500, 58 | message: "Something went wrong!", 59 | }; 60 | } 61 | const playerInfo = yield (0, index_js_1.MioroSubsAPI)("doo_player_ajax", x.getAttribute("data-post"), x.getAttribute("data-nume"), x.getAttribute("data-type")); 62 | if (playerInfo.status !== 200 || !playerInfo.player) { 63 | return; 64 | } 65 | episodes_cleaning.push({ 66 | player: pT.textContent, 67 | url: playerInfo.player, 68 | }); 69 | }); 70 | })); 71 | if (episodes_cleaning.length === 0) { 72 | return { 73 | status: 500, 74 | message: "Something went wrong!", 75 | }; 76 | } 77 | return { 78 | status: 200, 79 | message: "Mission Accomplished!", 80 | episode_thumbnail: thumbnail ? tNFun(thumbnail) : null, 81 | episodes: episodes_cleaning, 82 | episode_next_url: Number(episode) + 1, 83 | }; 84 | } 85 | catch (error) { 86 | return { 87 | status: 500, 88 | message: "Something went wrong!", 89 | }; 90 | } 91 | }); 92 | } 93 | exports.default = ServiceMioroSubs; 94 | -------------------------------------------------------------------------------- /dist/cjs/services/wordpress/Paldea.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importDefault = (this && this.__importDefault) || function (mod) { 12 | return (mod && mod.__esModule) ? mod : { "default": mod }; 13 | }; 14 | Object.defineProperty(exports, "__esModule", { value: true }); 15 | const axios_1 = __importDefault(require("axios")); 16 | const jsdom_1 = require("jsdom"); 17 | const CompileEpisodeData_js_1 = __importDefault(require("../../utils/CompileEpisodeData.js")); 18 | const virtualConsole = new jsdom_1.VirtualConsole(); 19 | virtualConsole.on("error", () => { 20 | // No-op to skip console errors. 21 | }); 22 | function ServicePaldea(episode) { 23 | return __awaiter(this, void 0, void 0, function* () { 24 | try { 25 | const response = yield axios_1.default.get(`https://paldea.pl/odcinek/${episode}`, { 26 | headers: { 27 | Referer: `https://paldea.pl/odcinek/${episode}`, 28 | "X-Requested-With": "XMLHttpRequest", 29 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 30 | }, 31 | }); 32 | const dom = new jsdom_1.JSDOM(response.data, { virtualConsole }); 33 | const vC = dom.window.document.querySelectorAll(".video-container"); 34 | const urls = dom.window.document.querySelectorAll(".post-content .fusion-layout-column .fusion-column-wrapper a.fusion-button"); 35 | let episodes_cleaning = []; 36 | let episode_next_url = null; 37 | yield Promise.all(Array.from(urls).map(function (x) { 38 | return __awaiter(this, void 0, void 0, function* () { 39 | const item = x; 40 | const urlArray = item.href.split("/"); 41 | if (!urlArray.includes("odcinek")) { 42 | return; 43 | } 44 | const episodeNumber = urlArray.length >= 6 ? urlArray[4] : urlArray.pop(); 45 | if (!episodeNumber || episodeNumber === episode) { 46 | return; 47 | } 48 | episode_next_url = episodeNumber !== null && episodeNumber !== void 0 ? episodeNumber : null; 49 | }); 50 | })); 51 | yield Promise.all(Array.from(vC).map(function (x) { 52 | return __awaiter(this, void 0, void 0, function* () { 53 | if (!x) 54 | return; 55 | const player = x.querySelector("iframe"); 56 | const data = (0, CompileEpisodeData_js_1.default)(player.src); 57 | if (!data || !data.player_embed || !data.hosting) { 58 | return; 59 | } 60 | episodes_cleaning.push({ 61 | player: data.hosting, 62 | url: data.player_embed, 63 | }); 64 | }); 65 | })); 66 | if (episodes_cleaning.length === 0) { 67 | return { 68 | status: 500, 69 | message: "Something went wrong!", 70 | }; 71 | } 72 | return { 73 | status: 200, 74 | message: "Mission Accomplished!", 75 | episode_thumbnail: null, 76 | episodes: episodes_cleaning, 77 | episode_next_url: episode_next_url, 78 | }; 79 | } 80 | catch (error) { 81 | return { 82 | status: 500, 83 | message: "Something went wrong!", 84 | }; 85 | } 86 | }); 87 | } 88 | exports.default = ServicePaldea; 89 | --------------------------------------------------------------------------------