Plugin update

make-only-subtitle-default
HaveAGitGat 4 years ago
parent 5f68989571
commit 90e2b3923a

@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v2
@ -22,4 +22,4 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run lint
- run: npm run checkPlugins && npm run lint

@ -1,55 +1,55 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
return {
id: "Tdarr_Plugin_075a_FFMPEG_HEVC_Generic",
Stage: "Pre-processing",
Name: "FFMPEG H265",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using default settings. Audio/subtitles not affected. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js",
Tags: "pre-processing,ffmpeg,h265,video only",
};
}
const details = () => ({
id: 'Tdarr_Plugin_075a_FFMPEG_HEVC_Generic',
Stage: 'Pre-processing',
Name: 'FFMPEG H265',
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using default settings. Audio/subtitles not affected. \n\n',
Version: '1.00',
Tags: 'pre-processing,ffmpeg,h265,video only',
Inputs: [],
});
function plugin(file) {
//Must return this object
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object
var response = {
const response = {
processFile: false,
preset: "",
container: ".mp4",
preset: '',
container: '.mp4',
handBrakeMode: false,
FFmpegMode: false,
reQueueAfter: false,
infoLog: "",
infoLog: '',
};
if (file.fileMedium !== "video") {
if (file.fileMedium !== 'video') {
response.processFile = false;
response.infoLog += "☒File is not a video! \n";
response.infoLog += '☒File is not a video! \n';
return response;
} else {
response.infoLog += "☑File is a video! \n";
}
response.infoLog += '☑File is a video! \n';
if (file.ffProbeData.streams[0].codec_name == "hevc") {
if (file.ffProbeData.streams[0].codec_name == 'hevc') {
response.processFile = false;
response.infoLog += "☑File is already in hevc! \n";
response.infoLog += '☑File is already in hevc! \n';
return response;
}
response.processFile = true;
response.preset = `,-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:v:0 libx265 -max_muxing_queue_size 9999`;
response.container = ".mkv";
response.preset = ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:v:0 libx265 -max_muxing_queue_size 9999';
response.container = '.mkv';
response.handBrakeMode = false;
response.FFmpegMode = true;
response.reQueueAfter = true;
response.infoLog += `☒File is not hevc! \n`;
response.infoLog += '☒File is not hevc! \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,18 +1,22 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
return {
const details = () => ({
id: "Tdarr_Plugin_075a_Transcode_Customisable",
Stage: "Pre-processing",
Name: "Video Transcode Customisable",
Type: "",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] Specify codec filter and transcode arguments for HandBrake or FFmpeg \n\n`,
Version: "1.00",
Link: "",
Tags: "pre-processing,handbrake,ffmpeg,configurable",
Inputs: [
{
name: "codecs_to_exclude",
type: 'string',
defaultValue: 'hevc',
inputUI: {
type: 'text',
},
tooltip: `Input codecs, separated by a comma, that should be excluded when processing.
\\nFor example, if you're transcoding into hevc (h265), then add a filter to prevent hevc being transcoded so your newly transcoded files won't be infinitely looped/processed. \\n
@ -47,6 +51,11 @@ module.exports.details = function details() {
},
{
name: "cli",
type: 'string',
defaultValue: 'handbrake',
inputUI: {
type: 'text',
},
tooltip: `Enter the CLI to use.
\\nExample:\\n
@ -59,6 +68,11 @@ module.exports.details = function details() {
},
{
name: "transcode_arguments",
type: 'string',
defaultValue: '-Z "Very Fast 1080p30" --all-subtitles --all-audio',
inputUI: {
type: 'text',
},
tooltip: `\\nEnter HandBrake or FFmpeg transcode arguments.
\\nHandBrake examples:
@ -114,6 +128,11 @@ module.exports.details = function details() {
},
{
name: "output_container",
type: 'string',
defaultValue: '.mkv',
inputUI: {
type: 'text',
},
tooltip: `
\\nEnter the output container of the new file
@ -129,10 +148,13 @@ module.exports.details = function details() {
`,
},
],
};
};
}
);
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {
@ -186,3 +208,9 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
response.infoLog += `☒File is not in desired codec! \n`;
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only",
Stage: "Pre-processing",
@ -8,13 +9,15 @@ function details() {
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using default settings. Only video and audio streams are kept. Useful for if you're getting errors because of certain containers not being able to handle certain subtitle/data streams. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js",
Tags: "pre-processing,video only,ffmpeg,h265",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,19 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20",
Stage:'Pre-processing',
Name: "FFMPEG H265 Video + Audio Kept Only With CRF 20",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using default settings. Only video and audio streams are kept. Useful for if you're getting errors because of certain containers not being able to handle certain subtitle/data streams. A CRF value of 20 is used. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js",
Tags: "pre-processing,video only,ffmpeg,h265",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,19 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20",
Stage:'Pre-processing',
Name: "FFMPEG H265 Video + Audio Kept Only With CRF 20 On The GPU",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using the graphics card and a CRF value of 20. Only video and audio streams are kept. Useful for if you're getting errors because of certain containers not being able to handle certain subtitle/data streams. A CRF value of 20 is used. The GPU (graphics card) is used. \n\n`,
Version: "1.00",
Link:
"https://github.com/moodiest/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js",
Tags: "pre-processing,video only,ffmpeg,h265",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,18 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_076a_re_order_audio_streams",
Stage: "Pre-processing",
Name: "Re-order audio streams",
Type: "",
Type: "Audio",
Operation: "Transcode",
Description: `[Contains built-in filter] Specify a language tag for Tdarr to try and put as 1st audio track \n\n`,
Version: "1.00",
Link: "",
Tags: "pre-processing,audio only,ffmpeg,configurable",
Inputs: [
{
name: "preferred_language",
type:'string',
defaultValue:'eng',
inputUI: {
type: 'text',
},
tooltip: `Specify one language tag for Tdarr to try and put as 1st audio track
\\nExample:\\n
@ -37,7 +42,10 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {
@ -127,3 +135,10 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
response.infoLog += `☒ Desired audio lang is not first audio stream, moving! \n`;
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,18 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_076b_re_order_subtitle_streams",
Stage: "Pre-processing",
Name: "Re-order subtitle streams",
Type: "",
Type: "Subtitle",
Operation: "Transcode",
Description: `[Contains built-in filter] Specify a language tag for Tdarr to try and put as 1st subtitle track \n\n`,
Version: "1.00",
Link: "",
Tags: "pre-processing,subtitle only,ffmpeg,configurable",
Inputs: [
{
name: "preferred_language",
type:'string',
defaultValue:'eng',
inputUI: {
type: 'text',
},
tooltip: `Specify one language tag for Tdarr to try and put as 1st subtitle track
\\nExample:\\n
@ -37,7 +42,10 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {
@ -130,3 +138,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
response.infoLog += `☒ Desired subtitle lang is not first subtitle stream, moving! \n`;
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable",
Stage: "Pre-processing",
@ -8,11 +9,15 @@ module.exports.details = function details() {
Operation: "Transcode",
Description: `[Contains built-in filter] If files are not in H264, they will be transcoded into H264 using HandBrake NVENC H264. All audio and subtitles are kept. \n\n`,
Version: "1.00",
Link: "",
Tags: "pre-processing,handbrake,nvenc h264,configurable",
Inputs: [
{
name: "handbrake_preset",
type:'string',
defaultValue:'Fast 1080p30',
inputUI: {
type: 'text',
},
tooltip: `\\nEnter the name of a HandBrake preset.
@ -31,6 +36,11 @@ module.exports.details = function details() {
},
{
name: "output_container",
type:'string',
defaultValue:'.mkv',
inputUI: {
type: 'text',
},
tooltip: `
\\nEnter the output container of the new file
@ -46,7 +56,10 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {
@ -92,3 +105,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove",
Stage: "Pre-processing",
@ -8,12 +9,15 @@ module.exports.details = function details() {
Operation: "Transcode",
Description: `This plugin outputs embedded subs to SRT and then removes them \n\n`,
Version: "1.00",
Link: "",
Tags: "ffmpeg",
Inputs:[],
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs, otherArguments) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object at some point in the function else plugin will fail.
let response = {
@ -75,4 +79,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs, otherArgu
};
return response;
};
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,19 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_43az_add_to_radarr",
Stage: "Post-processing",
Name: "Add movie to Radarr after processing",
Type: "Video",
Operation: "",
Description: `Add movie to Radarr after processing \n\n`,
Version: "1.00",
Link: "",
Tags: "3rd party,post-processing,configurable",
id: 'Tdarr_Plugin_43az_add_to_radarr',
Stage: 'Post-processing',
Name: 'Add movie to Radarr after processing',
Type: 'Video',
Operation: 'Transcode',
Description: 'Add movie to Radarr after processing \n\n',
Version: '1.00',
Tags: '3rd party,post-processing,configurable',
Inputs: [
{
name: "server_ip",
name: 'server_ip',
type:'string',
defaultValue: '192.168.0.10',
inputUI: {
type: 'text',
},
tooltip: `
Enter the server IP address
@ -22,7 +26,12 @@ module.exports.details = function details() {
`,
},
{
name: "port",
name: 'port',
type: 'string',
defaultValue: '7878',
inputUI: {
type: 'text',
},
tooltip: `
Enter the port Radarr is using
@ -31,7 +40,12 @@ module.exports.details = function details() {
`,
},
{
name: "radarr_api_key",
name: 'radarr_api_key',
type: 'string',
defaultValue: '3ff1ae1c39a2a2a397315e15266dea48',
inputUI: {
type: 'text',
},
tooltip: `
Enter the Radarr API key. You can find it on Radarr at /settings/general
@ -42,17 +56,20 @@ module.exports.details = function details() {
},
],
};
};
}
module.exports.plugin = function plugin(file, librarySettings, inputs) {
const request = require("request");
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const request = require('request');
const IP = inputs.server_ip;
const port = inputs.port;
const { port } = inputs;
const APIKey = inputs.radarr_api_key;
var term = file.file.split("/");
let term = file.file.split('/');
term = term[term.length - 1];
term = term.split(".");
term = term.split('.');
term = term[term.length - 2];
term = encodeURI(term);
@ -69,10 +86,10 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
console.error(error);
}
// console.log(`statusCode: ${res.statusCode}`)
//console.log(body)
// console.log(body)
var response = body[0];
console.log(response.title); //e.g. Shrek
const response = body[0];
console.log(response.title); // e.g. Shrek
response.profileId = 6;
response.path = file.file;
response.qualityProfile = 6;
@ -88,17 +105,22 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
}
console.log(`statusCode: ${res.statusCode}`);
// console.log(body)
}
},
);
}
},
);
//Optional response if you need to modify database
var response = {
// Optional response if you need to modify database
const response = {
file,
removeFromDB: false,
updateDB: false,
};
//return response
// return response
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,7 +1,9 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only",
Stage: 'Pre-processing',
Name: "FFMPEG nvenc_H265 Video Only",
Type: "Video",
Stage: "Pre-processing",
@ -16,6 +18,11 @@ function details() {
Inputs: [
{
name: "compressionFactor",
type: 'string',
defaultValue:'0.07',
inputUI: {
type: 'text',
},
tooltip: `== Compression Factor == \\n\\n
How much does HEVC compress raw video? I suggest something between 0.04-0.08. Remember that GPU encoding is not as
efficient as CPU encoding, so resulting file sizes will be larger.\\n\\n
@ -23,9 +30,14 @@ Inputs: [
},
{
name: "maxResolution",
type: 'string',
defaultValue:'false',
inputUI: {
type: 'text',
},
tooltip: `== Maximum Resolution ==\\n\\n
Videos that exceed this resolution will be resized down to this resolution.\\n
Accepted options: 480p, 576p, 720p, 1080p, 4KUHD, 8KUHD. If left blank, no resizing will occur.\\n`
Accepted options: 480p, 576p, 720p, 1080p, 4KUHD, 8KUHD. If false, no resizing will occur.\\n`
},
],
@ -133,7 +145,10 @@ function getMediaInfo(file) {
return;
} // end getMediaInfo()
function plugin(file,librarySettings,inputs,otherArguments) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
if (file.fileMedium !== "video") {
response.processFile = false;

@ -1,7 +1,9 @@
/* eslint-disable */
function details() {
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => {
return {
id: "Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll",
Stage: 'Pre-processing',
Name: "DOOM Tiered H265 MKV, remove audio & subtitles [NVENC]",
Stage: "Pre-processing",
Type: "Video",
@ -9,40 +11,70 @@ function details() {
Description:
"In a single pass ensures all files are in MKV containers and where possible encoded in h265 (Tiered bitrate based on resolution), removes audio and subtitles that are not in the configured language or marked as commentary.",
Version: "2.0",
Tags: "pre-processing,ffmpeg,nvenc h265",
Tags: "pre-processing,ffmpeg,nvenc h265",
Inputs: [
{
name: "target_bitrate_480p576p",
type: 'string',
defaultValue: '1000000',
inputUI: {
type: 'text',
},
tooltip: `Specify the target bitrate for 480p and 576p files, if current bitrate exceeds the target. Otherwise target_pct_reduction will be used.
\\nExample 1 Mbps:\\n
1000000`,
},
{
name: "target_bitrate_720p",
type: 'string',
defaultValue: '2000000',
inputUI: {
type: 'text',
},
tooltip: `Specify the target bitrate for 720p files, if current bitrate exceeds the target. Otherwise target_pct_reduction will be used.
\\nExample 2 Mbps:\\n
2000000`,
},
{
name: "target_bitrate_1080p",
type: 'string',
defaultValue: '2500000',
inputUI: {
type: 'text',
},
tooltip: `Specify the target bitrate for 1080p files, if current bitrate exceeds the target. Otherwise target_pct_reduction will be used.
\\nExample 2.5 Mbps:\\n
2500000`,
},
{
name: "target_bitrate_4KUHD",
type: 'string',
defaultValue: '14000000',
inputUI: {
type: 'text',
},
tooltip: `Specify the target bitrate for 4KUHD files, if current bitrate exceeds the target. Otherwise target_pct_reduction will be used.
\\nExample 14 Mbps:\\n
14000000`,
},
{
{
name: "target_pct_reduction",
type: 'string',
defaultValue: '.50',
inputUI: {
type: 'text',
},
tooltip: `Specify the target reduction of bitrate, if current bitrate is less than resolution targets.
\\nExample 50%:\\n
.50`,
},
{
name: "audio_language",
type: 'string',
defaultValue: 'eng',
inputUI: {
type: 'text',
},
tooltip: `Specify language tag/s here for the audio tracks you'd like to keep, recommended to keep "und" as this stands for undertermined, some files may not have the language specified. Must follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
@ -55,6 +87,11 @@ function details() {
},
{
name: "audio_commentary",
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
tooltip: `Specify if audio tracks that contain commentary/description should be removed.
\\nExample:\\n
true
@ -64,6 +101,11 @@ function details() {
},
{
name: "subtitle_language",
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: `Specify language tag/s here for the subtitle tracks you'd like to keep. Must follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
@ -73,6 +115,11 @@ function details() {
},
{
name: "subtitle_commentary",
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
\\nExample:\\n
true
@ -173,7 +220,7 @@ class Configurator {
function calculateBitrate(file) {
var bitrateprobe = file.ffProbeData.streams[0].bit_rate;
if (isNaN(bitrateprobe)) {
bitrateprobe = file.bit_rate;
bitrateprobe = file.bit_rate;
}
return bitrateprobe;
}
@ -204,9 +251,9 @@ function buildAudioConfiguration(inputs, file, logger) {
var stream_count = 0;
var streams_removing = 0;
var languages = inputs.audio_language.split(",");
function audioProcess(stream, id) {
stream_count++;
stream_count++;
if ("tags" in stream && "title" in stream.tags && inputs.audio_commentary.toLowerCase() == "true") {
if (
stream.tags.title.toLowerCase().includes("commentary") ||
@ -231,16 +278,16 @@ function buildAudioConfiguration(inputs, file, logger) {
);
}
}
}
}
}
loopOverStreamsOfType(file, "audio", audioProcess);
loopOverStreamsOfType(file, "audio", audioProcess);
if (stream_count == streams_removing) {
logger.AddError(
`*** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.`
);
configuration.ResetOutputSetting(["-c:a copy"]);
configuration.ResetOutputSetting(["-c:a copy"]);
}
return configuration;
@ -258,24 +305,24 @@ function buildSubtitleConfiguration(inputs, file, logger) {
loopOverStreamsOfType(file, "subtitle", function (stream, id) {
if ((stream.codec_name === "eia_608") ||
(stream.codec_tag_string === "mp4s")) {
(stream.codec_tag_string === "mp4s")) {
// unsupported subtitle codec?
configuration.AddOutputSetting(`-map -0:s:${id}`);
logger.AddError(
`Removing unsupported subtitle`
);
return;
logger.AddError(
`Removing unsupported subtitle`
);
return;
}
// Remove unknown sub streams
if (!("codec_name" in stream)) {
configuration.AddOutputSetting(`-map -0:s:${id}`);
logger.AddError(
`Removing unknown subtitle`
);
return;
}
// Remove unknown sub streams
if (!("codec_name" in stream)) {
configuration.AddOutputSetting(`-map -0:s:${id}`);
logger.AddError(
`Removing unknown subtitle`
);
return;
}
if ("tags" in stream) {
// Remove unwanted languages
if ("language" in stream.tags) {
@ -284,12 +331,12 @@ function buildSubtitleConfiguration(inputs, file, logger) {
logger.AddError(
`Removing subtitle in language ${stream.tags.language}`
);
return;
return;
}
}
// Remove commentary subtitles
if ("title" in stream.tags && (inputs.subtitle_commentary.toLowerCase() == "true")) {
if ("title" in stream.tags && (inputs.subtitle_commentary.toLowerCase() == "true")) {
if (
stream.tags.title.toLowerCase().includes("commentary") ||
stream.tags.title.toLowerCase().includes("description") ||
@ -299,7 +346,7 @@ function buildSubtitleConfiguration(inputs, file, logger) {
logger.AddError(
`Removing Commentary or Description subtitle: ${stream.tags.title}`
);
return;
return;
}
}
}
@ -317,101 +364,107 @@ function buildSubtitleConfiguration(inputs, file, logger) {
* MKV container.
*/
function buildVideoConfiguration(inputs, file, logger) {
var configuration = new Configurator(["-map 0", "-map -0:d", "-c:v copy"]);
var tiered = {
"480p" : {"bitrate" : inputs.target_bitrate_480p576p,
"max_increase" : 500,
"cq" : 29
},
"576p" : {"bitrate" : inputs.target_bitrate_480p576p,
"max_increase" : 500,
"cq" : 29
},
"720p" : {"bitrate" : inputs.target_bitrate_720p,
"max_increase" : 2000,
"cq" : 30
},
"1080p" : {"bitrate" : inputs.target_bitrate_1080p,
"max_increase" : 2500,
"cq" : 31
},
"4KUHD" : {"bitrate" : inputs.target_bitrate_4KUHD,
"max_increase" : 6000,
"cq" : 31
},
"Other" : {"bitrate" : inputs.target_bitrate_1080p,
"max_increase" : 2500,
"cq" : 31
}
};
var inputSettings = {
"h263" : "-c:v h263_cuvid",
"h264" : "",
"mjpeg" : "c:v mjpeg_cuvid",
"mpeg1" : "-c:v mpeg1_cuvid",
"mpeg2" : "-c:v mpeg2_cuvid",
"vc1" : "-c:v vc1_cuvid",
"vp8" : "-c:v vp8_cuvid",
"vp9" : "-c:v vp9_cuvid"
}
function videoProcess(stream, id) {
if (stream.codec_name === "mjpeg") {
configuration.AddOutputSetting(`-map -v:${id}`);
return;
}
if ((stream.codec_name === "hevc" || stream.codec_name === "vp9") && file.container === "mkv") {
logger.AddSuccess("File is in HEVC codec and in MKV");
return;
}
// Check if should Remux.
if ((stream.codec_name === "hevc" || stream.codec_name === "vp9") && file.container !== "mkv") {
configuration.AddOutputSetting("-c:v copy");
logger.AddError("File is in HEVC codec but not MKV. Will remux");
}
// remove png streams.
if (stream.codec_name === "png") {
configuration.AddOutputSetting(`-map -0:v:${id}`);
} else if (stream.codec_name !== "hevc" && stream.codec_name !== "vp9") { // Check if should Transcode.
var bitrateprobe = calculateBitrate(file);
var bitratetarget = 0;
var bitratemax = 0;
var cq = 0;
var bitratecheck = 0;
/* Determine tiered bitrate variables */
var tier = tiered[file.video_resolution];
bitratecheck = parseInt(tier["bitrate"]);
if (bitrateprobe !== null && bitrateprobe < bitratecheck) {
bitratetarget = parseInt((bitrateprobe * inputs.target_pct_reduction) / 1000);
} else {
bitratetarget = parseInt(tier["bitrate"] / 1000);
}
bitratemax = bitratetarget + tier["max_increase"];
cq = tier["cq"];
configuration.RemoveOutputSetting("-c:v copy");
configuration.AddOutputSetting(
`-c:v hevc_nvenc -rc:v vbr_hq -qmin 0 -cq:v ${cq} -b:v ${bitratetarget}k -maxrate:v ${bitratemax}k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8`
);
configuration.AddInputSetting(inputSettings[file.video_codec_name]);
if (file.video_codec_name === "h264" && file.ffProbeData.streams[0].profile !== "High 10") {
configuration.AddInputSetting("-c:v h264_cuvid");
}
logger.AddError("Transcoding to HEVC using NVidia NVENC");
}
}
loopOverStreamsOfType(file, "video", videoProcess);
var configuration = new Configurator(["-map 0", "-map -0:d", "-c:v copy"]);
var tiered = {
"480p": {
"bitrate": inputs.target_bitrate_480p576p,
"max_increase": 500,
"cq": 29
},
"576p": {
"bitrate": inputs.target_bitrate_480p576p,
"max_increase": 500,
"cq": 29
},
"720p": {
"bitrate": inputs.target_bitrate_720p,
"max_increase": 2000,
"cq": 30
},
"1080p": {
"bitrate": inputs.target_bitrate_1080p,
"max_increase": 2500,
"cq": 31
},
"4KUHD": {
"bitrate": inputs.target_bitrate_4KUHD,
"max_increase": 6000,
"cq": 31
},
"Other": {
"bitrate": inputs.target_bitrate_1080p,
"max_increase": 2500,
"cq": 31
}
};
var inputSettings = {
"h263": "-c:v h263_cuvid",
"h264": "",
"mjpeg": "c:v mjpeg_cuvid",
"mpeg1": "-c:v mpeg1_cuvid",
"mpeg2": "-c:v mpeg2_cuvid",
"vc1": "-c:v vc1_cuvid",
"vp8": "-c:v vp8_cuvid",
"vp9": "-c:v vp9_cuvid"
}
function videoProcess(stream, id) {
if (stream.codec_name === "mjpeg") {
configuration.AddOutputSetting(`-map -v:${id}`);
return;
}
if ((stream.codec_name === "hevc" || stream.codec_name === "vp9") && file.container === "mkv") {
logger.AddSuccess("File is in HEVC codec and in MKV");
return;
}
// Check if should Remux.
if ((stream.codec_name === "hevc" || stream.codec_name === "vp9") && file.container !== "mkv") {
configuration.AddOutputSetting("-c:v copy");
logger.AddError("File is in HEVC codec but not MKV. Will remux");
}
// remove png streams.
if (stream.codec_name === "png") {
configuration.AddOutputSetting(`-map -0:v:${id}`);
} else if (stream.codec_name !== "hevc" && stream.codec_name !== "vp9") { // Check if should Transcode.
var bitrateprobe = calculateBitrate(file);
var bitratetarget = 0;
var bitratemax = 0;
var cq = 0;
var bitratecheck = 0;
/* Determine tiered bitrate variables */
var tier = tiered[file.video_resolution];
bitratecheck = parseInt(tier["bitrate"]);
if (bitrateprobe !== null && bitrateprobe < bitratecheck) {
bitratetarget = parseInt((bitrateprobe * inputs.target_pct_reduction) / 1000);
} else {
bitratetarget = parseInt(tier["bitrate"] / 1000);
}
bitratemax = bitratetarget + tier["max_increase"];
cq = tier["cq"];
configuration.RemoveOutputSetting("-c:v copy");
configuration.AddOutputSetting(
`-c:v hevc_nvenc -rc:v vbr_hq -qmin 0 -cq:v ${cq} -b:v ${bitratetarget}k -maxrate:v ${bitratemax}k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8`
);
configuration.AddInputSetting(inputSettings[file.video_codec_name]);
if (file.video_codec_name === "h264" && file.ffProbeData.streams[0].profile !== "High 10") {
configuration.AddInputSetting("-c:v h264_cuvid");
}
logger.AddError("Transcoding to HEVC using NVidia NVENC");
}
}
loopOverStreamsOfType(file, "video", videoProcess);
if (!configuration.shouldProcess) {
logger.AddSuccess("No video processing necessary");
@ -421,8 +474,10 @@ function buildVideoConfiguration(inputs, file, logger) {
}
//#endregion
function plugin(file, _librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
container: ".mkv",
FFmpegMode: true,
@ -438,26 +493,26 @@ function plugin(file, _librarySettings, inputs) {
var videoSettings = buildVideoConfiguration(inputs, file, logger);
var subtitleSettings = buildSubtitleConfiguration(inputs, file, logger);
response.preset = `${videoSettings.GetInputSettings()},${videoSettings.GetOutputSettings()}`
response.preset = `${videoSettings.GetInputSettings()},${videoSettings.GetOutputSettings()}`
response.preset += ` ${audioSettings.GetOutputSettings()}`
response.preset += ` ${subtitleSettings.GetOutputSettings()}`
response.preset += ` -max_muxing_queue_size 9999`;
// Extra parameters
var id = 0;
var badTypes = ['mov_text', 'eia_608', 'timed_id3', 'mp4s'];
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
if (badTypes.includes(file.ffProbeData.streams[i].codec_name)) {
response.preset += ` -map -0:${i}`;
};
id++;
if (badTypes.includes(file.ffProbeData.streams[i].codec_name)) {
response.preset += ` -map -0:${i}`;
};
id++;
}
// b frames argument
response.preset += ` -bf 5`;
// fix probe size errors
response.preset += ` -analyzeduration 2147483647 -probesize 2147483647`;
response.processFile =
audioSettings.shouldProcess ||
videoSettings.shouldProcess ||

@ -1,3 +1,4 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
/* eslint-disable */
/* eslint max-len: 0 */
@ -5,7 +6,7 @@
/* eslint no-mixed-operators: 0 */
const os = require('os');
function details() {
const details = () => {
return {
id: 'Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac)',
Stage: 'Pre-processing',
@ -18,9 +19,15 @@ function details() {
Audio conversion is either 2 channel ac3 or 6 channel ac3, for maximal compatibility and small file size. All subtitles removed.
The idea is to homogenize your collection to 1080p or higher movies with 5.1 audio, or 720p TV shows with 2.0 audio.`,
Version:'1.0',
Tags: 'pre-processing,ffmpeg,video only,configurable,h265',
Inputs: [{
name: 'audio_channels',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: `Specify whether to modify audio channels.
\\n Leave empty to disable.
\\nExample:\\n
@ -31,6 +38,11 @@ function details() {
},
{
name: 'resize',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
tooltip: `Specify if output file should be reduced to 720p from 1080p. Default is false.
\\nExample:\\n
yes
@ -40,6 +52,11 @@ function details() {
},
{
name: 'bitrate_cutoff',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: `Specify bitrate cutoff, files with a current bitrate lower then this will not be transcoded.
\\n Rate is in kbps.
\\n Leave empty to disable.
@ -54,7 +71,10 @@ function details() {
};
}
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
container: '.mkv',
processFile: false,

@ -1,3 +1,4 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
//////////////////////////////////////////////////////////////////////////////////////////////////////
//
@ -149,7 +150,7 @@
//
//////////////////////////////////////////////////////////////////////////////////////////////////////
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile",
Stage: "Pre-processing",
@ -158,12 +159,15 @@ function details() {
Operation: "Transcode",
Description: "***You should not use this*** until you read the comments at the top of the code and understand how it works **this does alot** and is 1 of 2 routines you should to run **Part 1** \n",
Version: "2.0",
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js",
Tags: "pre-processing,ffmpeg,video,audio,qsv h265,aac"
Tags: "pre-processing,ffmpeg,video,audio,qsv h265,aac",
Inputs:[],
}
}
function plugin(file, librarySettings, inputs, otherArguments) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
processFile: false,

@ -1,3 +1,4 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
//////////////////////////////////////////////////////////////////////////////////////////////////////
//
@ -148,7 +149,7 @@
//
//////////////////////////////////////////////////////////////////////////////////////////////////////
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix",
Stage: "Pre-processing",
@ -157,12 +158,15 @@ function details() {
Operation: "Transcode",
Description: "***You should not use this*** until you read the comments at the top of the code and understand how it works **this does alot** and is 2 of 2 routines you should to run **Part 2** \n",
Version: "2.0",
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js",
Tags: "post-processing,ffmpeg,video"
Tags: "post-processing,ffmpeg,video",
Inputs:[]
}
}
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
processFile: false,

@ -1,22 +1,26 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz1FFMPEG',
Stage: 'Pre-processing',
Name: 'Migz-Transcode Using Nvidia GPU & FFMPEG',
Type: 'Video',
Operation: 'Transcode',
Description: `Files not in H265 will be transcoded into H265 using Nvidia GPU with ffmpeg.
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz1FFMPEG',
Stage: 'Pre-processing',
Name: 'Migz-Transcode Using Nvidia GPU & FFMPEG',
Type: 'Video',
Operation: 'Transcode',
Description: `Files not in H265 will be transcoded into H265 using Nvidia GPU with ffmpeg.
Settings are dependant on file bitrate
Working by the logic that H265 can support the same ammount of data at half the bitrate of H264.
NVDEC & NVENC compatable GPU required.
This plugin will skip any files that are in the VP9 codec.`,
Version: '3.0',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js',
Tags: 'pre-processing,ffmpeg,video only,nvenc h265,configurable',
Inputs: [{
name: 'container',
tooltip: `Specify output container of file
Version: '3.0',
Tags: 'pre-processing,ffmpeg,video only,nvenc h265,configurable',
Inputs: [{
name: 'container',
type: 'string',
defaultValue: 'mkv',
inputUI: {
type: 'text',
},
tooltip: `Specify output container of file
\\n Ensure that all stream types you may have are supported by your chosen container.
\\n mkv is recommended.
\\nExample:\\n
@ -24,10 +28,15 @@ function details() {
\\nExample:\\n
mp4`,
},
{
name: 'bitrate_cutoff',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
{
name: 'bitrate_cutoff',
tooltip: `Specify bitrate cutoff, files with a current bitrate lower then this will not be transcoded.
tooltip: `Specify bitrate cutoff, files with a current bitrate lower then this will not be transcoded.
\\n Rate is in kbps.
\\n Leave empty to disable.
\\nExample:\\n
@ -35,19 +44,29 @@ function details() {
\\nExample:\\n
4000`,
},
{
name: 'enable_10bit',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'enable_10bit',
tooltip: `Specify if output file should be 10bit. Default is false.
tooltip: `Specify if output file should be 10bit. Default is false.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'enable_bframes',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'enable_bframes',
tooltip: `Specify if b frames should be used.
tooltip: `Specify if b frames should be used.
\\n Using B frames should decrease file sizes but are only supported on newer GPUs.
\\n Default is false.
\\nExample:\\n
@ -55,10 +74,15 @@ function details() {
\\nExample:\\n
false`,
},
{
name: 'force_conform',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'force_conform',
tooltip: `Make the file conform to output containers requirements.
tooltip: `Make the file conform to output containers requirements.
\\n Drop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4.
\\n Drop data streams/mov_text/eia_608/timed_id3 for MKV.
\\n Default is false.
@ -67,12 +91,14 @@ function details() {
\\nExample:\\n
false`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -288,6 +314,6 @@ function plugin(file, librarySettings, inputs) {
response.processFile = true;
response.infoLog += 'File is not hevc or vp9. Transcoding. \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,21 +1,25 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz1FFMPEG_CPU',
Stage: 'Pre-processing',
Name: 'Migz-Transcode Using CPU & FFMPEG',
Type: 'Video',
Operation: 'Transcode',
Description: `Files not in H265 will be transcoded into H265 using CPU with ffmpeg.
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz1FFMPEG_CPU',
Stage: 'Pre-processing',
Name: 'Migz-Transcode Using CPU & FFMPEG',
Type: 'Video',
Operation: 'Transcode',
Description: `Files not in H265 will be transcoded into H265 using CPU with ffmpeg.
Settings are dependant on file bitrate
Working by the logic that H265 can support the same ammount of data at half the bitrate of H264.
This plugin will skip any files that are in the VP9 codec.`,
Version: '1.9',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js',
Tags: 'pre-processing,ffmpeg,video only,configurable,h265',
Inputs: [{
name: 'container',
tooltip: `Specify output container of file.
Version: '1.9',
Tags: 'pre-processing,ffmpeg,video only,configurable,h265',
Inputs: [{
name: 'container',
type: 'string',
defaultValue: 'mkv',
inputUI: {
type: 'text',
},
tooltip: `Specify output container of file.
\\n Ensure that all stream types you may have are supported by your chosen container.
\\n mkv is recommended.
\\nExample:\\n
@ -23,10 +27,15 @@ function details() {
\\nExample:\\n
mp4`,
},
{
name: 'bitrate_cutoff',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
{
name: 'bitrate_cutoff',
tooltip: `Specify bitrate cutoff, files with a current bitrate lower then this will not be transcoded.
tooltip: `Specify bitrate cutoff, files with a current bitrate lower then this will not be transcoded.
\\n Rate is in kbps.
\\n Leave empty to disable.
\\nExample:\\n
@ -34,19 +43,29 @@ function details() {
\\nExample:\\n
4000`,
},
{
name: 'enable_10bit',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'enable_10bit',
tooltip: `Specify if output file should be 10bit. Default is false.
tooltip: `Specify if output file should be 10bit. Default is false.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'force_conform',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'force_conform',
tooltip: `Make the file conform to output containers requirements.
tooltip: `Make the file conform to output containers requirements.
\\n Drop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4.
\\n Drop data streams/mov_text/eia_608/timed_id3 for MKV.
\\n Default is false.
@ -55,12 +74,14 @@ function details() {
\\nExample:\\n
false`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -238,6 +259,6 @@ function plugin(file, librarySettings, inputs) {
response.processFile = true;
response.infoLog += 'File is not hevc or vp9. Transcoding. \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,18 +1,22 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz1Remux',
Stage: 'Pre-processing',
Name: 'Migz-Remux container',
Type: 'Video',
Operation: 'Remux',
Description: 'Files will be remuxed into either mkv or mp4. \n\n',
Version: '1.1',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1Remux.js',
Tags: 'pre-processing,ffmpeg,video only,configurable',
Inputs: [{
name: 'container',
tooltip: `Specify output container of file
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz1Remux',
Stage: 'Pre-processing',
Name: 'Migz-Remux container',
Type: 'Video',
Operation: 'Transcode',
Description: 'Files will be remuxed into either mkv or mp4. \n\n',
Version: '1.1',
Tags: 'pre-processing,ffmpeg,video only,configurable',
Inputs: [{
name: 'container',
type: 'string',
defaultValue: 'mkv',
inputUI: {
type: 'text',
},
tooltip: `Specify output container of file
\\nEnsure that all stream types you may have are supported by your chosen container.
\\nmkv is recommended.
\\nExample:\\n
@ -20,10 +24,15 @@ function details() {
\\nExample:\\n
mp4`,
},
{
name: 'force_conform',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
{
name: 'force_conform',
tooltip: `Make the file conform to output containers requirements.
tooltip: `Make the file conform to output containers requirements.
\\n Drop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4.
\\n Drop data streams/mov_text/eia_608/timed_id3 for MKV.
\\n Default is false.
@ -32,12 +41,14 @@ function details() {
\\nExample:\\n
false`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -69,7 +80,7 @@ function plugin(file, librarySettings, inputs) {
// Check if force_conform option is checked.
// If so then check streams and add any extra parameters required to make file conform with output format.
if (inputs.force_conform === 'true') {
if (inputs.force_conform === true) {
if (inputs.container.toLowerCase() === 'mkv') {
extraArguments += '-map -0:d ';
for (let i = 0; i < file.ffProbeData.streams.length; i++) {
@ -127,6 +138,6 @@ function plugin(file, librarySettings, inputs) {
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,35 +1,50 @@
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz2CleanTitle',
Stage: 'Pre-processing',
Name: 'Migz-Clean title metadata',
Type: 'Video',
Operation: 'Clean',
Description: 'This plugin removes title metadata from video/audio/subtitles.\n\n',
Version: '1.9',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js',
Tags: 'pre-processing,ffmpeg,configurable',
Inputs: [{
name: 'clean_audio',
tooltip: `Specify if audio titles should be checked & cleaned. Optional.
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz2CleanTitle',
Stage: 'Pre-processing',
Name: 'Migz-Clean title metadata',
Type: 'Video',
Operation: 'Transcode',
Description: 'This plugin removes title metadata from video/audio/subtitles.\n\n',
Version: '1.9',
Tags: 'pre-processing,ffmpeg,configurable',
Inputs: [{
name: 'clean_audio',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
tooltip: `Specify if audio titles should be checked & cleaned. Optional.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'clean_subtitles',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
{
name: 'clean_subtitles',
tooltip: `Specify if subtitle titles should be checked & cleaned. Optional.
tooltip: `Specify if subtitle titles should be checked & cleaned. Optional.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'custom_title_matching',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
{
name: 'custom_title_matching',
tooltip: `If you enable audio or subtitle cleaning the plugin only looks for titles with more then 3 full stops.
tooltip: `If you enable audio or subtitle cleaning the plugin only looks for titles with more then 3 full stops.
//nThis is one way to identify junk metadata without removing real metadata that you might want.
//nHere you can specify your own text for it to also search for to match and remove.
//nComma separated. Optional.
@ -38,12 +53,14 @@ function details() {
\\nExample:\\n
MiNX - Small HD episodes,GalaxyTV - small excellence!`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -64,7 +81,7 @@ function plugin(file, librarySettings, inputs) {
let custom_title_matching = '';
// Check if inputs.custom_title_matching has been configured. If it has then set variable
if (typeof inputs.custom_title_matching !== 'undefined') {
if (inputs.custom_title_matching !== '') {
custom_title_matching = inputs.custom_title_matching.toLowerCase().split(',');
}
@ -122,7 +139,7 @@ function plugin(file, librarySettings, inputs) {
// Then check if any audio streams match with user input custom_title_matching variable, if so then remove.
if (
file.ffProbeData.streams[i].codec_type.toLowerCase() === 'audio'
&& inputs.clean_audio.toLowerCase() === 'true'
&& inputs.clean_audio === true
) {
try {
if (
@ -165,7 +182,7 @@ function plugin(file, librarySettings, inputs) {
// Then check if any streams match with user input custom_title_matching variable, if so then remove.
if (
file.ffProbeData.streams[i].codec_type.toLowerCase() === 'subtitle'
&& inputs.clean_subtitles.toLowerCase() === 'true'
&& inputs.clean_subtitles === true
) {
try {
if (
@ -214,6 +231,6 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += '☑File has no title metadata \n';
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,18 +1,22 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz3CleanAudio',
Stage: 'Pre-processing',
Name: 'Migz-Clean audio streams',
Type: 'Audio',
Operation: 'Clean',
Description: 'This plugin keeps only specified language tracks & can tags tracks with an unknown language. \n\n',
Version: '2.4',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js',
Tags: 'pre-processing,ffmpeg,audio only,configurable',
Inputs: [{
name: 'language',
tooltip: `Specify language tag/s here for the audio tracks you'd like to keep
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz3CleanAudio',
Stage: 'Pre-processing',
Name: 'Migz-Clean audio streams',
Type: 'Audio',
Operation: 'Transcode',
Description: 'This plugin keeps only specified language tracks & can tags tracks with an unknown language. \n\n',
Version: '2.4',
Tags: 'pre-processing,ffmpeg,audio only,configurable',
Inputs: [{
name: 'language',
type: 'string',
defaultValue: 'eng,und',
inputUI: {
type: 'text',
},
tooltip: `Specify language tag/s here for the audio tracks you'd like to keep
\\nRecommended to keep "und" as this stands for undertermined
\\nSome files may not have the language specified.
\\nMust follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
@ -24,19 +28,29 @@ function details() {
\\nExample:\\n
eng,und,jpn`,
},
{
name: 'commentary',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
{
name: 'commentary',
tooltip: `Specify if audio tracks that contain commentary/description should be removed.
tooltip: `Specify if audio tracks that contain commentary/description should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'tag_language',
type: 'string',
defaultValue: 'eng',
inputUI: {
type: 'text',
},
{
name: 'tag_language',
tooltip: `Specify a single language for audio tracks with no language or unknown language to be tagged with.
tooltip: `Specify a single language for audio tracks with no language or unknown language to be tagged with.
\\nYou must have "und" in your list of languages to keep for this to function.
\\nMust follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nLeave empty to disable.
@ -45,22 +59,29 @@ function details() {
\\nExample:\\n
por`,
},
{
name: 'tag_title',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
{
name: 'tag_title',
tooltip: `Specify audio tracks with no title to be tagged with the number of channels they contain.
tooltip: `Specify audio tracks with no title to be tagged with the number of channels they contain.
\\nDo NOT use this with mp4, as mp4 does not support title tags.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -124,7 +145,7 @@ function plugin(file, librarySettings, inputs) {
// AND then checks for stream titles with the following "commentary, description, sdh".
// Removing any streams that are applicable.
if (
inputs.commentary.toLowerCase() === 'true'
inputs.commentary === true
&& file.ffProbeData.streams[i].codec_type.toLowerCase() === 'audio'
&& (file.ffProbeData.streams[i].tags.title
.toLowerCase()
@ -188,7 +209,7 @@ function plugin(file, librarySettings, inputs) {
// AND inputs.tag_title set to true AND if stream type is audio. Add title to any applicable streams.
if (
typeof file.ffProbeData.streams[i].tags.title === 'undefined'
&& inputs.tag_title.toLowerCase() === 'true'
&& inputs.tag_title === true
&& file.ffProbeData.streams[i].codec_type.toLowerCase() === 'audio'
) {
if (file.ffProbeData.streams[i].channels === 8) {
@ -234,6 +255,6 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += "☑File doesn't contain audio tracks which are unwanted or that require tagging.\n";
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,37 +1,51 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz4CleanSubs',
Stage: 'Pre-processing',
Name: 'Migz-Clean subtitle streams',
Type: 'subtitles',
Operation: 'Clean',
Description: 'This plugin keeps only specified language tracks & can tag tracks with an unknown language. \n\n',
Version: '2.4',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js',
Tags: 'pre-processing,ffmpeg,subtitle only,configurable',
Inputs: [{
name: 'language',
tooltip: `Specify language tag/s here for the subtitle tracks you'd like to keep.
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz4CleanSubs',
Stage: 'Pre-processing',
Name: 'Migz-Clean subtitle streams',
Type: 'Subtitle',
Operation: 'Transcode',
Description: 'This plugin keeps only specified language tracks & can tag tracks with an unknown language. \n\n',
Version: '2.4',
Tags: 'pre-processing,ffmpeg,subtitle only,configurable',
Inputs: [{
name: 'language',
type: 'string',
defaultValue: 'eng',
inputUI: {
type: 'text',
},
tooltip: `Specify language tag/s here for the subtitle tracks you'd like to keep.
\\nMust follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
\\nExample:\\n
eng,jpn`,
},
{
name: 'commentary',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
{
name: 'commentary',
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'tag_language',
type: 'string',
defaultValue: 'eng',
inputUI: {
type: 'text',
},
{
name: 'tag_language',
tooltip: `Specify a single language for subtitle tracks with no language or unknown language to be tagged with.
tooltip: `Specify a single language for subtitle tracks with no language or unknown language to be tagged with.
\\nMust follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nLeave empty to disable.
\\nExample:\\n
@ -39,12 +53,14 @@ function details() {
\\nExample:\\n
por`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -105,7 +121,7 @@ function plugin(file, librarySettings, inputs) {
// AND then checks for stream titles with the following "commentary or description".
// Removing any streams that are applicable.
if (
inputs.commentary.toLowerCase() === 'true'
inputs.commentary === true
&& file.ffProbeData.streams[i].codec_type.toLowerCase() === 'subtitle'
&& (file.ffProbeData.streams[i].tags.title
.toLowerCase()
@ -179,6 +195,6 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += "☑File doesn't contain subtitle tracks which are unwanted or that require tagging.\n";
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,28 +1,37 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz5ConvertAudio',
Stage: 'Pre-processing',
Name: 'Migz-Convert audio streams',
Type: 'Audio',
Operation: 'Transcode',
Description: 'This plugin can convert any 2.0 audio track/s to AAC and can create downmixed audio tracks. \n\n',
Version: '2.3',
Link: '',
Tags: 'pre-processing,ffmpeg,audio only,configurable',
Inputs: [{
name: 'aac_stereo',
tooltip: `Specify if any 2.0 audio tracks should be converted to aac for maximum compatability with devices.
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz5ConvertAudio',
Stage: 'Pre-processing',
Name: 'Migz-Convert audio streams',
Type: 'Audio',
Operation: 'Transcode',
Description: 'This plugin can convert any 2.0 audio track/s to AAC and can create downmixed audio tracks. \n\n',
Version: '2.3',
Tags: 'pre-processing,ffmpeg,audio only,configurable',
Inputs: [{
name: 'aac_stereo',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
tooltip: `Specify if any 2.0 audio tracks should be converted to aac for maximum compatability with devices.
\\nOptional.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'downmix',
type: 'boolean',
defaultValue: false,
inputUI: {
type: 'text',
},
{
name: 'downmix',
tooltip: `Specify if downmixing should be used to create extra audio tracks.
tooltip: `Specify if downmixing should be used to create extra audio tracks.
\\nI.e if you have an 8ch but no 2ch or 6ch, create the missing audio tracks from the 8 ch.
\\nLikewise if you only have 6ch, create the missing 2ch from it. Optional.
\\nExample:\\n
@ -30,12 +39,14 @@ function details() {
\\nExample:\\n
false`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
container: `.${file.container}`,
@ -125,7 +136,7 @@ function plugin(file, librarySettings, inputs) {
// Catch error here incase user left inputs.downmix empty.
try {
// Check if inputs.aac_stereo is set to true.
if (inputs.aac_stereo.toLowerCase() === 'true') {
if (inputs.aac_stereo === true) {
// Check if codec_name for stream is NOT aac AND check if channel ammount is 2.
if (
file.ffProbeData.streams[i].codec_name !== 'aac'
@ -153,6 +164,6 @@ function plugin(file, librarySettings, inputs) {
response.processFile = false;
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,20 +1,21 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_Migz6OrderStreams',
Stage: 'Pre-processing',
Name: 'Migz-Order Streams',
Type: 'Streams',
Operation: 'Order',
Description: 'Orders streams into Video first, then Audio (2ch, 6ch, 8ch) and finally Subtitles. \n\n',
Version: '1.3',
Link:
'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js',
Tags: 'pre-processing,ffmpeg,',
};
}
const details = () => ({
id: 'Tdarr_Plugin_MC93_Migz6OrderStreams',
Stage: 'Pre-processing',
Name: 'Migz-Order Streams',
Type: 'Any',
Operation: 'Transcode',
Description: 'Orders streams into Video first, then Audio (2ch, 6ch, 8ch) and finally Subtitles. \n\n',
Version: '1.3',
Tags: 'pre-processing,ffmpeg,',
Inputs: [],
});
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -199,6 +200,6 @@ function plugin(file) {
response.processFile = false;
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,20 +1,21 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
function details() {
return {
id: 'Tdarr_Plugin_MC93_MigzImageRemoval',
Stage: 'Pre-processing',
Name: 'Migz-Remove image formats from file',
Type: 'Video',
Operation: 'Clean',
Description: 'Identify any unwanted image formats in the file and remove those streams. MJPEG & PNG \n\n',
Version: '1.3',
Link:
'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js',
Tags: 'pre-processing,ffmpeg,video only',
};
}
const details = () => ({
id: 'Tdarr_Plugin_MC93_MigzImageRemoval',
Stage: 'Pre-processing',
Name: 'Migz-Remove image formats from file',
Type: 'Video',
Operation: 'Transcode',
Description: 'Identify any unwanted image formats in the file and remove those streams. MJPEG & PNG \n\n',
Version: '1.3',
Tags: 'pre-processing,ffmpeg,video only',
Inputs: [],
});
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: '',
@ -65,6 +66,6 @@ function plugin(file) {
+= "☑File doesn't contain any unwanted image format streams.\n";
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,23 +1,28 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
module.exports.dependencies = [
'request',
];
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_MC93_MigzPlex_Autoscan',
Stage: 'Post-processing',
Name: 'Send request for file to be scanned by plex_autoscan.',
Type: 'Video',
Operation: '',
Description: 'Send request for file to be scanned by plex_autoscan. https://github.com/l3uddz/plex_autoscan \n\n',
Version: '1.2',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js',
Tags: '3rd party,post-processing,configurable',
const details = () => ({
id: 'Tdarr_Plugin_MC93_MigzPlex_Autoscan',
Stage: 'Post-processing',
Name: 'Send request for file to be scanned by plex_autoscan.',
Type: 'Video',
Operation: 'Transcode',
Description: 'Send request for file to be scanned by plex_autoscan. https://github.com/l3uddz/plex_autoscan \n\n',
Version: '1.2',
Tags: '3rd party,post-processing,configurable',
Inputs: [{
name: 'autoscan_address',
tooltip: `
Inputs: [{
name: 'autoscan_address',
type: 'string',
defaultValue: 'http://192.168.0.10',
inputUI: {
type: 'text',
},
tooltip: `
Enter the IP address/URL for autoscan. Must include http(s)://
\\nExample:\\n
@ -25,29 +30,41 @@ module.exports.details = function details() {
\\nExample:\\n
https://subdomain.domain.tld`,
},
{
name: 'autoscan_port',
type: 'string',
defaultValue: '3468',
inputUI: {
type: 'text',
},
{
name: 'autoscan_port',
tooltip: `
tooltip: `
Enter the port Autoscan is using, default is 3468
\\nExample:\\n
3468`,
},
{
name: 'autoscan_passkey',
type: 'string',
defaultValue: '9c4b81fe234e4d6eb9011cefe514d915',
inputUI: {
type: 'text',
},
{
name: 'autoscan_passkey',
tooltip: `
tooltip: `
Enter the autoscan passkey.
\\nExample:\\n
9c4b81fe234e4d6eb9011cefe514d915`,
},
],
};
};
},
],
});
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// eslint-disable-next-line global-require,import/no-unresolved
const request = require('request');
@ -100,3 +117,6 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
return undefined;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,22 +1,25 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs",
Stage: "Pre-processing",
Name: "MichPass-Remove subtitle and audio streams with certain codecs",
Type: "subtitles and audio",
Operation: "Clean",
Type: "Any",
Operation: 'Transcode',
Description: `This plugin removed specified codecs from subtitle and audio tracks. Helpful to remove bitmap subtitles (pgs,vobsub) or audio codec (truehd), which can cause Plex to start transcoding. Based on Migz4 Plugin. Thanks \n\n`,
Version: "1.0",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js",
Tags: "pre-processing,ffmpeg,subtitle, audio,configurable",
Inputs: [
{
name: "tag_subtitle_codecs",
tooltip: `Specify key words here for subtitle tracks you'd like to have removed. Do not leave empty, enter a dummy value is not used yyy,zzz
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: `Specify key words here for subtitle tracks you'd like to have removed.
\\nExample:\\n
hdmv_pgs_subtitle
\\nExample:\\n
@ -25,8 +28,12 @@ function details() {
{
name: "tag_audio_codecs",
tooltip: `Specify all audio codecs you'd like to have removed. Do not leave empty, enter a dummy value is not used yyy,zzz
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: `Specify all audio codecs you'd like to have removed.
\\nExample:\\n
truehd
\\nExample:\\n
@ -36,8 +43,10 @@ function details() {
};
}
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
processFile: false,
preset: "",
@ -131,5 +140,6 @@ function plugin(file, librarySettings, inputs) {
return response;
}
module.exports.details = details;
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,10 +1,11 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
const vaapiPrefix = ` -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi `;
module.exports.details = function details() {
const details = () => {
return {
id: `Tdarr_Plugin_Mthr_VaapiHEVCTranscode`,
Stage: `Pre-processing`,
Stage: 'Pre-processing',
Name: `FFMPEG VAAPI HEVC Transcode`,
Type: `Video`,
Operation: `Transcode`,
@ -12,18 +13,27 @@ module.exports.details = function details() {
`Intel QuickSync-enabled CPU required, recommended 8th generation or newer.\n ` +
`Output bitrate will be calculated based on input file size.\n\n`,
Version: `1.0`,
Link: `https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js`,
Tags: `pre-processing,ffmpeg,video only,h265,configurable`,
Inputs: [{
name: `remuxOnly`,
type: 'string',
defaultValue:'false',
inputUI: {
type: 'text',
},
tooltip: `Specify whether this plugin should only run on files with Remux in their names. ` +
`Valid options are true or false. Defaults to false. ` +
`Valid options are true or false.` +
`\\nExample: ` +
`\\ntrue ` +
`\\nExample: ` +
`\\nfalse`
},{
name: `minBitrate`,
type: 'string',
defaultValue:'',
inputUI: {
type: 'text',
},
tooltip: `Specify the minimum bitrate at which this plugin will run. Files with a current bitrate ` +
`lower than this cutoff will not be transcoded. Leave blank to disable. ` +
`\\nExample: ` +
@ -32,7 +42,10 @@ module.exports.details = function details() {
}
}
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
processFile: false,
preset: ``,
@ -105,3 +118,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
}
return response;
}
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,3 +1,4 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
//PLugin runs multipass loudnorm filter
//first run gets the required details and stores for the next pass
@ -15,48 +16,57 @@ var secondPass = false;
var logOutFile = '';
var fs = require('fs');
var path = require('path');
if (fs.existsSync(path.join(process.cwd(), '/npm'))) {
var rootModules = path.join(process.cwd(), '/npm/node_modules/')
} else {
var rootModules = ''
}
const importFresh = require(rootModules + 'import-fresh');
const library = importFresh('../methods/library.js')
const ffprobePath = require(rootModules + 'ffprobe-static').path;
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation",
Stage: 'Pre-processing',
Name: "2 Pass Loudnorm Volume Normalisation",
Type: "Video",
Operation: "Transcode",
Description: "PLEASE READ FULL DESCRIPTION BEFORE USE \n Uses multiple passes to normalise audio streams of videos using loudnorm.\n\n The first pass will create an log file in the same directory as the video.\nSecond pass will apply the values determined in the first pass to the file.\nOutput will be MKV to allow metadata to be added for tracking normalisation stage.",
Version: "0.1",
Link: "",
Tags: "pre-processing,ffmpeg,configurable",
Inputs: [
//(Optional) Inputs you'd like the user to enter to allow your plugin to be easily configurable from the UI
{
name: "i",
type: 'string',
defaultValue:'-23.0',
inputUI: {
type: 'text',
},
tooltip: `\"I\" value used in loudnorm pass \n
defaults to -23.0`, //Each line following `Example:` will be clearly formatted. \\n used for line breaks
},
{
name: "lra",
type: 'string',
defaultValue:'7.0',
inputUI: {
type: 'text',
},
tooltip: `Desired lra value. \n Defaults to 7.0
`,
},
{
name: "tp",
type: 'string',
defaultValue:'-2.0',
inputUI: {
type: 'text',
},
tooltip: `Desired \"tp\" value. \n Defaults to -2.0
`,
},
{
name: "offset",
type: 'string',
defaultValue:'0.0',
inputUI: {
type: 'text',
},
tooltip: `Desired "offset" value. \n Defaults to 0.0
`,
},
@ -64,7 +74,10 @@ module.exports.details = function details() {
}
}
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object at some point
var response = {
@ -211,3 +224,9 @@ module.exports.onTranscodeError = function onTranscodeError(
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,6 +1,7 @@
/* eslint-disable */
var fs = require('fs');
var path = require('path');
const loadDefaultValues = require('../methods/loadDefaultValues');
if (fs.existsSync(path.join(process.cwd(), '/npm'))) {
var rootModules = path.join(process.cwd(), '/npm/node_modules/')
} else {
@ -10,20 +11,24 @@ if (fs.existsSync(path.join(process.cwd(), '/npm'))) {
const importFresh = require(rootModules + 'import-fresh');
const library = importFresh('../methods/library.js')
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid",
Stage: 'Pre-processing',
Name: "Set file permissions for UnRaid",
Type: "Video",
Operation: "Transcode",
Description: "Sets file permissions using chown nobody:users to prevent lock from root. Use at end of stack. ",
Version: "",
Link: "",
Tags: "post-processing"
Tags: "post-processing",
Inputs:[],
}
}
module.exports.plugin = function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object at some point
var response = {
@ -52,3 +57,7 @@ module.exports.plugin = function plugin(file) {
return response
}
}
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,30 +1,33 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
// This is almost a line for line copy of Migz1FFMPEG
// https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js
// Seriously, all I did was make it work for converting things to h264 instead of hevc
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264',
Stage: 'Pre-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed.
Name: 'Smoove-Transcode to H264 using FFMPEG and NVENC ',
Type: 'Video',
Operation: 'Transcode',
Description: `Files not in H264 will be transcoded into H264 using Nvidia GPU with ffmpeg.
const details = () => ({
id: 'Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264',
Stage: 'Pre-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed.
Name: 'Smoove-Transcode to H264 using FFMPEG and NVENC ',
Type: 'Video',
Operation: 'Transcode',
Description: `Files not in H264 will be transcoded into H264 using Nvidia GPU with ffmpeg.
Settings are dependant on file bitrate
NVDEC & NVENC compatable GPU required.`,
Version: '1.00',
Link: `https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/
Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js`,
Tags: 'pre-processing,ffmpeg,video only,nvenc h264,configurable',
// Provide tags to categorise your plugin in the plugin browser.Tag options: h265,hevc,h264,nvenc h265,
// nvenc h264,video only,audio only,subtitle only,handbrake,ffmpeg
// radarr,sonarr,pre-processing,post-processing,configurable
Inputs: [
{
name: 'container',
tooltip: `Specify output container of file
Version: '1.00',
Tags: 'pre-processing,ffmpeg,video only,nvenc h264,configurable',
// Provide tags to categorise your plugin in the plugin browser.Tag options: h265,hevc,h264,nvenc h265,
// nvenc h264,video only,audio only,subtitle only,handbrake,ffmpeg
// radarr,sonarr,pre-processing,post-processing,configurable
Inputs: [
{
name: 'container',
type: 'string',
defaultValue: 'mkv',
inputUI: {
type: 'text',
},
tooltip: `Specify output container of file
\\n Ensure that all stream types you may have are supported by your chosen container.
\\n mkv is recommended.
\\nExample:\\n
@ -32,10 +35,15 @@ module.exports.details = function details() {
\\nExample:\\n
mp4`,
},
{
name: 'force_conform',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'force_conform',
tooltip: `Make the file conform to output containers requirements.
tooltip: `Make the file conform to output containers requirements.
\\n Drop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4.
\\n Drop data streams/mov_text/eia_608/timed_id3 for MKV.
\\n Default is false.
@ -44,12 +52,14 @@ module.exports.details = function details() {
\\nExample:\\n
false`,
},
],
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
},
],
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
infoLog: '',
@ -218,3 +228,6 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
response.infoLog += 'File is not h264. Transcoding. \n';
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,27 +1,30 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable linebreak-style */
module.exports.dependencies = [
'request',
];
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_TD01_TOAD_Autoscan',
Stage: 'Post-processing',
Name: 'Trigger Plex_Autoscan.',
Type: 'Video',
Operation: '',
Description: `Connects to plex_autoscan and triggers a manual search within the files directory.\n\n
const details = () => ({
id: 'Tdarr_Plugin_TD01_TOAD_Autoscan',
Stage: 'Post-processing',
Name: 'Trigger Plex_Autoscan.',
Type: 'Video',
Operation: 'Transcode',
Description: `Connects to plex_autoscan and triggers a manual search within the files directory.\n\n
Works with the hotio autoscan docker that can be found here https://hotio.dev/containers/autoscan/ which \n\n
is based on https://github.com/cloudbox/autoscan`,
Version: '1.0',
Link: '',
Tags: '3rd party,post-processing,configurable',
Version: '1.0',
Tags: '3rd party,post-processing,configurable',
Inputs: [{
name: 'autoscan_address',
defaultValue: 'http://192.168.0.10',
tooltip: `
Inputs: [{
name: 'autoscan_address',
type: 'string',
defaultValue: 'http://192.168.0.10',
inputUI: {
type: 'text',
},
tooltip: `
Enter the IP address/URL for autoscan. Must include http(s)://
\\nExample:\\n
@ -29,39 +32,53 @@ module.exports.details = function details() {
\\nExample:\\n
https://subdomain.domain.tld`,
},
{
name: 'autoscan_port',
type: 'string',
defaultValue: '3486',
inputUI: {
type: 'text',
},
{
name: 'autoscan_port',
defaultValue: '3486',
tooltip: `
tooltip: `
Enter the port Autoscan is using, default is 3468
\\nExample:\\n
3468`,
},
{
name: 'autoscan_username',
type: 'string',
defaultValue: 'Batman',
inputUI: {
type: 'text',
},
{
name: 'autoscan_username',
defaultValue: 'Batman',
tooltip: `
tooltip: `
If authentication is configured, specify the username
\\nExample:\\n
Batman`,
},
{
name: 'autoscan_password',
type: 'string',
defaultValue: 'SecretPassword',
inputUI: {
type: 'text',
},
{
name: 'autoscan_password',
defaultValue: 'SecretPassword',
tooltip: `
tooltip: `
If authentication is configured, specify the password
\\nExample:\\n
SecretPassword`,
},
],
};
};
},
],
});
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// eslint-disable-next-line global-require,import/no-unresolved,import/no-extraneous-dependencies
const request = require('request');
// Set up required variables.
@ -106,3 +123,6 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
});
return undefined;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,56 +1,95 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint max-classes-per-file: ["error", 2] */
function details() {
return {
id: 'Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass',
Stage: 'Pre-processing',
Name: 'VP9 Encoding Match Bitrate 1 Pass System',
Type: 'Video',
Operation: 'Transcode',
Description: `Will run through linvpx-vp9 and follow the contrained quality contraints. Will also encode audio to
const details = () => ({
id: 'Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass',
Stage: 'Pre-processing',
Name: 'VP9 Encoding Match Bitrate 1 Pass System',
Type: 'Video',
Operation: 'Transcode',
Description: `Will run through linvpx-vp9 and follow the contrained quality contraints. Will also encode audio to
opus using libopus. Allows user-input on the desired constrained quality amount for each video resolution with
defaults if none are given.`,
Version: '1.00',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js',
Tags: 'pre-processing,ffmpeg,vp9',
Inputs: [
{
name: 'CQ_240p',
tooltip:
Version: '1.00',
Tags: 'pre-processing,ffmpeg,vp9',
Inputs: [
{
name: 'CQ_240p',
type: 'string',
defaultValue: '32',
inputUI: {
type: 'text',
},
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 32',
},
{
name: 'CG_360p',
type: 'string',
defaultValue: '31',
inputUI: {
type: 'text',
},
{
name: 'CG_360p',
tooltip:
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 31',
},
{
name: 'CQ_480p',
type: 'string',
defaultValue: '28',
inputUI: {
type: 'text',
},
{
name: 'CQ_480p',
tooltip:
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 28',
},
{
name: 'CQ_720p',
type: 'string',
defaultValue: '27',
inputUI: {
type: 'text',
},
{
name: 'CQ_720p',
tooltip:
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 27',
},
{
name: 'CQ_1080p',
type: 'string',
defaultValue: '26',
inputUI: {
type: 'text',
},
{
name: 'CQ_1080p',
tooltip:
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 26',
},
{
name: 'CQ_4KUHD',
type: 'string',
defaultValue: '15',
inputUI: {
type: 'text',
},
{
name: 'CQ_4KUHD',
tooltip:
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 15',
},
{
name: 'CQ_8KUHD',
type: 'string',
defaultValue: '15',
inputUI: {
type: 'text',
},
{
name: 'CQ_8KUHD',
tooltip:
tooltip:
'The CQ number (recommended 15-35) for this resolution, default 15',
},
{
name: 'audio_language',
type: 'string',
defaultValue: 'eng,und',
inputUI: {
type: 'text',
},
{
name: 'audio_language',
tooltip: `
tooltip: `
Specify language tag/s here for the audio tracks you'd like to keep, recommended to keep "und" as this\\n
stands for undertermined, some files may not have the language specified. Must follow ISO-639-2 3 letter\\n
format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
@ -60,43 +99,62 @@ function details() {
eng,und
\\nExample:\\n
eng,und,jap`,
},
{
name: 'audio_commentary',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'audio_commentary',
tooltip: `Specify if audio tracks that contain commentary/description should be removed.
tooltip: `Specify if audio tracks that contain commentary/description should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'subtitle_language',
type: 'string',
defaultValue: 'eng',
inputUI: {
type: 'text',
},
{
name: 'subtitle_language',
tooltip: `Specify language tag/s here for the subtitle tracks you'd like to keep. Must follow ISO-639-2 3 \\n
tooltip: `Specify language tag/s here for the subtitle tracks you'd like to keep. Must follow ISO-639-2 3 \\n
letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
\\nExample:\\n
eng,jap`,
},
{
name: 'subtitle_commentary',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'subtitle_commentary',
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
{
name: 'remove_mjpeg',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'remove_mjpeg',
tooltip: `Specify if mjpeg codecs should be removed.
tooltip: `Specify if mjpeg codecs should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`,
},
],
};
}
},
],
});
// #region Helper Classes/Modules
@ -442,7 +500,10 @@ function buildSubtitleConfiguration(inputs, file, logger) {
return configuration;
}
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object
const response = {
container: '.webm',
@ -472,7 +533,7 @@ function plugin(file, librarySettings, inputs) {
${audioSettings.GetOutputSettings()} ${subtitleSettings.GetOutputSettings()}`;
response.infoLog += logger.GetLogData();
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,20 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta",
Stage: "Pre-processing",
Name: "Drawmonster MP4 No title meta data ",
Type: "Video",
Description: `[Contains built-in filter] This plugin removes metadata (if a title exists). The output container is mp4. \n\n
`,
Operation: 'Transcode',
Description: `[Contains built-in filter] This plugin removes metadata (if a title exists). The output container is mp4. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js",
Tags: "pre-processing,ffmpeg",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,21 +1,26 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30",
Stage: "Pre-processing",
Name:
"HaveAGitGat HandBrake VeryFast1080p30, No title meta, no subs, 192Kb AAC stereo,MP4 ",
Type: "Video",
Operation: 'Transcode',
Description: `[Contains built-in filter] This plugin transcodes into H264 using HandBrake's 'Very Fast 1080p30' preset if the file is not in H264 already. It removes subs, metadata (if a title exists) and adds a stereo 192kbit AAC track if an AAC track (any) doesn't exist. The output container is MP4. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js",
Tags: "pre-processing,handbrake,ffmpeg,h264",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,21 +1,25 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30",
Stage: "Pre-processing",
Name:
"HaveAGitGat HandBrake Fast1080p30, No title meta, no subs, 192Kb AAC stereo,MP4 ",
Type: "Video",
Operation: 'Transcode',
Description: `[Contains built-in filter] This plugin transcodes into H264 using HandBrake's 'Fast 1080p30' preset if the file is not in H264 already. It removes subs, metadata (if a title exists) and adds a stereo 192kbit AAC track if an AAC track (any) doesn't exist. The output container is MP4. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js",
Tags: "pre-processing,handbrake,ffmpeg,h264",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,28 +1,37 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs",
Stage: "Pre-processing",
Name: "Transcode Specific Audio Stream Codecs",
Type: "",
Type: "Audio",
Operation: "Transcode",
Description: `[Contains built-in filter] Transcode audio streams with specific codecs into another codec. \n\n`,
Version: "1.00",
Link: "",
Tags: "pre-processing,audio only,ffmpeg,configurable",
Inputs: [
{
name: "codecs_to_transcode",
type: 'string',
defaultValue: 'ac3',
inputUI: {
type: 'text',
},
tooltip: `Specifiy the codecs which you'd like to transcode
\\nExample:\\n
ac3
\\nExample:\\n
eac3,ac3,aac
`,
},
{
name: "codec",
type: 'string',
defaultValue: 'aac',
inputUI: {
type: 'text',
},
tooltip: `Specify the codec you'd like to transcode into:
\\n aac
\\n ac3
@ -39,6 +48,11 @@ module.exports.details = function details() {
},
{
name: "bitrate",
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: `Specify the transcoded audio bitrate (optional):
\\n 384k
\\n 640k
@ -51,7 +65,10 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {
@ -92,7 +109,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
)
) {
ffmpegCommand += ` -map 0:${i} -c:${i} ${encoder} `;
if (inputs.bitrate != undefined) {
if (inputs.bitrate !== '') {
ffmpegCommand += `-b:a ${inputs.bitrate} `;
}
hasStreamsToTranscode = true;
@ -119,3 +136,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta",
Stage: "Pre-processing",
Name: "Nosirus h265, aac, no meta, subs kept",
Type: "Video",
Operation: 'Transcode',
Description: `[Contains built-in filter] If the file is not in h265 it will be trancoded into h265 with FFmpeg using the following command '-e x265 -q 22 --encoder-preset slow --all-audio --all-subtitles copy:aac -E fdk_aac -Q 4 -x aq-mode=3'. If no aac, aac track will be added. Subtitles are kept. Metadata is removed.\n\n
`,
Version: "1.01",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js",
Tags: "pre-processing,ffmpeg,h265,",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3",
Stage: "Pre-processing",
Name: "the1poet Video surround sound to ac3",
Type: "Video",
Operation: 'Transcode',
Description: `[Contains built-in filter] If the file has surround sound tracks not in ac3, they will be converted to ac3. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js",
Tags: "pre-processing,ffmpeg,audio only,",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_c0r1_SetDefaultAudioStream",
Stage: "Pre-processing",
@ -8,13 +9,16 @@ module.exports.details = function details() {
Operation: "Transcode",
Description: `This plugin will set an audio channel (2.0, 5.1, 7.1) to default and remove default from all other audio streams \n\n`,
Version: "0.1.0a",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js",
Tags: "audio only,ffmpeg,configurable",
Inputs: [
{
name: "channels",
type: 'string',
defaultValue:'2',
inputUI: {
type: 'text',
},
tooltip: `Desired audio channel number.
\\nExample:\\n
@ -33,7 +37,10 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
processFile: false,
preset: "",
@ -110,3 +117,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
}
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV",
Stage: "Pre-processing",
@ -8,13 +9,15 @@ function details() {
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin uses different FFMPEG NVENC transcoding settings for 480p,576p,720p,1080p and 4KUHD. If files are not in hevc they will be transcoded. The output container is mkv. \n\n`,
Version: "1.09",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js",
Tags: "pre-processing,ffmpeg,video only,nvenc h265",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var transcode = 0; //if this var changes to 1 the file will be transcoded
var bitrateprobe = 0; //bitrate from ffprobe
var bitratetarget = 0;

@ -1,18 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix",
Stage: "Pre-processing",
Name: "Mjpeg Stream False Not A Video Fixer",
Type: "Video",
Operation: "",
Operation: 'Transcode',
Description: `Checks if file is not a video file due to Mjpeg stream. Removes Mjpeg Stream \n\n`,
Version: "1.00",
Tags: "pre-processing,ffmpeg,",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var transcode = 0; //if this var changes to 1 the file will be transcoded
//default values that will be returned
var response = {

@ -1,19 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4",
Stage: "Pre-processing",
Name:
"Dallas FFmpeg h264 mp4. Video: h264/mp4, Subs: Convert to mov_text or drop, Audio: aac",
Type: "Video",
Operation: 'Transcode',
Description: `This plugin transcodes into H264 with an MP4 container using the FFmpeg preset you select (slow,medium,fast,veryfast). It maintains all compatible subtitles and audio tracks. Drops picture tracks such as mjpeg\n\n`,
Version: "1.00",
Link:
"https://github.com/JackDallas/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js",
Tags: "pre-processing,ffmpeg,h264,video only,configurable",
Inputs: [
{
name: "FFmpeg_preset",
type: 'string',
defaultValue: 'medium ',
inputUI: {
type: 'text',
},
tooltip: `Select the FFmpeg preset you wish to use,(slow,medium,fast,veryfast).
\\nExample:\\n
@ -52,7 +57,10 @@ function getPreset(preset) {
const GOOD = true;
const BAD = false;
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
processFile: false,
preset: "",

@ -1,7 +1,9 @@
/* eslint-disable */
function details() {
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => {
return {
id: "Tdarr_Plugin_drdd_standardise_all_in_one",
Stage: "Pre-processing",
Name: "DrDD H265 MKV AC3 audio subtitles [QSV & NVENC]",
Stage: "Pre-processing",
Type: "Video",
@ -13,21 +15,41 @@ function details() {
Inputs: [
{
name: "nvenc",
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
tooltip:
"If the NVidia NVENC encoder should be used. Requires an NVidia GPU with NVENC capabilties.\\nValid values: true / false\\nDefault: false",
},
{
name: "qsv",
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
tooltip:
"If Intel Quick Sync should be used. Requires an Intel CPU with Quick Sync capabilties.\\nValid values: true / false\\nDefault: false",
},
{
name: "minimum_target_bitrate",
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip:
"The minimum RESULTING bitrate allowed for a file. Any target bitrate lower than this will cause transcoding to be skipped.\\nExample value: 3000",
},
{
name: "wanted_subtitle_languages",
type: 'string',
defaultValue: 'eng,fre',
inputUI: {
type: 'text',
},
tooltip:
"The comma separated subtitle languages (in 3 letter format) you'd like to keep. If left blank, all subtitles will be kept.\\nExample value: eng,fre",
},
@ -385,7 +407,10 @@ function buildVideoConfiguration(inputs, file, logger) {
//#endregion
function plugin(file, _librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var response = {
container: ".mkv",
FFmpegMode: true,

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta",
Stage: "Pre-processing",
Name: "H.264 MKV 480p30, No Subs No, Title Meta",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes subs, metadata (if a title exists) and makes sure the video is h264 480p mkv. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js",
Tags: "pre-processing,handbrake,ffmpeg,h264",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta",
Stage: "Pre-processing",
Name: "H.264 MKV 720p30, No Subs No, Title Meta",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes subs, metadata (if a title exists) and makes sure the video is h264 720p mkv. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js",
Tags: "pre-processing,handbrake,ffmpeg,h264",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta",
Stage: "Pre-processing",
Name: "H.264 MKV 1080p30, No Subs No, Title Meta",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes subs, metadata (if a title exists) and makes sure the video is h264 1080p mkv. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js",
Tags: "pre-processing,handbrake,ffmpeg,h264",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,33 +1,45 @@
/* eslint-disable */
const fs = require("fs");
const execSync = require("child_process").execSync;
const loadDefaultValues = require('../methods/loadDefaultValues');
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_e5c3_CnT_Add_Subtitles",
Stage: "Pre-processing",
Name: "Add subtitles to MKV files",
Type: "Video",
Operation: "Remux",
Operation: 'Transcode',
Description: `This plugin will check for subtitles, they should be named according to the ISO 639-2 language code.\nA subtitle could look like this: eng.srt\n If there are subtitles found they will be added with FFMPEG, if there are no subs of that language found.\n On first run node module iso-639-2 will be installed in the documents folder.\n Created by @control#0405`,
Version: "1.3",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js",
Tags: "pre-processing,ffmpeg,subtitle only,configurable",
Inputs: [
{
name: "install_packages",
type: 'string',
defaultValue:'no',
inputUI: {
type: 'text',
},
tooltip: `Please change this to "yes", it allows the plugin to install the required nodemodule. (iso-639-2) \\nExample:\\n yes`,
},
{
name: "container",
type: 'string',
defaultValue:'.mkv',
inputUI: {
type: 'text',
},
tooltip: `Enter the output container of the new file.\\n Default: .mkv\\nExample:\\n.mkv`,
},
],
};
}
function plugin(file, librarySettings, inputs, otherArguments) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//default response
var response = {
processFile: false,

@ -1,38 +1,55 @@
/* eslint-disable */
const exec = require("child_process").exec;
const fs = require("fs");
const loadDefaultValues = require('../methods/loadDefaultValues');
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio",
Stage: "Pre-processing",
Name: "Keep Preffered Audio",
Type: "Audio",
Operation: "Remove Audio",
Operation: 'Transcode',
Description:
"Plugin that checks for unwanted audio, per 1.104 beta you can change the languages yourself from within Tdarr!\nUntill you enter a value it keep english tracks by default.\nUndefined languages are kept to prevent videos without sound.\nIf you would like to keep track of the languages you have for each file you can use the 'special' option.\nCreated by @control#0405",
Version: "1.2",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js",
Tags: "pre-processing,ffmpeg,configurable,audio only",
Inputs: [
{
name: "languages",
type: 'string',
defaultValue:'eng,en',
inputUI: {
type: 'text',
},
tooltip: `Desired Languages you would like to keep, language format has to be according to the iso-639-2 standard: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes\\nExample:\\eng,dut`,
},
{
name: "special",
type: 'string',
defaultValue:'',
inputUI: {
type: 'text',
},
tooltip: `This is if you want a specific language to be logged to a file in your Tdarr documents folder.\\nIt will add the name of the file that is being processed if this language(s) has been found.\\nThe file is created the first time it finds a file with the language.\\nThe languages don't have to be in "languages".\\nExample:\\eng,dut`,
},
{
name: "container",
type: 'string',
defaultValue:'.mkv',
inputUI: {
type: 'text',
},
tooltip: `Enter the output container of the new file.\\n Default: .mkv\\nExample:\\n.mkv`,
},
],
};
}
function plugin(file, librarySettings, inputs, otherArguments) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
if (inputs.languages == "" || typeof inputs.special == "undefined") {
var languages = ["eng", "en"]; //these languages should be kept, named according to ISO 639-2 language scheme
} else {

@ -1,8 +1,9 @@
/* eslint-disable */
const fs = require("fs");
const execSync = require("child_process").execSync;
const loadDefaultValues = require('../methods/loadDefaultValues');
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_e5c3_CnT_Remove_Letterbox",
Stage: "Pre-processing",
@ -11,23 +12,34 @@ function details() {
Operation: "Transcode",
Description: `Uses iiDrakeii's filter, and crops video files when letterboxing is detected.\nThis uses the FFMPEG NVENC transcoding(hw).\nIf a file is 4K it will be scaled down to 1080p.\nNow with user definable bitrates!(since 1.104 beta)\nCreated by @control#0405`,
Version: "1.3",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js",
Tags: "pre-processing,ffmpeg,nvenc h265,configurable,h265,video only",
Inputs: [
{
name: "bitrate",
type: 'string',
defaultValue:'3000',
inputUI: {
type: 'text',
},
tooltip: `Desired bitrate for a 1080p video, minimum transcode size is based of this too!\\n 720p will be half of 1080p, 480p will be half of 720p.\\nThe default is '3000', this value is based of movies.\\nI would suggest 1500-2000 for series.\\nExample:\\n3000`,
},
{
name: "container",
type: 'string',
defaultValue:'.mkv',
inputUI: {
type: 'text',
},
tooltip: `Enter the output container of the new file.\\n Default: .mkv\\nExample:\\n.mkv`,
},
],
};
}
function plugin(file, librarySettings, inputs, otherArguments) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
if (inputs.bitrate == "" || inputs.bitrate == "undefined") {
var min_bitrate = 6600;
var avg_rate = 3000;

@ -1,19 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs",
Stage: "Pre-processing",
Name: "Sparticus 4K +AC3 No Subs Original container",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin for 4K video removes subs. If no AC3 track exists, it adds one (max 5.1 channels). If only an AC3 commentary track exists, it adds a new AC3 main track (max 5.1 channels). The output container is the same as the original file. \n\n`,
Version: "1.04",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js",
Tags: "pre-processing,ffmpeg",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,39 +1,65 @@
function details() {
return {
id: 'Tdarr_Plugin_henk_Add_Specific_Audio_Codec',
Stage: 'Pre-processing',
Name: '[MKV ONLY] Transcode given codec to other given codec and keep original',
Type: 'Audio',
Operation: 'Transcode',
Description: 'Re-encodes all audio tracks in a given codec to another given codec and keeps original.',
Version: '1.01',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js',
Tags: 'post-processing,configurable',
const loadDefaultValues = require('../methods/loadDefaultValues');
Inputs: [{
name: 'input_codecs',
tooltip: 'Comma separated list of input codecs to be processed. Defaults to dts.'
const details = () => ({
id: 'Tdarr_Plugin_henk_Add_Specific_Audio_Codec',
Stage: 'Pre-processing',
Name: '[MKV ONLY] Transcode given codec to other given codec and keep original',
Type: 'Audio',
Operation: 'Transcode',
Description: 'Re-encodes all audio tracks in a given codec to another given codec and keeps original.',
Version: '1.01',
Tags: 'post-processing,configurable',
Inputs: [{
name: 'input_codecs',
type: 'string',
defaultValue: 'dts',
inputUI: {
type: 'text',
},
tooltip: 'Comma separated list of input codecs to be processed. Defaults to dts.'
+ '\\nExample:\\n'
+ 'dts,aac,ac3',
}, {
name: 'output_codec',
tooltip: 'FFMPEG encoder used for the output of the new tracks. Defaults to ac3.',
}, {
name: 'bitrate',
tooltip: 'Specifies the (stereo) bitrate for the new audio codec. Defaults to 128k. Only numbers.',
}, {
name: 'auto_adjust',
tooltip: '[true/false] Multi-channel audio requires a higher bitrate for the same quality, '
}, {
name: 'output_codec',
type: 'string',
defaultValue: 'ac3',
inputUI: {
type: 'text',
},
tooltip: 'FFMPEG encoder used for the output of the new tracks. Defaults to ac3.',
}, {
name: 'bitrate',
type: 'string',
defaultValue: '128',
inputUI: {
type: 'text',
},
tooltip: 'Specifies the (stereo) bitrate for the new audio codec in kb. Defaults to 128. Only numbers.',
}, {
name: 'auto_adjust',
type: 'string',
defaultValue: 'true',
inputUI: {
type: 'text',
},
tooltip: '[true/false] Multi-channel audio requires a higher bitrate for the same quality, '
+ 'do you want the plugin to calculate this? (bitrate * (channels / 2))',
}, {
name: 'custom_bitrate_input',
tooltip: 'DIRECT ACCESS TO FFMPEG, USE WITH CAUTION. If filled, can be used for custom bitrate arguments.',
}],
};
}
}, {
name: 'custom_bitrate_input',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: 'DIRECT ACCESS TO FFMPEG, USE WITH CAUTION. If filled, can be used for custom bitrate arguments.',
}],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
preset: ', -c copy -map 0:v ',
@ -112,7 +138,7 @@ function plugin(file, librarySettings, inputs) {
+= '☑File doesn\'t contain audio tracks with the specified codec.\n';
}
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,3 +1,4 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable no-await-in-loop */
module.exports.dependencies = ['axios', '@cospired/i18n-iso-languages', 'path'];
const details = () => ({
@ -12,13 +13,15 @@ const details = () => ({
Radarr, Sonarr to check if the movie/series exists and grabs the IMDB id. As a last resort it
falls back to the IMDB id in the filename.`,
Version: '1.00',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js',
Tags: 'pre-processing,configurable',
Inputs: [
{
name: 'user_langs',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: 'Input a comma separated list of ISO-639-2 languages. It will still keep English and undefined tracks.'
+ '(https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes 639-2 column)'
+ '\\nExample:\\n'
@ -26,30 +29,60 @@ const details = () => ({
},
{
name: 'priority',
type: 'string',
defaultValue: 'Radarr',
inputUI: {
type: 'text',
},
tooltip: 'Priority for either Radarr or Sonarr. Leaving it empty defaults to Radarr first.'
+ '\\nExample:\\n'
+ 'sonarr',
},
{
name: 'api_key',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: 'Input your TMDB api (v3) key here. (https://www.themoviedb.org/)',
},
{
name: 'radarr_api_key',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: 'Input your Radarr api key here.',
},
{
name: 'radarr_url',
type: 'string',
defaultValue: '192.168.1.2:7878',
inputUI: {
type: 'text',
},
tooltip: 'Input your Radarr url here. (Without http://). Do include the port.'
+ '\\nExample:\\n'
+ '192.168.1.2:7878',
},
{
name: 'sonarr_api_key',
type: 'string',
defaultValue: '',
inputUI: {
type: 'text',
},
tooltip: 'Input your Sonarr api key here.',
},
{
name: 'sonarr_url',
type: 'string',
defaultValue: '192.168.1.2:8989',
inputUI: {
type: 'text',
},
tooltip: 'Input your Sonarr url here. (Without http://). Do include the port.'
+ '\\nExample:\\n'
+ '192.168.1.2:8989',
@ -189,7 +222,10 @@ const parseArrResponse = async (body, filePath, arr) => {
}
};
const plugin = async (file, librarySettings, inputs) => {
// eslint-disable-next-line no-unused-vars
const plugin = async (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// eslint-disable-next-line global-require,import/no-unresolved
const axios = require('axios').default;
response.container = `.${file.container}`;

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle",
Stage: "Pre-processing",
Name: "Drawmonster MP4 Stereo AAC, No Subs, No title meta data ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes subs, metadata (if a title exists) and adds a stereo 192kbit AAC track if an AAC track (English or any) doesn't exist. The output container is mp4. \n\n
`,
Version: "1.07",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js",
Tags: "pre-processing,ffmpeg",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle",
Stage: "Pre-processing",
Name: "GilbN MP4 Stereo AAC, No title meta data ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes metadata (if a title exists) and adds a stereo 192kbit AAC track if an AAC track (any) doesn't exist. The output container is mp4. \n\n
`,
Version: "1.01",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js",
Tags: "pre-processing,ffmpeg",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,18 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_lmg1_Reorder_Streams",
Stage: "Pre-processing",
Name: "Tdarr_Plugin_lmg1_Reorder_Streams ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin will move the video stream to the front so Tdarr will recognize the codec correctly.\n\n`,
Version: "1.00",
Link: "https://github.com/luigi311/Tdarr_Plugin_lmg1_Reorder_Streams",
Tags: "pre-processing,ffmpeg",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta",
Stage: "Pre-processing",
Name: "Drawmonster No title meta data ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes metadata (if a title exists). The output container is the same as the original. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js",
Tags: "pre-processing,ffmpeg",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation",
Stage: "Pre-processing",
@ -8,12 +9,15 @@ function details() {
Operation: "Transcode",
Description: `[Contains built-in filter] High Quality FFMPEG transcoding settings for Animation. Converts all audio to AAC 512K. Preserves track names, metadata and attachments/fonts. Proper use of x265-params. CRF 18. Preset medium. 10-Bit Video encoding. Skips h.265 encoded videos. The output container is mkv. \n\n`,
Version: "1.1",
Link: "",
Tags: "pre-processing,ffmpeg,h265,aac,10bit,anime,",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var transcode = 0; //if this var changes to 1 the file will be transcoded
//default values that will be returned

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV",
Stage: "Pre-processing",
@ -8,12 +9,15 @@ function details() {
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin uses different FFmpeg transcoding settings for 480p,576p,720p and 1080p. If files are not in hevc they will be transcoded. The output container is mkv. \n\n`,
Version: "1.01",
Link: "",
Tags: "pre-processing,ffmpeg,h265,video only,",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var transcode = 0; //if this var changes to 1 the file will be transcoded
//default values that will be returned

@ -1,25 +1,29 @@
const fs = require('fs');
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT',
Stage: 'Pre-processing',
Name: 'drpeppershaker Extract embedded subtitles and optionally remove them',
Type: 'Video',
Operation: 'Transcode',
Description: 'This plugin extracts embedded subs in one pass inside Tdarr and will optionally remove them. \n\n '
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT',
Stage: 'Pre-processing',
Name: 'drpeppershaker Extract embedded subtitles and optionally remove them',
Type: 'Video',
Operation: 'Transcode',
Description: 'This plugin extracts embedded subs in one pass inside Tdarr and will optionally remove them. \n\n '
+ 'All processes happen within Tdarr without the use of any exec() functions, which lets the progress bar '
+ 'report the status correctly. AND all subtitles are extracted in one pass, which is much faster than '
+ 'other options.',
// Created by drpeppershaker with help from reddit user /u/jakejones48, lots of
// improvements made after looking at "Tdarr_Plugin_078d" by HaveAGitGat.
Version: '1.04',
Link: '',
Tags: 'pre-processing,subtitle only,ffmpeg,configurable',
Inputs: [
{
name: 'remove_subs',
tooltip: `Do you want to remove subtitles after they are extracted?
// Created by drpeppershaker with help from reddit user /u/jakejones48, lots of
// improvements made after looking at "Tdarr_Plugin_078d" by HaveAGitGat.
Version: '1.04',
Tags: 'pre-processing,subtitle only,ffmpeg,configurable',
Inputs: [
{
name: 'remove_subs',
type: 'string',
defaultValue: 'no',
inputUI: {
type: 'text',
},
tooltip: `Do you want to remove subtitles after they are extracted?
\\nExample:\\n
@ -29,12 +33,14 @@ module.exports.details = function details() {
no
`,
},
],
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs, otherArguments) {
},
],
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object at some point in the function else plugin will fail.
const response = {
processFile: true,
@ -122,3 +128,6 @@ module.exports.plugin = function plugin(file, librarySettings, inputs, otherArgu
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_s710_nick_h265_nvenc_4K",
Stage: "Pre-processing",
Name: "Nick H265 NVENC 4K",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes all 4K videos to h265 using nvenc (if not in h265 already). For 4K and files in other resolutions: If not in mkv the file is remuxed into mkv. If the English language track is not in AC3,EAC3 or DTS then an AC3 track is added.\n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js",
Tags: "pre-processing,ffmpeg,nvenc h265",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_s7x8_winsome_h265",
Stage: "Pre-processing",
Name: "Winsome H265 ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes all videos to h265 (if not in h265 already) and remuxes if not in mkv. If the English language track is not in AC3,EAC3 or DTS then an AC3 track is added.\n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_s7x8_winsome_h265.js",
Tags: "pre-processing,handbrake,ffmpeg,h265",
Inputs:[]
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_s7x9_winsome_h265_10bit",
Stage: "Pre-processing",
Name: "Winsome H265 10 bit ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes all videos to h265 10 bit (if not in h265 already) and remuxes if not in mkv. If the English language track is not in AC3,EAC3 or DTS then an AC3 track is added.\n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js",
Tags: "pre-processing,handbrake,ffmpeg,h265",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_s7x9_winsome_h265_nvenc",
Stage: "Pre-processing",
Name: "Winsome H265 NVENC",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin transcodes all videos to h265 using nvenc (if not in h265 already) and remuxes if not in mkv. If the English language track is not in AC3,EAC3 or DTS then an AC3 track is added.\n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js",
Tags: "pre-processing,handbrake,ffmpeg,nvenc h265",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_sdd3_Remove_Commentary_Tracks",
Stage: "Pre-processing",
Name: "Remove video commentary tracks",
Type: "Video",
Operation: "Remux",
Operation: 'Transcode',
Description: `[Contains built-in filter] If commentary tracks are detected, they will be removed. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js",
Tags: "pre-processing,ffmpeg,audio only",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio",
Stage: "Pre-processing",
Name: "Remove Non English Audio ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes audio tracks which are not English or are not undefined. It ensures at least 1 audio track is left in any language. \n\n
`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js",
Tags: "pre-processing,ffmpeg,audio only",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,19 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_vdka_Remove_DataStreams",
Stage: "Pre-processing",
Name: "Remove Data Streams ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes data streams if detected. The output container is the same as the original. Helps with issues like bin_data making files impossible to process. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js",
Tags: "pre-processing,ffmpeg",
Inputs:[],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,64 +1,92 @@
function details() {
return {
id: 'Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable',
Stage: 'Pre-processing',
Name: 'Tiered FFMPEG CPU CRF Based Configurable',
Type: 'Video',
Operation: 'Transcode',
Description: `[Contains built-in filter] This plugin uses different CRF values depending on resolution,
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable',
Stage: 'Pre-processing',
Name: 'Tiered FFMPEG CPU CRF Based Configurable',
Type: 'Video',
Operation: 'Transcode',
Description: `[Contains built-in filter] This plugin uses different CRF values depending on resolution,
the CRF value is configurable per resolution.
FFmpeg Preset can be configured, uses slow by default.
If files are not in hevc they will be transcoded.
The output container is mkv. \n\n`,
Version: '1.00',
Link:
'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/'
+ ' Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js',
Tags: 'pre-processing,ffmpeg,video only,h265,configurable',
Version: '1.00',
Tags: 'pre-processing,ffmpeg,video only,h265,configurable',
Inputs: [
{
name: 'sdCRF',
tooltip: `Enter the CRF value you want for 480p and 576p content.
Inputs: [
{
name: 'sdCRF',
type: 'string',
defaultValue: '19',
inputUI: {
type: 'text',
},
tooltip: `Enter the CRF value you want for 480p and 576p content.
\n Defaults to 20 (0-51, lower = higher quality, bigger file)
\\nExample:\\n
19`,
},
{
name: 'hdCRF',
type: 'string',
defaultValue: '21',
inputUI: {
type: 'text',
},
{
name: 'hdCRF',
tooltip: `Enter the CRF value you want for 720p content.
tooltip: `Enter the CRF value you want for 720p content.
\n Defaults to 22 (0-51, lower = higher quality, bigger file)
\\nExample:\\n
21`,
},
{
name: 'fullhdCRF',
type: 'string',
defaultValue: '23',
inputUI: {
type: 'text',
},
{
name: 'fullhdCRF',
tooltip: `Enter the CRF value you want for 1080p content.
tooltip: `Enter the CRF value you want for 1080p content.
\n Defaults to 24 (0-51, lower = higher quality, bigger file)
\\nExample:\\n
23`,
},
{
name: 'uhdCRF',
type: 'string',
defaultValue: '26',
inputUI: {
type: 'text',
},
{
name: 'uhdCRF',
tooltip: `Enter the CRF value you want for 4K/UHD/2160p content.
tooltip: `Enter the CRF value you want for 4K/UHD/2160p content.
\n Defaults to 28 (0-51, lower = higher quality, bigger file)
\\nExample:\\n
26`,
},
{
name: 'bframe',
type: 'string',
defaultValue: '8',
inputUI: {
type: 'text',
},
{
name: 'bframe',
tooltip: `Specify amount of b-frames to use, 0-16, defaults to 8.
tooltip: `Specify amount of b-frames to use, 0-16, defaults to 8.
\\nExample:\\n
8`,
},
{
name: 'ffmpegPreset',
type: 'string',
defaultValue: 'slow',
inputUI: {
type: 'text',
},
{
name: 'ffmpegPreset',
tooltip: `Enter the ffmpeg preset you want, leave blank for default (slow)
tooltip: `Enter the ffmpeg preset you want.
\\nExample:\\n
slow
@ -71,26 +99,38 @@ function details() {
\\nExample:\\n
veryfast`,
},
{
name: 'sdDisabled',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'sdDisabled',
tooltip: `Input "true" if you want to skip SD (480p and 576p) files
tooltip: `Input "true" if you want to skip SD (480p and 576p) files
\\nExample:\\n
true`,
},
{
name: 'uhdDisabled',
type: 'string',
defaultValue: 'false',
inputUI: {
type: 'text',
},
{
name: 'uhdDisabled',
tooltip: `Input "true" if you want to skip 4k (UHD) files
tooltip: `Input "true" if you want to skip 4k (UHD) files
\\nExample:\\n
true`,
},
],
};
}
},
],
});
function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
let crf;
// default values that will be returned
const response = {
@ -185,6 +225,6 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += 'File is being transcoded!\n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,5 +1,6 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details () {
const details = () => {
return {
id: 'Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE',
Stage: 'Pre-processing',
@ -13,13 +14,16 @@ function details () {
If files are not in hevc they will be transcoded.
The output container is mkv. \n\n`,
Version: '1.00',
Link:
'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js',
Tags: 'pre-processing,ffmpeg,video only,nvenc h265,configurable',
Inputs: [
{
name: 'sdCQV',
type: 'string',
defaultValue: '21',
inputUI: {
type: 'text',
},
tooltip: `Enter the CQ:V value you want for 480p and 576p content.
\\nExample:\\n
@ -27,6 +31,11 @@ function details () {
},
{
name: 'hdCQV',
type: 'string',
defaultValue: '23',
inputUI: {
type: 'text',
},
tooltip: `Enter the CQ:V value you want for 720p content.
\\nExample:\\n
@ -34,6 +43,11 @@ function details () {
},
{
name: 'fullhdCQV',
type: 'string',
defaultValue: '25',
inputUI: {
type: 'text',
},
tooltip: `Enter the CQ:V value you want for 1080p content.
\\nExample:\\n
@ -41,6 +55,11 @@ function details () {
},
{
name: 'uhdCQV',
type: 'string',
defaultValue: '28',
inputUI: {
type: 'text',
},
tooltip: `Enter the CQ:V value you want for 4K/UHD/2160p content.
\\nExample:\\n
@ -48,6 +67,11 @@ function details () {
},
{
name: 'bframe',
type: 'string',
defaultValue: '0',
inputUI: {
type: 'text',
},
tooltip: `Specify amount of b-frames to use, 0-5. Use 0 to disable. (GPU must support this, turing and newer supports this, except for the 1650)
\\nExample:\\n
@ -55,6 +79,11 @@ function details () {
},
{
name: 'ffmpeg_preset',
type: 'string',
defaultValue: 'slow',
inputUI: {
type: 'text',
},
tooltip: `OPTIONAL, DEFAULTS TO SLOW IF NOT SET
\\n Enter the ffmpeg preset you want, leave blank for default (slow)
\\n This only applies if video is transcoded, video already in h264 will not be transcoded with this setting
@ -75,7 +104,10 @@ function details () {
}
}
module.exports.plugin = function plugin (file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
var transcode = 0 //if this var changes to 1 the file will be transcoded
var subcli = `-c:s copy`
var maxmux = ''
@ -224,4 +256,7 @@ module.exports.plugin = function plugin (file, librarySettings, inputs) {
return response
}
module.exports.details = details
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,19 +1,23 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
function details() {
const details = () => {
return {
id: "Tdarr_Plugin_x7ab_Remove_Subs",
Stage: "Pre-processing",
Name: "Remove subtitles ",
Type: "Video",
Operation: "Transcode",
Description: `[Contains built-in filter] This plugin removes subtitles if detected. The output container is the same as the original. \n\n`,
Version: "1.00",
Link:
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_x7ab_Remove_Subs.js",
Tags: "pre-processing,ffmpeg,subtitle only",
Inputs: [],
};
}
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
//Must return this object
var response = {

@ -1,20 +1,22 @@
function details() {
return {
id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions',
Stage: 'Pre-processing',
Name: 'Remove burned closed captions',
Type: 'Video',
Operation: 'Remux',
Description:
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions',
Stage: 'Pre-processing',
Name: 'Remove burned closed captions',
Type: 'Video',
Operation: 'Transcode',
Description:
'[Contains built-in filter] If detected, closed captions (XDS,608,708) will be removed from streams.',
Version: '1.01',
Link:
'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js',
Tags: 'pre-processing,ffmpeg,subtitle only',
};
}
Version: '1.01',
Tags: 'pre-processing,ffmpeg,subtitle only',
Inputs: [],
});
function plugin(file) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: false,
// eslint-disable-next-line no-useless-escape
@ -46,6 +48,6 @@ function plugin(file) {
response.infoLog += response.processFile ? '☒This file has burnt closed captions \n'
: '☑Closed captions have not been detected on this file \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,22 +1,24 @@
function details() {
return {
id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium',
Stage: 'Pre-processing',
Name: 'TheRealShadoh FFmpeg Subs Medium, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Description: '[Contains built-in filter] This plugin transcodes into H264 using FFmpeg\'s '
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium',
Stage: 'Pre-processing',
Name: 'TheRealShadoh FFmpeg Subs Medium, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter] This plugin transcodes into H264 using FFmpeg\'s '
+ '\'Medium\' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata'
+ ` (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n
`,
Version: '1.00',
Link:
'https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js',
Tags: 'pre-processing,ffmpeg,h264',
};
}
function plugin(file) {
Version: '1.00',
Tags: 'pre-processing,ffmpeg,h264',
Inputs: [],
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object
const response = {
@ -132,7 +134,7 @@ function plugin(file) {
response.infoLog += '☑File meets conditions! \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,20 +1,24 @@
const loadDefaultValues = require('../methods/loadDefaultValues');
/* eslint-disable */
module.exports.details = function details() {
const details = () => {
return {
id: "Tdarr_Plugin_z18s_rename_files_based_on_codec",
Stage: "Post-processing",
Name: "Rename based on codec",
Type: "Video",
Operation: "",
Operation: "Transcode",
Description: `[Contains built-in filter] If the filename contains '264' or '265', this plugin renames 264 files to 265 or vice versa depending on codec. \n\n`,
Version: "1.00",
Link: "",
Tags: "post-processing",
Inputs:[]
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
try {
var fs = require("fs");
var fileNameOld = file._id;
@ -69,3 +73,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
console.log(err);
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,18 +1,21 @@
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution',
Stage: 'Post-processing',
Name: 'Rename based on codec and resolution',
Type: 'Video',
Operation: '',
Description: '[Contains built-in filter]This plugin renames files depending on codec and resolution\n\n',
Version: '1.00',
Link: '',
Tags: 'post-processing',
};
};
module.exports.plugin = function plugin(file) {
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution',
Stage: 'Post-processing',
Name: 'Rename based on codec and resolution',
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter]This plugin renames files depending on codec and resolution\n\n',
Version: '1.00',
Tags: 'post-processing',
Inputs: [],
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
try {
// eslint-disable-next-line global-require
const fs = require('fs');
@ -138,3 +141,6 @@ module.exports.plugin = function plugin(file) {
return undefined;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,22 +1,24 @@
function details() {
return {
id: 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast',
Stage: 'Pre-processing',
Name: 'TheRealShadoh FFmpeg Subs Fast, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Description: '[Contains built-in filter] This plugin transcodes into H264 using '
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast',
Stage: 'Pre-processing',
Name: 'TheRealShadoh FFmpeg Subs Fast, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter] This plugin transcodes into H264 using '
+ 'FFmpeg\'s \'Fast\' preset if the file is not in H264 already. It maintains all subtitles. '
+ `It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n
`,
Version: '1.00',
Link:
'https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js',
Tags: 'pre-processing,ffmpeg,h264',
};
}
function plugin(file) {
Version: '1.00',
Tags: 'pre-processing,ffmpeg,h264',
Inputs: [],
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object
const response = {
@ -132,7 +134,7 @@ function plugin(file) {
response.infoLog += '☑File meets conditions! \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,22 +1,24 @@
function details() {
return {
id: 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow',
Stage: 'Pre-processing',
Name: 'TheRealShadoh FFmpeg Subs Slow, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Description: '[Contains built-in filter] This plugin transcodes into H264 using FFmpeg\'s \'Slow\' preset'
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow',
Stage: 'Pre-processing',
Name: 'TheRealShadoh FFmpeg Subs Slow, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter] This plugin transcodes into H264 using FFmpeg\'s \'Slow\' preset'
+ ' if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), '
+ `and maintains all audio tracks. The output container is MP4. \n\n
`,
Version: '1.00',
Link:
'https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js',
Tags: 'pre-processing,ffmpeg,h264',
};
}
function plugin(file) {
Version: '1.00',
Tags: 'pre-processing,ffmpeg,h264',
Inputs: [],
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object
const response = {
@ -132,7 +134,7 @@ function plugin(file) {
response.infoLog += '☑File meets conditions! \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,23 +1,26 @@
function details() {
return {
id: 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast',
Stage: 'Pre-processing',
Name:
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({
id: 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast',
Stage: 'Pre-processing',
Name:
'TheRealShadoh FFmpeg Subs VeryFast, video MP4, audio AAC, keep subs. ',
Type: 'Video',
Description: '[Contains built-in filter] This plugin transcodes into H264 using FFmpeg\'s \'VeryFast\' preset '
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter] This plugin transcodes into H264 using FFmpeg\'s \'VeryFast\' preset '
+ 'if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), '
+ `and maintains all audio tracks. The output container is MP4. \n\n
`,
Version: '1.00',
Link:
'https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_Veryfast.js',
Tags: 'pre-processing,ffmpeg,h264',
};
}
function plugin(file) {
Version: '1.00',
Tags: 'pre-processing,ffmpeg,h264',
Inputs: [],
});
// eslint-disable-next-line
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object
const response = {
@ -134,7 +137,7 @@ function plugin(file) {
response.infoLog += '☑File meets conditions! \n';
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -3,7 +3,7 @@ module.exports.dependencies = [
'import-fresh',
];
module.exports.details = function details() {
const details = () => {
return {
id: 'Tdarr_Plugin_aaaa_Pre_Proc_Example',
Stage: 'Pre-processing', // Pre-processing or Post-processing. Determines when the plugin will be executed.
@ -43,7 +43,7 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
const plugin = (file, librarySettings, inputs, otherArguments) => {
// Only 'require' dependencies within this function or other functions. Do not require in the top scope.
const importFresh = require('import-fresh');

@ -1,4 +1,4 @@
module.exports.details = function details() {
const details = () => {
return {
id: 'Tdarr_Plugin_bbbb_Filter_Example',
Stage: 'Pre-processing',
@ -12,7 +12,7 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file) {
const plugin = (file, librarySettings, inputs, otherArguments) => {
// Must return this object at some point in the function else plugin will fail.
const response = {

@ -3,7 +3,7 @@ module.exports.dependencies = [
'import-fresh',
];
module.exports.details = function details() {
const details = () => {
return {
id: 'Tdarr_Plugin_zzzz_Post_Proc_Example',
Stage: 'Post-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed. This plugin does some stuff after all plugins have been executed
@ -41,7 +41,7 @@ module.exports.details = function details() {
};
};
module.exports.plugin = function plugin(file, librarySettings, inputs) {
const plugin = (file, librarySettings, inputs, otherArguments) => {
// Only 'require' dependencies within this function or other functions. Do not require in the top scope.
const importFresh = require('import-fresh');

@ -1,18 +1,21 @@
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_a9he_New_file_size_check',
Stage: 'Pre-processing',
Name: 'New file size check',
Type: 'Video',
Operation: 'Transcode',
Description: 'Give an error if new file is larger than the original \n\n',
Version: '1.00',
Link: '',
Tags: '',
};
};
// eslint-disable-next-line import/no-unresolved
const loadDefaultValues = require('../methods/loadDefaultValues');
module.exports.plugin = function plugin(file, librarySettings, inputs, otherArguments) {
const details = () => ({
id: 'Tdarr_Plugin_a9he_New_file_size_check',
Stage: 'Pre-processing',
Name: 'New file size check',
Type: 'Video',
Operation: 'Transcode',
Description: 'Give an error if new file is larger than the original \n\n',
Version: '1.00',
Link: '',
Tags: '',
});
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
// Must return this object at some point in the function else plugin will fail.
const response = {
processFile: false,
@ -35,3 +38,6 @@ module.exports.plugin = function plugin(file, librarySettings, inputs, otherArgu
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,18 +1,22 @@
module.exports.details = function details() {
return {
id: 'Tdarr_Plugin_bbbc_Filter_Example',
Stage: 'Pre-processing',
Name: 'Filter resolutions',
Type: 'Video',
Operation: 'Filter',
Description: 'This plugin prevents processing files with specified resolutions \n\n',
Version: '1.00',
Link: '',
Tags: '',
};
};
// eslint-disable-next-line import/no-unresolved
const loadDefaultValues = require('../methods/loadDefaultValues');
module.exports.plugin = function plugin(file) {
const details = () => ({
id: 'Tdarr_Plugin_bbbc_Filter_Example',
Stage: 'Pre-processing',
Name: 'Filter resolutions',
Type: 'Video',
Operation: 'Filter',
Description: 'This plugin prevents processing files with specified resolutions \n\n',
Version: '1.00',
Link: '',
Tags: '',
});
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = loadDefaultValues(inputs, details);
const response = {
processFile: true,
infoLog: '',
@ -33,3 +37,6 @@ module.exports.plugin = function plugin(file) {
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -0,0 +1,38 @@
const loadDefaultValues = (inputs, details) => {
if (!inputs) {
// eslint-disable-next-line no-param-reassign
inputs = {};
}
const defaultInputs = details().Inputs;
for (let i = 0; i < defaultInputs.length; i += 1) {
if (typeof inputs[defaultInputs[i].name] === 'string') {
// eslint-disable-next-line no-param-reassign
inputs[defaultInputs[i].name] = typeof inputs[defaultInputs[i].name].trim();
}
if (inputs[defaultInputs[i].name] === undefined
|| inputs[defaultInputs[i].name] === ''
) {
// eslint-disable-next-line no-param-reassign
inputs[defaultInputs[i].name] = defaultInputs[i].defaultValue;
}
if (defaultInputs[i].type === 'boolean') {
// eslint-disable-next-line no-param-reassign
inputs[defaultInputs[i].name] = inputs[defaultInputs[i].name] === 'true';
}
if (defaultInputs[i].type === 'number') {
// eslint-disable-next-line no-param-reassign
inputs[defaultInputs[i].name] = Number(inputs[defaultInputs[i].name]);
// eslint-disable-next-line no-restricted-globals
if (!isNaN(inputs[defaultInputs[i].name])) {
// eslint-disable-next-line no-param-reassign
inputs[defaultInputs[i].name] = 0;
}
}
}
return inputs;
};
module.exports = loadDefaultValues;

@ -12,8 +12,9 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint Community methods examples --ext js",
"lint:fix": "eslint Community methods examples --ext js --fix"
"lint": "eslint Community methods examples tests --ext js",
"lint:fix": "eslint Community methods examples tests --ext js --fix",
"checkPlugins": "node ./tests/checkPlugins.js"
},
"repository": {
"type": "git",

@ -0,0 +1,147 @@
/* eslint no-console: 0 */ // --> OFF
const fs = require('fs');
const files = fs.readdirSync('./Community');
const detailsOrder = [
'id',
'Stage',
'Name',
'Type',
'Operation',
'Description',
'Version',
'Tags',
'Inputs',
];
const pluginInputTypes = ['string', 'number', 'boolean'];
for (let i = 0; i < files.length; i += 1) {
console.log(`${files[i]}`);
let read = fs.readFileSync(`./Community/${files[i]}`).toString();
if (!read.includes('const loadDefaultValues = require(\'../methods/loadDefaultValues\');')) {
console.log(`Plugin does not import loadDefaultValues './Community/${files[i]}'`);
read = `const loadDefaultValues = require('../methods/loadDefaultValues');\n${read}`;
// fs.writeFileSync(`./Community/${files[i]}`, read)
process.exit(1);
}
if (!read.includes('const details = () =>')) {
console.log(`Plugin details syntax is wrong './Community/${files[i]}'`);
process.exit(1);
}
const syncText = 'const plugin = (file, librarySettings, inputs, otherArguments) => {';
const asyncText = 'const plugin = async (file, librarySettings, inputs, otherArguments) => {';
if (!read.includes(syncText)
&& !read.includes(asyncText)
) {
console.log(`Plugin 'plugin' syntax is wrong './Community/${files[i]}'`);
process.exit(1);
}
if (!read.includes('inputs = loadDefaultValues(inputs, details);')
) {
console.log(`Plugin does not load default inputs './Community/${files[i]}'`);
process.exit(1);
}
const exportText = `module.exports.details = details;
module.exports.plugin = plugin;`;
if (!read.includes(exportText)) {
console.log(`Plugin export syntax is wrong './Community/${files[i]}'`);
read = read.replace('module.exports.details = details;', '');
read = read.replace('module.exports.plugin = plugin;', '');
read += `\n${exportText}`;
// fs.writeFileSync(`./Community/${files[i]}`, read)
process.exit(1);
}
let pluginDetails;
try {
// eslint-disable-next-line import/no-dynamic-require,global-require
pluginDetails = require(`../Community/${files[i]}`).details();
} catch (err) {
console.log(err.message);
process.exit(1);
}
const detailsKeys = Object.keys(pluginDetails);
detailsOrder.forEach((detail) => {
if (detailsKeys.indexOf(detail) === -1) {
console.log(`Plugin details is missing './Community/${files[i]}' : ${detail}`);
process.exit(1);
}
});
detailsKeys.forEach((detail, index) => {
if (detailsOrder[index] !== detail) {
console.log(`Plugin details keys are not in the correct order: './Community/${files[i]}' ${detail}`);
process.exit(1);
}
});
if (detailsKeys.length < detailsOrder.length) {
console.log(`Plugin details are too few './Community/${files[i]}'`);
process.exit(1);
}
if (!['Pre-processing', 'Post-processing'].includes(pluginDetails.Stage)) {
console.log(`Plugin does not have a valid Type'./Community/${files[i]}'`);
process.exit(1);
}
if (!['Video', 'Audio', 'Subtitle', 'Any'].includes(pluginDetails.Type)) {
console.log(`Plugin does not have a valid Type'./Community/${files[i]}'`);
process.exit(1);
}
if (!['Transcode', 'Filter'].includes(pluginDetails.Operation)) {
console.log(`Plugin does not have a valid Operation './Community/${files[i]}'`);
process.exit(1);
} else if (detailsKeys.length > detailsOrder.length) {
console.log(`Plugin details are too many './Community/${files[i]}'`);
process.exit(1);
} else if (pluginDetails.Inputs && !Array.isArray(pluginDetails.Inputs)) {
// Check default values are set;
console.log(`Plugin Inputs is not an array: ${files[i]}`);
process.exit(1);
} else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) {
const inputs = pluginDetails.Inputs;
for (let j = 0; j < inputs.length; j += 1) {
const inputKeys = Object.keys(inputs[j]);
if (
inputKeys[0] !== 'name'
|| inputKeys[1] !== 'type'
|| inputKeys[2] !== 'defaultValue'
|| inputKeys[3] !== 'inputUI'
|| inputKeys[4] !== 'tooltip'
) {
console.log(`Plugin Input keys are not in correct order: './Community/${files[i]}' : ${inputs[j].name}`);
process.exit(1);
} else if (inputs[j].type === undefined || !pluginInputTypes.includes(inputs[j].type)) {
console.log(`Plugin Input does not have a type: './Community/${files[i]}' : ${inputs[j].name}`);
process.exit(1);
} else if (
(inputs[j].type === 'string' && typeof inputs[j].defaultValue !== 'string')
|| (inputs[j].type === 'number' && typeof inputs[j].defaultValue !== 'number')
|| (inputs[j].type === 'boolean' && typeof inputs[j].defaultValue !== 'boolean')
) {
console.log(`Plugin Input type does not match defaultValue type:
'./Community/${files[i]}' : ${inputs[j].name}`);
process.exit(1);
} else if (inputs[j].defaultValue === undefined) {
console.log(`Plugin Input does not have a default value: './Community/${files[i]}' : ${inputs[j].name}`);
process.exit(1);
}
}
}
}
console.log('Done!');
Loading…
Cancel
Save