mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 15:38:19 -07:00
Init flow plugins
This commit is contained in:
parent
92f97a8c81
commit
7521d7eef0
67 changed files with 4765 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: '10 Bit Video',
|
||||
description: 'Set 10 Bit Video',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Crop Black Bars',
|
||||
description: 'Crop Black Bars',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Custom Arguments',
|
||||
description: 'Custom Arguments',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Ensure Audio Stream',
|
||||
description: 'Ensure that the file has an audio stream with set codec and channel count',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
var utils_1 = require("../../../../FlowHelpers/1.0.0/utils");
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Execute',
|
||||
description: 'Execute the created FFmpeg command',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: 2,
|
||||
icon: 'faPlay',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'File is 480p',
|
||||
},
|
||||
{
|
||||
number: 2,
|
||||
tooltip: 'File is 576p',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
var getEncoder = function (codec) {
|
||||
switch (codec) {
|
||||
case 'h264':
|
||||
return 'libx264';
|
||||
case 'hevc':
|
||||
return 'libx265';
|
||||
default:
|
||||
return codec;
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var lib, cliArgs, shouldProcess, outputFilePath, cli, res;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
cliArgs = [];
|
||||
cliArgs.push('-y');
|
||||
cliArgs.push('-i');
|
||||
cliArgs.push(args.inputFileObj._id);
|
||||
shouldProcess = false;
|
||||
// @ts-expect-error type
|
||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||
if (!stream.removed) {
|
||||
cliArgs.push('-map');
|
||||
cliArgs.push("0:".concat(stream.index));
|
||||
cliArgs.push("-c:".concat(stream.index));
|
||||
args.jobLog(JSON.stringify({ stream: stream }));
|
||||
if (args.inputs.forceProcess || stream.codec_name !== stream.targetCodec) {
|
||||
shouldProcess = true;
|
||||
cliArgs.push(getEncoder(stream.targetCodec));
|
||||
}
|
||||
else {
|
||||
cliArgs.push('copy');
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!shouldProcess) {
|
||||
args.jobLog('No need to process file, already as required');
|
||||
return [2 /*return*/, {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
}];
|
||||
}
|
||||
outputFilePath = "".concat(args.workDir, "/tempFile.").concat(args.variables.ffmpegCommand.container);
|
||||
cliArgs.push(outputFilePath);
|
||||
// @ts-expect-error type
|
||||
args.deps.fsextra.ensureDirSync(args.workDir);
|
||||
args.jobLog('Processing file');
|
||||
args.jobLog(JSON.stringify({
|
||||
cliArgs: cliArgs,
|
||||
outputFilePath: outputFilePath,
|
||||
}));
|
||||
cli = new utils_1.CLI({
|
||||
cli: args.ffmpegPath,
|
||||
spawnArgs: cliArgs,
|
||||
spawnOpts: {},
|
||||
jobLog: args.jobLog,
|
||||
outputFilePath: outputFilePath,
|
||||
inputFileObj: args.inputFileObj,
|
||||
logFullCliOutput: args.logFullCliOutput,
|
||||
updateWorker: args.updateWorker,
|
||||
});
|
||||
return [4 /*yield*/, cli.runCli()];
|
||||
case 1:
|
||||
res = _a.sent();
|
||||
if (!args.logFullCliOutput) {
|
||||
args.jobLog(res.errorLogFull.slice(-1000).join(''));
|
||||
}
|
||||
if (res.cliExitCode !== 0) {
|
||||
args.jobLog('Running FFmpeg failed');
|
||||
throw new Error('FFmpeg failed');
|
||||
}
|
||||
args.logOutcome('tSuc');
|
||||
return [2 /*return*/, {
|
||||
outputFileObj: {
|
||||
_id: outputFilePath,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
}];
|
||||
}
|
||||
});
|
||||
}); };
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'HDR to SDR',
|
||||
description: 'Convert HDR to SDR',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Normalize Audio',
|
||||
description: 'Normalize Audio',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
"use strict";
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint-disable no-param-reassign */
|
||||
var details = function () { return ({
|
||||
name: 'Remove Data Streams',
|
||||
description: 'Remove Data Streams ',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
// @ts-expect-error type
|
||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||
if (stream.codec_type === 'data') {
|
||||
stream.removed = true;
|
||||
}
|
||||
});
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
"use strict";
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint-disable no-param-reassign */
|
||||
var details = function () { return ({
|
||||
name: 'Remove Subtitles',
|
||||
description: 'Remove subtitles from the file',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
// @ts-expect-error type
|
||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||
if (stream.codec_type === 'subtitle') {
|
||||
stream.removed = true;
|
||||
}
|
||||
});
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Set Video Bitrate',
|
||||
description: 'Set Video Bitrate',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
"use strict";
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint-disable no-param-reassign */
|
||||
var details = function () { return ({
|
||||
name: 'Set Container',
|
||||
description: 'Set the container of the output file',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
{
|
||||
name: 'container',
|
||||
type: 'string',
|
||||
defaultValue: 'mkv',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'mkv',
|
||||
'mp4',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the container to use',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
// @ts-expect-error type
|
||||
args.variables.ffmpegCommand.container = args.inputs.container;
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Reorder Streams',
|
||||
description: 'Reorder Streams',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
"use strict";
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint-disable no-param-reassign */
|
||||
var details = function () { return ({
|
||||
name: 'Set Video Encoder',
|
||||
description: 'Set the video encoder for all streams',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
{
|
||||
name: 'targetCodec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
// 'vp9',
|
||||
'h264',
|
||||
// 'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec to use',
|
||||
},
|
||||
{
|
||||
name: 'forceEncoding',
|
||||
type: 'boolean',
|
||||
defaultValue: 'false',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'false',
|
||||
'true',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify whether to force encoding if stream already has the target codec',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
// @ts-expect-error type
|
||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||
if (stream.codec_type === 'video') {
|
||||
// @ts-expect-error type
|
||||
stream.targetCodec = args.inputs.targetCodec;
|
||||
stream.forceEncoding = args.inputs.forceEncoding;
|
||||
}
|
||||
});
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Set Video Scale',
|
||||
description: 'Change video scale',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
"use strict";
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint-disable no-param-reassign */
|
||||
var details = function () { return ({
|
||||
name: 'Start',
|
||||
description: 'Start FFmpeg Command',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: 1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
var containerParts = args.inputFileObj._id.split('.');
|
||||
var container = containerParts[containerParts.length - 1];
|
||||
var ffmpegCommand = {
|
||||
inputFiles: [],
|
||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map(function (stream) { return (__assign(__assign({}, stream), { removed: false, targetCodec: stream.codec_name, args: [] })); }),
|
||||
container: container,
|
||||
};
|
||||
args.variables.ffmpegCommand = ffmpegCommand;
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Video Scale',
|
||||
description: 'Change video scale',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Check File Medium',
|
||||
description: 'Check if file is video, audio or other type of file',
|
||||
style: {
|
||||
borderColor: 'orange',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'File medium is a Video',
|
||||
},
|
||||
{
|
||||
number: 2,
|
||||
tooltip: 'File medium is an Audio',
|
||||
},
|
||||
{
|
||||
number: 3,
|
||||
tooltip: 'File medium is Other',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
var outputNumber = 1;
|
||||
switch (args.inputFileObj.fileMedium) {
|
||||
case 'video':
|
||||
outputNumber = 1;
|
||||
break;
|
||||
case 'audio':
|
||||
outputNumber = 2;
|
||||
break;
|
||||
case 'other':
|
||||
outputNumber = 3;
|
||||
break;
|
||||
default:
|
||||
throw new Error('File has no fileMedium!');
|
||||
}
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: outputNumber,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Copy to Directory',
|
||||
description: 'Copy the working file to a directory',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [
|
||||
{
|
||||
name: 'target_codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
// 'vp9',
|
||||
'h264',
|
||||
// 'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec to use',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Move To Directory',
|
||||
description: 'Move working file to directory.',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Move To Directory',
|
||||
description: 'Move working file to directory.',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Replace Original File',
|
||||
description: 'Replace the origial file',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [
|
||||
{
|
||||
name: 'target_codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
// 'vp9',
|
||||
'h264',
|
||||
// 'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec to use',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
var getNewPath = function (originalPath, tempPath) {
|
||||
var tempPathParts = tempPath.split('.');
|
||||
var container = tempPathParts[tempPathParts.length - 1];
|
||||
var originalPathParts = originalPath.split('.');
|
||||
originalPathParts[originalPathParts.length - 1] = container;
|
||||
return originalPathParts.join('.');
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var fs, lib, currentPath, newPath, newPathTmp;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
fs = require('fs');
|
||||
lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
currentPath = args.inputFileObj._id;
|
||||
newPath = getNewPath(args.originalLibraryFile._id, currentPath);
|
||||
newPathTmp = "".concat(newPath, ".tmp");
|
||||
args.jobLog(JSON.stringify({
|
||||
currentPath: currentPath,
|
||||
newPath: newPath,
|
||||
newPathTmp: newPathTmp,
|
||||
}));
|
||||
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
||||
case 1:
|
||||
_a.sent();
|
||||
fs.renameSync(currentPath, newPathTmp);
|
||||
if (fs.existsSync(newPath)) {
|
||||
fs.unlinkSync(newPath);
|
||||
}
|
||||
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
||||
case 2:
|
||||
_a.sent();
|
||||
fs.renameSync(newPathTmp, newPath);
|
||||
return [2 /*return*/, {
|
||||
outputFileObj: {
|
||||
_id: newPath,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
}];
|
||||
}
|
||||
});
|
||||
}); };
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Input File',
|
||||
description: 'Transcode a video file using ffmpeg. GPU transcoding will be used if possible.',
|
||||
style: {
|
||||
borderColor: 'pink',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: true,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
123
FlowPlugins/CommunityFlowPlugins/tools/unpack/1.0.0/index.js
Normal file
123
FlowPlugins/CommunityFlowPlugins/tools/unpack/1.0.0/index.js
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Unpack File',
|
||||
description: 'Unpack a file',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [
|
||||
{
|
||||
name: 'target_codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
// 'vp9',
|
||||
'h264',
|
||||
// 'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec to use',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
var getNewPath = function (originalPath, tempPath) {
|
||||
var tempPathParts = tempPath.split('.');
|
||||
var container = tempPathParts[tempPathParts.length - 1];
|
||||
var originalPathParts = originalPath.split('.');
|
||||
originalPathParts[originalPathParts.length - 1] = container;
|
||||
return originalPathParts.join('.');
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var fs, lib, currentPath, newPath, newPathTmp;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
fs = require('fs');
|
||||
lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
currentPath = args.inputFileObj._id;
|
||||
newPath = getNewPath(args.originalLibraryFile._id, currentPath);
|
||||
newPathTmp = "".concat(newPath, ".tmp");
|
||||
args.jobLog(JSON.stringify({
|
||||
currentPath: currentPath,
|
||||
newPath: newPath,
|
||||
newPathTmp: newPathTmp,
|
||||
}));
|
||||
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
||||
case 1:
|
||||
_a.sent();
|
||||
fs.renameSync(currentPath, newPathTmp);
|
||||
if (fs.existsSync(newPath)) {
|
||||
fs.unlinkSync(newPath);
|
||||
}
|
||||
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
||||
case 2:
|
||||
_a.sent();
|
||||
fs.renameSync(newPathTmp, newPath);
|
||||
return [2 /*return*/, {
|
||||
outputFileObj: {
|
||||
_id: newPath,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
}];
|
||||
}
|
||||
});
|
||||
}); };
|
||||
exports.plugin = plugin;
|
||||
123
FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js
Normal file
123
FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Send Web Request',
|
||||
description: 'Send Web Request',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [
|
||||
{
|
||||
name: 'target_codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
// 'vp9',
|
||||
'h264',
|
||||
// 'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec to use',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
var getNewPath = function (originalPath, tempPath) {
|
||||
var tempPathParts = tempPath.split('.');
|
||||
var container = tempPathParts[tempPathParts.length - 1];
|
||||
var originalPathParts = originalPath.split('.');
|
||||
originalPathParts[originalPathParts.length - 1] = container;
|
||||
return originalPathParts.join('.');
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var fs, lib, currentPath, newPath, newPathTmp;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
fs = require('fs');
|
||||
lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
currentPath = args.inputFileObj._id;
|
||||
newPath = getNewPath(args.originalLibraryFile._id, currentPath);
|
||||
newPathTmp = "".concat(newPath, ".tmp");
|
||||
args.jobLog(JSON.stringify({
|
||||
currentPath: currentPath,
|
||||
newPath: newPath,
|
||||
newPathTmp: newPathTmp,
|
||||
}));
|
||||
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
||||
case 1:
|
||||
_a.sent();
|
||||
fs.renameSync(currentPath, newPathTmp);
|
||||
if (fs.existsSync(newPath)) {
|
||||
fs.unlinkSync(newPath);
|
||||
}
|
||||
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
|
||||
case 2:
|
||||
_a.sent();
|
||||
fs.renameSync(newPathTmp, newPath);
|
||||
return [2 /*return*/, {
|
||||
outputFileObj: {
|
||||
_id: newPath,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
}];
|
||||
}
|
||||
});
|
||||
}); };
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Check Video Codec',
|
||||
description: 'Check if a file has a specific video codec',
|
||||
style: {
|
||||
borderColor: 'orange',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
{
|
||||
name: 'codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
'vp9',
|
||||
'h264',
|
||||
'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec check for',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'File has codec',
|
||||
},
|
||||
{
|
||||
number: 2,
|
||||
tooltip: 'File does not have codec',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
var hasCodec = false;
|
||||
// @ts-expect-error type
|
||||
args.inputFileObj.ffProbeData.streams.forEach(function (stream) {
|
||||
if (stream.codec_type === 'video' && stream.codec_name === args.inputs.codec) {
|
||||
hasCodec = true;
|
||||
}
|
||||
});
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: hasCodec ? 1 : 2,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Check Video Resolution',
|
||||
description: 'Check is video is 480p,576p,720p,1080p,1440p,4KUHD,DCI4K,8KUHD,Other',
|
||||
style: {
|
||||
borderColor: 'orange',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'File is 480p',
|
||||
},
|
||||
{
|
||||
number: 2,
|
||||
tooltip: 'File is 576p',
|
||||
},
|
||||
{
|
||||
number: 3,
|
||||
tooltip: 'File is 720p',
|
||||
},
|
||||
{
|
||||
number: 4,
|
||||
tooltip: 'File is 1080p',
|
||||
},
|
||||
{
|
||||
number: 5,
|
||||
tooltip: 'File is 1440p',
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
tooltip: 'File is 4KUHD',
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
tooltip: 'File is DCI4K',
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
tooltip: 'File is 8KUHD',
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
tooltip: 'File is Other',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = exports.details = void 0;
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
var details = function () { return ({
|
||||
name: 'Transcode Video File',
|
||||
description: 'Transcode a video file using ffmpeg. GPU transcoding will be used if possible.',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
{
|
||||
name: 'target_codec',
|
||||
type: 'string',
|
||||
defaultValue: 'hevc',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'hevc',
|
||||
// 'vp9',
|
||||
'h264',
|
||||
// 'vp8',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify the codec to use',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
}); };
|
||||
exports.details = details;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
var plugin = function (args) {
|
||||
var lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
var fs = require('fs');
|
||||
var oldFile = args.inputFileObj._id;
|
||||
var newFile = "".concat(args.inputFileObj._id, ".tmp");
|
||||
if (fs.existsSync(newFile)) {
|
||||
fs.unlinkSync(newFile);
|
||||
}
|
||||
fs.copyFileSync(oldFile, newFile);
|
||||
return {
|
||||
outputFileObj: { _id: newFile },
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
exports.plugin = plugin;
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";
|
||||
Loading…
Add table
Add a link
Reference in a new issue