parent
925d3c2cec
commit
e1ff493d7b
@ -1,171 +1,138 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function details() {
|
function details() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: "Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30",
|
id: "Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30",
|
||||||
Stage: "Pre-processing",
|
Stage: "Pre-processing",
|
||||||
Name: "HaveAGitGat HandBrake VeryFast1080p30, No title meta, no subs, 192Kb AAC stereo,MP4 ",
|
Name:
|
||||||
|
"HaveAGitGat HandBrake VeryFast1080p30, No title meta, no subs, 192Kb AAC stereo,MP4 ",
|
||||||
Type: "Video",
|
Type: "Video",
|
||||||
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
|
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",
|
Version: "1.00",
|
||||||
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js",
|
Link:
|
||||||
Tags:'pre-processing,handbrake,ffmpeg,h264',
|
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js",
|
||||||
}
|
Tags: "pre-processing,handbrake,ffmpeg,h264",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function plugin(file) {
|
function plugin(file) {
|
||||||
|
|
||||||
|
|
||||||
//Must return this object
|
//Must return this object
|
||||||
|
|
||||||
var response = {
|
var response = {
|
||||||
|
processFile: false,
|
||||||
processFile : false,
|
preset: "",
|
||||||
preset : '',
|
container: ".mp4",
|
||||||
container : '.mp4',
|
handBrakeMode: false,
|
||||||
handBrakeMode : false,
|
FFmpegMode: false,
|
||||||
FFmpegMode : false,
|
reQueueAfter: false,
|
||||||
reQueueAfter : false,
|
infoLog: "",
|
||||||
infoLog : '',
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (file.fileMedium !== "video") {
|
if (file.fileMedium !== "video") {
|
||||||
|
console.log("File is not video");
|
||||||
|
|
||||||
|
response.infoLog += "☒File is not video \n";
|
||||||
console.log("File is not video")
|
|
||||||
|
|
||||||
response.infoLog += "☒File is not video \n"
|
|
||||||
response.processFile = false;
|
response.processFile = false;
|
||||||
|
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
} else {
|
var jsonString = JSON.stringify(file);
|
||||||
|
|
||||||
var jsonString = JSON.stringify(file)
|
var hasSubs = false;
|
||||||
|
|
||||||
|
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
|
||||||
var hasSubs = false
|
try {
|
||||||
|
if (
|
||||||
|
file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"
|
||||||
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
|
) {
|
||||||
|
hasSubs = true;
|
||||||
try {
|
}
|
||||||
|
} catch (err) {}
|
||||||
if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){
|
}
|
||||||
|
|
||||||
hasSubs = true
|
if (file.ffProbeData.streams[0].codec_name != "h264") {
|
||||||
|
response.infoLog += "☒File is not in h264! \n";
|
||||||
}
|
response.preset = '-Z "Very Fast 1080p30"';
|
||||||
} catch (err) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(file.ffProbeData.streams[0].codec_name != 'h264'){
|
|
||||||
|
|
||||||
response.infoLog += "☒File is not in h264! \n"
|
|
||||||
response.preset = '-Z "Very Fast 1080p30"'
|
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.handBrakeMode = true
|
response.handBrakeMode = true;
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
}else{
|
response.infoLog += "☑File is already in h264! \n";
|
||||||
response.infoLog += "☑File is already in h264! \n"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
|
|
||||||
if(hasSubs){
|
///
|
||||||
|
|
||||||
response.infoLog += "☒File has subs \n"
|
if (hasSubs) {
|
||||||
response.preset = ',-sn -map 0 -c copy'
|
response.infoLog += "☒File has subs \n";
|
||||||
|
response.preset = ",-sn -map 0 -c copy";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
}else{
|
response.infoLog += "☑File has no subs \n";
|
||||||
response.infoLog += "☑File has no subs \n"
|
}
|
||||||
}
|
|
||||||
|
if (
|
||||||
if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){
|
file.meta.Title != "undefined" &&
|
||||||
|
!jsonString.includes("aac") &&
|
||||||
response.infoLog += "☒File has title metadata and no aac and subs \n"
|
hasSubs
|
||||||
response.preset = ',-map_metadata -1 -map 0 -c copy'
|
) {
|
||||||
|
response.infoLog += "☒File has title metadata and no aac and subs \n";
|
||||||
|
response.preset = ",-map_metadata -1 -map 0 -c copy";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!jsonString.includes("aac") && hasSubs){
|
if (!jsonString.includes("aac") && hasSubs) {
|
||||||
|
response.infoLog += "☒File has no aac track and has subs \n";
|
||||||
response.infoLog += "☒File has no aac track and has subs \n"
|
response.preset =
|
||||||
response.preset = ',-sn -map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2'
|
",-sn -map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(file.meta.Title != "undefined" && hasSubs){
|
if (file.meta.Title != "undefined" && hasSubs) {
|
||||||
|
response.infoLog += "☒File has title and has subs \n";
|
||||||
response.infoLog += "☒File has title and has subs \n"
|
response.preset = ",-sn -map_metadata -1 -map 0 -c copy";
|
||||||
response.preset = ',-sn -map_metadata -1 -map 0 -c copy'
|
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
if (file.meta.Title != undefined) {
|
||||||
///
|
response.infoLog += "☒File has title metadata \n";
|
||||||
if(file.meta.Title != undefined ){
|
response.preset = ",-map_metadata -1 -map 0 -c copy";
|
||||||
|
|
||||||
response.infoLog += "☒File has title metadata \n"
|
|
||||||
response.preset = ',-map_metadata -1 -map 0 -c copy'
|
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}else{
|
} else {
|
||||||
response.infoLog += "☑File has no title metadata"
|
response.infoLog += "☑File has no title metadata";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!jsonString.includes("aac")){
|
if (!jsonString.includes("aac")) {
|
||||||
|
response.infoLog += "☒File has no aac track \n";
|
||||||
response.infoLog += "☒File has no aac track \n"
|
response.preset =
|
||||||
response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2'
|
",-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
}else{
|
response.infoLog += "☑File has aac track \n";
|
||||||
response.infoLog += "☑File has aac track \n"
|
}
|
||||||
}
|
|
||||||
|
response.infoLog += "☑File meets conditions! \n";
|
||||||
|
return response;
|
||||||
response.infoLog += "☑File meets conditions! \n"
|
|
||||||
return response
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.details = details;
|
module.exports.details = details;
|
||||||
|
|
||||||
module.exports.plugin = plugin;
|
module.exports.plugin = plugin;
|
||||||
|
|||||||
@ -1,172 +1,138 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function details() {
|
function details() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30",
|
id: "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30",
|
||||||
Stage: "Pre-processing",
|
Stage: "Pre-processing",
|
||||||
Name: "HaveAGitGat HandBrake Fast1080p30, No title meta, no subs, 192Kb AAC stereo,MP4 ",
|
Name:
|
||||||
|
"HaveAGitGat HandBrake Fast1080p30, No title meta, no subs, 192Kb AAC stereo,MP4 ",
|
||||||
Type: "Video",
|
Type: "Video",
|
||||||
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
|
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",
|
Version: "1.00",
|
||||||
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js",
|
Link:
|
||||||
Tags:'pre-processing,handbrake,ffmpeg,h264',
|
"https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js",
|
||||||
}
|
Tags: "pre-processing,handbrake,ffmpeg,h264",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function plugin(file) {
|
function plugin(file) {
|
||||||
|
|
||||||
|
|
||||||
//Must return this object
|
//Must return this object
|
||||||
|
|
||||||
var response = {
|
var response = {
|
||||||
|
processFile: false,
|
||||||
processFile : false,
|
preset: "",
|
||||||
preset : '',
|
container: ".mp4",
|
||||||
container : '.mp4',
|
handBrakeMode: false,
|
||||||
handBrakeMode : false,
|
FFmpegMode: false,
|
||||||
FFmpegMode : false,
|
reQueueAfter: false,
|
||||||
reQueueAfter : false,
|
infoLog: "",
|
||||||
infoLog : '',
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (file.fileMedium !== "video") {
|
if (file.fileMedium !== "video") {
|
||||||
|
console.log("File is not video");
|
||||||
|
|
||||||
|
response.infoLog += "☒File is not video \n";
|
||||||
console.log("File is not video")
|
|
||||||
|
|
||||||
response.infoLog += "☒File is not video \n"
|
|
||||||
response.processFile = false;
|
response.processFile = false;
|
||||||
|
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
} else {
|
var jsonString = JSON.stringify(file);
|
||||||
|
|
||||||
var jsonString = JSON.stringify(file)
|
var hasSubs = false;
|
||||||
|
|
||||||
|
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
|
||||||
var hasSubs = false
|
try {
|
||||||
|
if (
|
||||||
|
file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"
|
||||||
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
|
) {
|
||||||
|
hasSubs = true;
|
||||||
try {
|
}
|
||||||
|
} catch (err) {}
|
||||||
if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){
|
}
|
||||||
|
|
||||||
hasSubs = true
|
if (file.ffProbeData.streams[0].codec_name != "h264") {
|
||||||
|
response.infoLog += "☒File is not in h264! \n";
|
||||||
}
|
response.preset = '-Z "Fast 1080p30"';
|
||||||
} catch (err) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(file.ffProbeData.streams[0].codec_name != 'h264'){
|
|
||||||
|
|
||||||
response.infoLog += "☒File is not in h264! \n"
|
|
||||||
response.preset = '-Z "Fast 1080p30"'
|
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.handBrakeMode = true
|
response.handBrakeMode = true;
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
}else{
|
response.infoLog += "☑File is already in h264! \n";
|
||||||
response.infoLog += "☑File is already in h264! \n"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
///
|
||||||
|
|
||||||
///
|
if (hasSubs) {
|
||||||
|
response.infoLog += "☒File has subs \n";
|
||||||
if(hasSubs){
|
response.preset = ",-sn -map 0 -c copy";
|
||||||
|
|
||||||
response.infoLog += "☒File has subs \n"
|
|
||||||
response.preset = ',-sn -map 0 -c copy'
|
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
}else{
|
response.infoLog += "☑File has no subs \n";
|
||||||
response.infoLog += "☑File has no subs \n"
|
}
|
||||||
}
|
|
||||||
|
if (
|
||||||
if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){
|
file.meta.Title != "undefined" &&
|
||||||
|
!jsonString.includes("aac") &&
|
||||||
response.infoLog += "☒File has title metadata and no aac and subs \n"
|
hasSubs
|
||||||
response.preset = ',-map_metadata -1 -map 0 -c copy'
|
) {
|
||||||
|
response.infoLog += "☒File has title metadata and no aac and subs \n";
|
||||||
|
response.preset = ",-map_metadata -1 -map 0 -c copy";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!jsonString.includes("aac") && hasSubs){
|
if (!jsonString.includes("aac") && hasSubs) {
|
||||||
|
response.infoLog += "☒File has no aac track and has subs \n";
|
||||||
response.infoLog += "☒File has no aac track and has subs \n"
|
response.preset =
|
||||||
response.preset = ',-sn -map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2'
|
",-sn -map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(file.meta.Title != "undefined" && hasSubs){
|
|
||||||
|
|
||||||
response.infoLog += "☒File has title and has subs \n"
|
if (file.meta.Title != "undefined" && hasSubs) {
|
||||||
response.preset = ',-sn -map_metadata -1 -map 0 -c copy'
|
response.infoLog += "☒File has title and has subs \n";
|
||||||
|
response.preset = ",-sn -map_metadata -1 -map 0 -c copy";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
if (file.meta.Title != undefined) {
|
||||||
///
|
response.infoLog += "☒File has title metadata \n";
|
||||||
if(file.meta.Title != undefined ){
|
response.preset = ",-map_metadata -1 -map 0 -c copy";
|
||||||
|
|
||||||
response.infoLog += "☒File has title metadata \n"
|
|
||||||
response.preset = ',-map_metadata -1 -map 0 -c copy'
|
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
}else{
|
} else {
|
||||||
response.infoLog += "☑File has no title metadata"
|
response.infoLog += "☑File has no title metadata";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!jsonString.includes("aac")){
|
if (!jsonString.includes("aac")) {
|
||||||
|
response.infoLog += "☒File has no aac track \n";
|
||||||
response.infoLog += "☒File has no aac track \n"
|
response.preset =
|
||||||
response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2'
|
",-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -b:a:0 192k -ac 2";
|
||||||
response.reQueueAfter = true;
|
response.reQueueAfter = true;
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
response.FFmpegMode = true
|
response.FFmpegMode = true;
|
||||||
return response
|
return response;
|
||||||
|
} else {
|
||||||
}else{
|
response.infoLog += "☑File has aac track \n";
|
||||||
response.infoLog += "☑File has aac track \n"
|
}
|
||||||
}
|
|
||||||
|
response.infoLog += "☑File meets conditions! \n";
|
||||||
|
return response;
|
||||||
|
|
||||||
response.infoLog += "☑File meets conditions! \n"
|
|
||||||
return response
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.details = details;
|
module.exports.details = details;
|
||||||
|
|
||||||
module.exports.plugin = plugin;
|
module.exports.plugin = plugin;
|
||||||
|
|||||||
Loading…
Reference in new issue