@@ -4,12 +4,10 @@ import { v1_base_url } from "../../utils/base_v1.js";
44
55export async function decryptSources_v1 ( id , name , type ) {
66 try {
7- //Thanks superbillgalaxy for the keys
8- // Parallel request for source metadata and decryption key
9- const [ { data : sourcesData } , { data : keyData } ] = await Promise . all ( [
7+ const [ { data : sourcesData } , { data : key } ] = await Promise . all ( [
108 axios . get ( `https://${ v1_base_url } /ajax/v2/episode/sources?id=${ id } ` ) ,
119 axios . get (
12- "https://raw.githubusercontent.com/superbillgalaxy /megacloud-keys/refs/heads/main/api.json "
10+ "https://raw.githubusercontent.com/itzzzme /megacloud-keys/refs/heads/main/key.txt "
1311 ) ,
1412 ] ) ;
1513
@@ -20,15 +18,14 @@ export async function decryptSources_v1(id, name, type) {
2018 const sourceId = match ?. [ 1 ] ;
2119 if ( ! sourceId ) throw new Error ( "Unable to extract sourceId from link" ) ;
2220
23- // Get encrypted source
2421 const { data : rawSourceData } = await axios . get (
2522 `https://megacloud.blog/embed-2/v2/e-1/getSources?id=${ sourceId } `
2623 ) ;
2724 const encrypted = rawSourceData ?. sources ;
2825 if ( ! encrypted ) throw new Error ( "Encrypted source missing in response" ) ;
29-
30- // Decrypt using key
31- const decrypted = CryptoJS . AES . decrypt ( encrypted , keyData . megacloud ) . toString ( CryptoJS . enc . Utf8 ) ;
26+ const decrypted = CryptoJS . AES . decrypt ( encrypted , key ) . toString (
27+ CryptoJS . enc . Utf8
28+ ) ;
3229 if ( ! decrypted ) throw new Error ( "Failed to decrypt source" ) ;
3330
3431 let decryptedSources ;
@@ -37,8 +34,6 @@ export async function decryptSources_v1(id, name, type) {
3734 } catch ( e ) {
3835 throw new Error ( "Decrypted data is not valid JSON" ) ;
3936 }
40-
41- // Build response
4237 return {
4338 id,
4439 type,
0 commit comments