Skip to content

Commit

Permalink
Revert "include outro when extracting from rapidcloud (#448)"
Browse files Browse the repository at this point in the history
This reverts commit 3f40d14.
  • Loading branch information
prince-ao authored Jan 3, 2024
1 parent 3f40d14 commit cb36065
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 7 additions & 3 deletions dist/extractors/rapidcloud.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extractors/rapidcloud.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions src/extractors/rapidcloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class RapidCloud extends VideoExtractor {
private readonly host = 'https://rapid-cloud.co';

override extract = async (videoUrl: URL): Promise<{ sources: IVideo[] } & { subtitles: ISubtitle[] }> => {
const result: { sources: IVideo[]; subtitles: ISubtitle[]; intro?: Intro; outro?: Intro } = {
const result: { sources: IVideo[]; subtitles: ISubtitle[]; intro?: Intro } = {
sources: [],
subtitles: [],
};
Expand All @@ -31,7 +31,7 @@ class RapidCloud extends VideoExtractor {
);

let {
data: { sources, tracks, intro, outro, encrypted },
data: { sources, tracks, intro, encrypted },
} = res;

let decryptKey = await (
Expand Down Expand Up @@ -113,8 +113,12 @@ class RapidCloud extends VideoExtractor {
}
}

result.intro = intro?.end > 1 ? { start: intro.start, end: intro.end } : undefined;
result.outro = outro?.end > 1 ? { start: outro.start, end: outro.end } : undefined;
if (intro?.end > 1) {
result.intro = {
start: intro.start,
end: intro.end,
};
}

result.sources.push({
url: sources[0].file,
Expand Down

0 comments on commit cb36065

Please sign in to comment.