|
|
@@ -8,6 +8,7 @@ import { |
|
|
|
import { VIDEO_TYPE } from './common'; |
|
|
|
import { constructDefaultDownloadArgs, getFileExtension } from './downloader'; |
|
|
|
import { DownloaderFailedToStartError, DownloaderNotFoundError } from './errors'; |
|
|
|
import {retrieveVideoId} from './url'; |
|
|
|
|
|
|
|
export interface CreateClipperParams extends CreateBaseClipperParams { |
|
|
|
type: typeof VIDEO_TYPE; |
|
|
@@ -24,7 +25,8 @@ export const createVideoClipper = (createClipperParams: Omit<CreateClipperParams |
|
|
|
createClipperParams.downloaderExecutablePath, |
|
|
|
clipVideoParams.url, |
|
|
|
); |
|
|
|
const cacheFilename = `output.${fileExtension}`; // todo label this on the cache |
|
|
|
const videoId = retrieveVideoId(clipVideoParams.url); |
|
|
|
const cacheFilename = `output.${encodeURIComponent(videoId)}.${fileExtension}`; |
|
|
|
const downloadArgs = constructDefaultDownloadArgs( |
|
|
|
cacheFilename, |
|
|
|
clipVideoParams.url, |
|
|
|