From 9753da3143a573c67884f5e11ad1c9e00462c479 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 5 Oct 2019 23:02:27 +0100 Subject: [PATCH] updates --- ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 34 ++++++++++++------- Community/Tdarr_Plugin_s7x8_winsome_h265.js | 2 +- .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 2 +- 3 files changed, 24 insertions(+), 14 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 4508bfb..ff6cbe8 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 \n" - 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 \n" - 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! \n" - 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! \n" - 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 diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js index 64dc3e5..e7c8929 100644 --- a/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -125,7 +125,7 @@ function plugin(file) { } else { response.processFile = true; - response.preset = '-Z "H.265 MKV 2160p60"' + response.preset = '-Z "H.265 MKV 2160p60" --all-audio' response.container = '.mkv' response.handBrakeMode = true response.FFmpegMode = true diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index 55a59ff..df86edb 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -125,7 +125,7 @@ function plugin(file) { } else { response.processFile = true; - response.preset = '-Z "H.265 MKV 2160p60" -e x265_10bit' + response.preset = '-Z "H.265 MKV 2160p60" -e x265_10bit --all-audio' response.container = '.mkv' response.handBrakeMode = true response.FFmpegMode = true