mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 02:35:54 -07:00
Merge remote-tracking branch 'HaveAGitGat/master'
This commit is contained in:
commit
c9f3b44efd
5 changed files with 65 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -0,0 +1 @@
|
||||||
|
/node_modules
|
||||||
|
|
@ -43,11 +43,21 @@ module.exports.plugin = function plugin(file, librarySettings, inputs, otherArgu
|
||||||
lang = subStream.tags.language
|
lang = subStream.tags.language
|
||||||
}
|
}
|
||||||
|
|
||||||
let subsFile = file.file
|
const { originalLibraryFile } = otherArguments;
|
||||||
subsFile = subsFile.split('.')
|
|
||||||
subsFile[subsFile.length - 2] += `.${lang}`
|
let subsFile = '';
|
||||||
subsFile[subsFile.length - 1] = 'srt'
|
|
||||||
subsFile = subsFile.join('.')
|
// for Tdarr V2 (2.00.05+)
|
||||||
|
if (originalLibraryFile && originalLibraryFile.file) {
|
||||||
|
subsFile = originalLibraryFile.file;
|
||||||
|
} else {
|
||||||
|
// for Tdarr V1
|
||||||
|
subsFile = file.file;
|
||||||
|
}
|
||||||
|
subsFile = subsFile.split('.');
|
||||||
|
subsFile[subsFile.length - 2] += `.${lang}`;
|
||||||
|
subsFile[subsFile.length - 1] = 'srt';
|
||||||
|
subsFile = subsFile.join('.');
|
||||||
|
|
||||||
let index = subStream.index
|
let index = subStream.index
|
||||||
let command = `${ffmpegPath} -i "${file.file}" -map 0:${index} "${subsFile}"`
|
let command = `${ffmpegPath} -i "${file.file}" -map 0:${index} "${subsFile}"`
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function details() {
|
||||||
eng
|
eng
|
||||||
|
|
||||||
\\nExample:\\n
|
\\nExample:\\n
|
||||||
eng,jap`,
|
eng,jpn`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'commentary',
|
name: 'commentary',
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,8 @@ module.exports.details = function details() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.plugin = function plugin(file, librarySettings, inputs) {
|
module.exports.plugin = function plugin(file, librarySettings, inputs, otherArguments) {
|
||||||
// Must return this object at some point in the function else plugin will fail.
|
// Must return this object at some point in the function else plugin will fail.
|
||||||
|
|
||||||
const response = {
|
const response = {
|
||||||
processFile: true,
|
processFile: true,
|
||||||
preset: '',
|
preset: '',
|
||||||
|
|
@ -76,7 +75,17 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
|
||||||
title = subStream.tags.title;
|
title = subStream.tags.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
let subsFile = file.file;
|
const { originalLibraryFile } = otherArguments;
|
||||||
|
|
||||||
|
let subsFile = '';
|
||||||
|
|
||||||
|
// for Tdarr V2 (2.00.05+)
|
||||||
|
if (originalLibraryFile && originalLibraryFile.file) {
|
||||||
|
subsFile = originalLibraryFile.file;
|
||||||
|
} else {
|
||||||
|
// for Tdarr V1
|
||||||
|
subsFile = file.file;
|
||||||
|
}
|
||||||
subsFile = subsFile.split('.');
|
subsFile = subsFile.split('.');
|
||||||
subsFile[subsFile.length - 2] += `.${lang}`;
|
subsFile[subsFile.length - 2] += `.${lang}`;
|
||||||
subsFile[subsFile.length - 1] = 'srt';
|
subsFile[subsFile.length - 1] = 'srt';
|
||||||
|
|
|
||||||
36
Tdarr_Plugin_bbbb_Filter_Example.js
Normal file
36
Tdarr_Plugin_bbbb_Filter_Example.js
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
module.exports.details = function details() {
|
||||||
|
return {
|
||||||
|
id: 'Tdarr_Plugin_bbbb_Filter_Example',
|
||||||
|
Stage: 'Pre-processing',
|
||||||
|
Name: 'Filter keywords ',
|
||||||
|
Type: 'Video',
|
||||||
|
Operation: 'Filter',
|
||||||
|
Description: 'This plugin prevents processing files which contain keywords \n\n',
|
||||||
|
Version: '1.00',
|
||||||
|
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugin_bbbb_Filter_Example.js',
|
||||||
|
Tags: '',
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.plugin = function plugin(file) {
|
||||||
|
// Must return this object at some point in the function else plugin will fail.
|
||||||
|
|
||||||
|
const response = {
|
||||||
|
processFile: true,
|
||||||
|
infoLog: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
const keywords = [
|
||||||
|
'Low quality',
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let i = 0; i < keywords.length; i += 1) {
|
||||||
|
if (file.file.includes(keywords[i])) {
|
||||||
|
response.processFile = false;
|
||||||
|
response.infoLog += `Filter preventing processing. File title contains keyword ${keywords[i]}`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue