From 8a788d110514691b56b57e4e1b33605eb975fb19 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Thu, 3 Oct 2019 04:25:54 +0100 Subject: [PATCH 1/6] Add files via upload --- Community/Tdarr_Plugin_s7x8_winsome_h265.js | 134 ++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Community/Tdarr_Plugin_s7x8_winsome_h265.js diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js new file mode 100644 index 0000000..d879c36 --- /dev/null +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -0,0 +1,134 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_s7x8_winsome_h265", + Name: "Winsome H265 ", + Type: "Video", + Description: `This plugin transcodes all videos to h265. 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_Plugin_s7x8_winsome_h265" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '', + + } + + + response.FFmpegMode = true + + + + + if (file.fileMedium !== "video") { + + + console.log("File is not video") + + response.infoLog += " File is not video" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + response.container = '.' + file.container + + + if (file.ffProbeData.streams[0].codec_name == 'hevc') { + + + var hasEngTrack = false + + + // for (var i = 0; i < file.ffProbeData.streams.length; i++) { + + // try { + // if ( (file.ffProbeData.streams[i].codec_name == "ac3" || file.ffProbeData.streams[i].codec_name == "eac3" || file.ffProbeData.streams[i].codec_name == "dts") && file.ffProbeData.streams[i].tags.language == 'eng') { + + // hasEngTrack = true + + // } + // } catch (err) { + + // } + // } + + try { + if ((file.ffProbeData.streams[1].codec_name == "ac3" || file.ffProbeData.streams[1].codec_name == "eac3" || file.ffProbeData.streams[1].codec_name == "dts")) { + + hasEngTrack = true + + } + } catch (err) { + + } + + + if (hasEngTrack) { + + response.infoLog += " File is already hevc and has English language track in AC3,EAC3 or DTS!" + response.processFile = false; + return response + + + } else { + + response.infoLog += " File is already hevc and doesn't have English language track in AC3,EAC3 or DTS!" + response.processFile = true; + response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2' + response.reQueueAfter = true; + response.FFmpegMode = true + return response + + + + + } + + } else { + + + + response.infoLog += " File isn't in hevc!" + response.processFile = true; + response.preset = '-Z "H.265 MKV 2160p60"' + response.reQueueAfter = true; + response.handBrakeMode = true + + return response + + } + + + + + + + + + } +} + +module.exports.details = details; + +module.exports.plugin = plugin; From 87b780e406109122524aac1e9ca2e4a1e4d43f0f Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Thu, 3 Oct 2019 04:42:40 +0100 Subject: [PATCH 2/6] Update Tdarr_Plugin_s7x8_winsome_h265.js --- Community/Tdarr_Plugin_s7x8_winsome_h265.js | 56 ++++++++++++--------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js index d879c36..295f386 100644 --- a/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -12,7 +12,6 @@ function details() { Version: "1.00", Link: "https://github.com/HaveAGitGat/Tdarr_Plugin_s7x8_winsome_h265" } - } function plugin(file) { @@ -51,7 +50,7 @@ function plugin(file) { } else { var jsonString = JSON.stringify(file) - response.container = '.' + file.container + response.container = '.mkv' if (file.ffProbeData.streams[0].codec_name == 'hevc') { @@ -84,48 +83,57 @@ function plugin(file) { } - if (hasEngTrack) { - - response.infoLog += " File is already hevc and has English language track in AC3,EAC3 or DTS!" - response.processFile = false; - return response - - - } else { + if(!hasEngTrack){ - response.infoLog += " File is already hevc and doesn't have English language track in AC3,EAC3 or DTS!" response.processFile = true; response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2' - response.reQueueAfter = true; + response.container = '.mkv' + response.handBrakeMode =false response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File is already hevc and doesn't have English language track in AC3,EAC3 or DTS!" return response + }else{ + response.infoLog += " File is already hevc and has English language track in AC3,EAC3 or DTS!" } - } else { + if( file.container != 'mkv'){ + + response.processFile = true; + response.preset = ', -c:v copy -c:a copy' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File is not in mkv container!" + return response + + }else{ + + response.infoLog += " File is in mkv container!" + + } + + response.processFile = false; + return response + } else { - response.infoLog += " File isn't in hevc!" response.processFile = true; response.preset = '-Z "H.265 MKV 2160p60"' - response.reQueueAfter = true; + response.container = '.mkv' response.handBrakeMode = true - + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File isn't in hevc!" return response } - - - - - - - - } } From 6da205dfba52cc9789b8d1bb0854b014236e2f7b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Thu, 3 Oct 2019 05:00:22 +0100 Subject: [PATCH 3/6] Update Tdarr_Plugin_s7x8_winsome_h265.js --- Community/Tdarr_Plugin_s7x8_winsome_h265.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js index 295f386..8dde9c7 100644 --- a/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_s7x8_winsome_h265", Name: "Winsome H265 ", Type: "Video", - Description: `This plugin transcodes all videos to h265. If the English language track is not in AC3,EAC3 or DTS then an AC3 track is added.\n\n + Description: `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_Plugin_s7x8_winsome_h265" From 059b9c3de2635b691ccb4f617c52f3fd0523dede Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Thu, 3 Oct 2019 05:02:11 +0100 Subject: [PATCH 4/6] Add files via upload --- ..._H.264_MKV_480p30_No_Subs_No_Title_Meta.js | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js diff --git a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..d29d47c --- /dev/null +++ b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,167 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta", + Name: "H.264 MKV 480p30, No Subs No, Title Meta", + Type: "Video", + Description: `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_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', + + } + + + response.FFmpegMode = true + + + + + if (file.fileMedium !== "video") { + + + console.log("File is not video") + + response.infoLog += " File is not video" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + + + 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(file.ffProbeData.streams[0].codec_name != 'h264' || file.ffProbeData.streams[0].width > 720 || file.ffProbeData.streams[0].height > 480 ){ + + response.processFile = true; + response.preset = '-Z "H.264 MKV 480p30"' + response.container = '.mkv' + response.handBrakeMode =true + response.FFmpegMode = false + response.reQueueAfter = true; + response.infoLog += " File is not h264 480p!" + return response + }else{ + + response.infoLog += " File is h264 480p!" + + } +// + + if(file.meta.Title != "undefined" && hasSubs){ + + response.processFile = true; + response.preset = '-sn,-map_metadata -1 -c:v copy -c:a copy' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += "File has title and has subs" + return response + }else{ + response.infoLog += "File has no title and has no subs" + + } + + + if(file.meta.Title != undefined ){ + + response.processFile = true; + response.preset = ',-map_metadata -1 -c:v copy -c:a copy' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File has title metadata" + return response + + + }else{ + response.infoLog += " File has no title metadata" + } + + + if(hasSubs){ + + response.processFile = true; + response.preset = '-sn, -c:v copy -c:a copy' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File has subs" + return response + + }else{ + response.infoLog += " File has no subs" + } + + + if( file.container != 'mkv'){ + + + response.processFile = true; + response.preset = ', -c:v copy -c:a copy' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File is not in mkv container!" + return response + + + }else{ + + response.infoLog += " File is in mkv container!" + + } + + + response.processFile = false; + response.infoLog += " File meets conditions!" + return response + + } +} + +module.exports.details = details; + +module.exports.plugin = plugin; From 1da9bfb489ddc6d8e53eaed8b122fdd7ce724c93 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Thu, 3 Oct 2019 06:14:54 +0100 Subject: [PATCH 5/6] Update Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js --- ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js index 6b4dc92..326384e 100644 --- a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js +++ b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -37,8 +37,6 @@ function plugin(file) { response.FFmpegMode = true - - if (file.fileMedium !== "video" || file.video_resolution !== "4KUHD") { @@ -54,9 +52,10 @@ function plugin(file) { var ffmpegDataString = JSON.stringify(file.ffProbeData) - var ac3TrackCount = (ffmpegDataString.match(/ac3/g) || []).length; + //var ac3TrackCount = (ffmpegDataString.match(/ac3/g) || []).length; + var ac3TrackCount = 0 var AC3CommentaryCount = 0 var hasSubs = false @@ -72,25 +71,29 @@ function plugin(file) { } } catch (err) { } + try { + if (file.ffProbeData.streams[i].codec_name.toLowerCase() == "ac3") { + ac3TrackCount++ + } + } catch (err) { } + try { - if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ + if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle") { hasSubs = true - } - } catch (err) { } - + } var hasOnlyAC3TrackCommentaries - if (ac3TrackCount > 0 && AC3CommentaryCount == ac3TrackCount ) { + if (ac3TrackCount > 0 && AC3CommentaryCount == ac3TrackCount) { hasOnlyAC3TrackCommentaries = true } else { hasOnlyAC3TrackCommentaries = false @@ -106,9 +109,16 @@ function plugin(file) { } + var channels = file.ffProbeData.streams[1].channels + + if (channels > 6){ + channels = 6 + } + + if (hasOnlyAC3TrackCommentaries && hasSubs) { response.infoLog += "File has only AC3 track Commentaries and has subs" - response.preset = '-sn,-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac 6' + response.preset = '-sn,-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac ' + channels response.reQueueAfter = true; response.processFile = true; return response @@ -116,7 +126,7 @@ function plugin(file) { if (hasNoAC3Track && hasSubs) { response.infoLog += "File has no AC3 track and has subs" - response.preset = '-sn,-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac 6' + response.preset = '-sn,-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac ' + channels response.reQueueAfter = true; response.processFile = true; return response @@ -126,7 +136,7 @@ function plugin(file) { if (!!hasOnlyAC3TrackCommentaries == true) { response.infoLog += " File has only AC3 track Commentaries!" - response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac 6' + response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac ' + channels response.reQueueAfter = true; response.processFile = true; return response @@ -138,7 +148,7 @@ function plugin(file) { if (hasNoAC3Track) { response.infoLog += " File has no AC3 track!" - response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac 6' + response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -ac ' + channels response.reQueueAfter = true; response.processFile = true; return response From 58f2b56e4afa0d323c8988893e834d4b16a24b28 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Fri, 4 Oct 2019 08:18:53 +0100 Subject: [PATCH 6/6] Add files via upload --- .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js new file mode 100644 index 0000000..0ee2b8e --- /dev/null +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -0,0 +1,142 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_s7x9_winsome_h265_10bit", + Name: "Winsome H265 10 bit ", + Type: "Video", + Description: `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_Plugin_s7x9_winsome_h265_10bit" + } +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '', + + } + + + response.FFmpegMode = true + + + + + if (file.fileMedium !== "video") { + + + console.log("File is not video") + + response.infoLog += " File is not video" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + response.container = '.mkv' + + + if (file.ffProbeData.streams[0].codec_name == 'hevc') { + + + var hasEngTrack = false + + + // for (var i = 0; i < file.ffProbeData.streams.length; i++) { + + // try { + // if ( (file.ffProbeData.streams[i].codec_name == "ac3" || file.ffProbeData.streams[i].codec_name == "eac3" || file.ffProbeData.streams[i].codec_name == "dts") && file.ffProbeData.streams[i].tags.language == 'eng') { + + // hasEngTrack = true + + // } + // } catch (err) { + + // } + // } + + try { + if ((file.ffProbeData.streams[1].codec_name == "ac3" || file.ffProbeData.streams[1].codec_name == "eac3" || file.ffProbeData.streams[1].codec_name == "dts")) { + + hasEngTrack = true + + } + } catch (err) { + + } + + + if(!hasEngTrack){ + + response.processFile = true; + response.preset = ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File is already hevc and doesn't have English language track in AC3,EAC3 or DTS!" + return response + + }else{ + + response.infoLog += " File is already hevc and has English language track in AC3,EAC3 or DTS!" + + + } + + + if( file.container != 'mkv'){ + + response.processFile = true; + response.preset = ', -c:v copy -c:a copy' + response.container = '.mkv' + response.handBrakeMode =false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File is not in mkv container!" + return response + + }else{ + + response.infoLog += " File is in mkv container!" + + } + + response.processFile = false; + return response + + } else { + + response.processFile = true; + response.preset = '-Z "H.265 MKV 2160p60" -e x265_10bit' + response.container = '.mkv' + response.handBrakeMode = true + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += " File isn't in hevc!" + return response + + } + } +} + +module.exports.details = details; + +module.exports.plugin = plugin;