mirror of
https://github.com/snobu/destreamer.git
synced 2026-02-10 16:49:42 +00:00
fix for *nix platforms
This commit is contained in:
@@ -278,7 +278,9 @@ async function downloadVideo(videoGUIDs: Array<string>,
|
|||||||
|
|
||||||
logger.info('\n\nMerging and decrypting video and audio segments...\n');
|
logger.info('\n\nMerging and decrypting video and audio segments...\n');
|
||||||
|
|
||||||
execSync(`copy /b *.encr "${video.filename}.video.encr"`, {cwd: videoSegmentsDir.name});
|
const cmd = (process.platform == 'win32') ? 'copy /b *.encr ' : 'cat *.encr > ';
|
||||||
|
|
||||||
|
execSync(cmd + `"${video.filename}.video.encr"`, { cwd: videoSegmentsDir.name });
|
||||||
const videoDecryptInput = fs.createReadStream(
|
const videoDecryptInput = fs.createReadStream(
|
||||||
path.join(videoSegmentsDir.name, video.filename + '.video.encr'));
|
path.join(videoSegmentsDir.name, video.filename + '.video.encr'));
|
||||||
const videoDecryptOutput = fs.createWriteStream(
|
const videoDecryptOutput = fs.createWriteStream(
|
||||||
@@ -289,7 +291,7 @@ async function downloadVideo(videoGUIDs: Array<string>,
|
|||||||
videoDecryptInput.pipe(videoDecrypter).pipe(videoDecryptOutput);
|
videoDecryptInput.pipe(videoDecrypter).pipe(videoDecryptOutput);
|
||||||
});
|
});
|
||||||
|
|
||||||
execSync(`copy /b *.encr "${video.filename}.audio.encr"`, {cwd: audioSegmentsDir.name});
|
execSync(cmd + `"${video.filename}.audio.encr"`, {cwd: audioSegmentsDir.name});
|
||||||
const audioDecryptInput = fs.createReadStream(
|
const audioDecryptInput = fs.createReadStream(
|
||||||
path.join(audioSegmentsDir.name, video.filename + '.audio.encr'));
|
path.join(audioSegmentsDir.name, video.filename + '.audio.encr'));
|
||||||
const audioDecryptOutput = fs.createWriteStream(
|
const audioDecryptOutput = fs.createWriteStream(
|
||||||
|
|||||||
Reference in New Issue
Block a user