aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRitesh Ghosh <[email protected]>2024-02-20 00:01:13 +0530
committerRitesh Ghosh <[email protected]>2024-02-20 00:01:13 +0530
commit3617c500d6780353b660e4e50040c9c80c9dbc45 (patch)
tree2652d57b6c841d605cc7aefcd729467037767325
parent699b630c4b66415222b0bb76e570ccfbedba0c75 (diff)
downloadaniwatch-api-3617c500d6780353b660e4e50040c9c80c9dbc45.tar.xz
aniwatch-api-3617c500d6780353b660e4e50040c9c80c9dbc45.zip
feat: update decrypt key src
-rw-r--r--src/extractors/rapidcloud.ts24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/extractors/rapidcloud.ts b/src/extractors/rapidcloud.ts
index bbf9cf6..8073c8b 100644
--- a/src/extractors/rapidcloud.ts
+++ b/src/extractors/rapidcloud.ts
@@ -3,7 +3,10 @@ import CryptoJS from "crypto-js";
import { substringAfter, substringBefore } from "../utils/index.js";
import type { Video, Subtitle, Intro } from "../types/extractor.js";
-type extractReturn = { sources: Video[]; subtitles: Subtitle[] };
+type extractReturn = {
+ sources: Video[];
+ subtitles: Subtitle[];
+};
// https://megacloud.tv/embed-2/e-1/IxJ7GjGVCyml?k=1
class RapidCloud {
@@ -15,7 +18,7 @@ class RapidCloud {
private readonly host = "https://rapid-cloud.co";
async extract(videoUrl: URL): Promise<extractReturn> {
- const result: extractReturn & { intro?: Intro } = {
+ const result: extractReturn & { intro?: Intro; outro?: Intro } = {
sources: [],
subtitles: [],
};
@@ -36,12 +39,12 @@ class RapidCloud {
);
let {
- data: { sources, tracks, intro, encrypted },
+ data: { sources, tracks, intro, outro, encrypted },
} = res;
let decryptKey = await (
await axios.get(
- "https://raw.githubusercontent.com/theonlymo/keys/e1/key"
+ "https://raw.githubusercontent.com/cinemaxhq/keys/e1/key"
)
).data;
@@ -53,7 +56,7 @@ class RapidCloud {
if (!decryptKey) {
decryptKey = await (
await axios.get(
- "https://raw.githubusercontent.com/theonlymo/keys/e1/key"
+ "https://raw.githubusercontent.com/cinemaxhq/keys/e1/key"
)
).data;
}
@@ -131,14 +134,13 @@ class RapidCloud {
}
result.sources.push(...this.sources);
}
- if (intro?.end > 1) {
- result.intro = {
- start: intro.start,
- end: intro.end,
- };
- }
}
+ result.intro =
+ intro?.end > 1 ? { start: intro.start, end: intro.end } : undefined;
+ result.outro =
+ outro?.end > 1 ? { start: outro.start, end: outro.end } : undefined;
+
result.sources.push({
url: sources[0].file,
isM3U8: sources[0].file.includes(".m3u8"),