11import axios from "axios" ;
22import * as cheerio from "cheerio" ;
33import { v1_base_url } from "../utils/base_v1.js" ;
4- import decryptMegacloud from "../parsers/decryptors/megacloud.decryptor.js" ;
5- import AniplayExtractor from "../parsers/aniplay.parser.js" ;
4+ // import decryptMegacloud from "../parsers/decryptors/megacloud.decryptor.js";
5+ // import AniplayExtractor from "../parsers/aniplay.parser.js";
6+ import { decryptSources_v1 } from "../parsers/decryptors/decrypt_v1.decryptor.js" ;
67
78export async function extractServers ( id ) {
89 try {
@@ -15,6 +16,7 @@ export async function extractServers(id) {
1516 const data_id = $ ( element ) . attr ( "data-id" ) ;
1617 const server_id = $ ( element ) . attr ( "data-server-id" ) ;
1718 const type = $ ( element ) . attr ( "data-type" ) ;
19+
1820 const serverName = $ ( element ) . find ( "a" ) . text ( ) . trim ( ) ;
1921 serverData . push ( {
2022 type,
@@ -30,13 +32,7 @@ export async function extractServers(id) {
3032 }
3133}
3234
33- async function extractStreamingInfo (
34- id ,
35- name ,
36- type ,
37- anilistId = null ,
38- epnum = null
39- ) {
35+ async function extractStreamingInfo ( id , name , type ) {
4036 try {
4137 const servers = await extractServers ( id . split ( "?ep=" ) . pop ( ) ) ;
4238 let requestedServer = servers . filter (
@@ -51,17 +47,12 @@ async function extractStreamingInfo(
5147 server . type . toLowerCase ( ) === "raw"
5248 ) ;
5349 }
54- if ( requestedServer . length === 0 && name . toLowerCase ( ) !== "hd-4" ) {
50+ if ( requestedServer . length === 0 ) {
5551 throw new Error (
5652 `No matching server found for name: ${ name } , type: ${ type } `
5753 ) ;
5854 }
59- if ( name . toLowerCase ( ) === "hd-4" && anilistId && epnum ) {
60- const extractor = new AniplayExtractor ( ) ;
61- const streamingLink = await extractor . fetchEpisode ( anilistId , epnum ) ;
62- return { streamingLink : streamingLink . sources , servers } ;
63- }
64- const streamingLink = await decryptMegacloud (
55+ const streamingLink = await decryptSources_v1 (
6556 requestedServer [ 0 ] . data_id ,
6657 name ,
6758 type
0 commit comments