Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

include outro when extracting from rapidcloud #448

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 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: 4 additions & 8 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 } = {
const result: { sources: IVideo[]; subtitles: ISubtitle[]; intro?: Intro; outro?: Intro } = {
sources: [],
subtitles: [],
};
Expand All @@ -31,7 +31,7 @@ class RapidCloud extends VideoExtractor {
);

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

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

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,
Expand Down