mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 10:45:53 -07:00
tidy
This commit is contained in:
parent
d28272f6d4
commit
9c8ac98728
60 changed files with 5481 additions and 5980 deletions
|
|
@ -1,8 +1,4 @@
|
|||
|
||||
|
||||
|
||||
function details() {
|
||||
|
||||
return {
|
||||
id: "Tdarr_Plugin_x7ab_Remove_Subs",
|
||||
Stage: "Pre-processing",
|
||||
|
|
@ -10,77 +6,60 @@ function details() {
|
|||
Type: "Video",
|
||||
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',
|
||||
}
|
||||
|
||||
Link:
|
||||
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_x7ab_Remove_Subs.js",
|
||||
Tags: "pre-processing,ffmpeg,subtitle only",
|
||||
};
|
||||
}
|
||||
|
||||
function plugin(file) {
|
||||
|
||||
|
||||
//Must return this object
|
||||
|
||||
var response = {
|
||||
|
||||
processFile : false,
|
||||
preset : '',
|
||||
container : '.mp4',
|
||||
handBrakeMode : false,
|
||||
FFmpegMode : false,
|
||||
reQueueAfter : false,
|
||||
infoLog : '',
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
processFile: false,
|
||||
preset: "",
|
||||
container: ".mp4",
|
||||
handBrakeMode: false,
|
||||
FFmpegMode: false,
|
||||
reQueueAfter: false,
|
||||
infoLog: "",
|
||||
};
|
||||
|
||||
if (file.fileMedium !== "video") {
|
||||
console.log("File is not video");
|
||||
|
||||
console.log("File is not video")
|
||||
|
||||
response.infoLog += "☒File is not video \n"
|
||||
response.infoLog += "☒File is not video \n";
|
||||
response.processFile = false;
|
||||
|
||||
return response
|
||||
return response;
|
||||
} else {
|
||||
response.FFmpegMode = true;
|
||||
response.container = "." + file.container;
|
||||
|
||||
} else {
|
||||
var hasSubs = false;
|
||||
|
||||
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
|
||||
try {
|
||||
if (
|
||||
file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"
|
||||
) {
|
||||
hasSubs = true;
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
response.FFmpegMode = true
|
||||
response.container = '.' + file.container
|
||||
|
||||
var hasSubs = false
|
||||
|
||||
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
|
||||
|
||||
try {
|
||||
if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){
|
||||
|
||||
hasSubs = true
|
||||
|
||||
}
|
||||
} catch (err) { }
|
||||
}
|
||||
|
||||
if(hasSubs){
|
||||
|
||||
response.infoLog += "☒File has subs \n"
|
||||
response.preset = ',-sn -map 0 -c copy'
|
||||
if (hasSubs) {
|
||||
response.infoLog += "☒File has subs \n";
|
||||
response.preset = ",-sn -map 0 -c copy";
|
||||
response.reQueueAfter = true;
|
||||
response.processFile = true;
|
||||
return response
|
||||
|
||||
}else{
|
||||
response.infoLog += "☑File has no subs \n"
|
||||
}
|
||||
|
||||
|
||||
response.infoLog += "☑File meets conditions! \n"
|
||||
return response
|
||||
return response;
|
||||
} else {
|
||||
response.infoLog += "☑File has no subs \n";
|
||||
}
|
||||
|
||||
response.infoLog += "☑File meets conditions! \n";
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue