From c67334ee73eb103e7b3e821264926be0370fba06 Mon Sep 17 00:00:00 2001 From: drpeppershaker <67330126+drpeppershaker@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:34:10 -0500 Subject: [PATCH 1/4] Update Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js --- ..._Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 5b229ef..f5788f7 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -13,7 +13,7 @@ module.exports.details = function details() { + 'other options.', // Created by drpeppershaker with help from reddit user /u/jakejones48, lots of // improvements made after looking at "Tdarr_Plugin_078d" by HaveAGitGat. - Version: '1.00', + Version: '1.04', Link: '', Tags: 'pre-processing,subtitle only,ffmpeg,configurable', Inputs: [ @@ -66,9 +66,14 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { for (let i = 0; i < subsArr.length; i += 1) { const subStream = subsArr[i]; let lang = ''; + let title = 'none'; if (subStream.tags) { - lang = subStream.tags.language; + lang = subStream.tags.language.toLowerCase(); + } + + if (subStream.tags.title) { + title = subStream.tags.title; } let subsFile = file.file; @@ -80,6 +85,8 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { const { index } = subStream; if (fs.existsSync(`${subsFile}`)) { response.infoLog += `${lang}.srt already exists. Skipping!\n`; + } else if (title.toLowerCase().includes('commentary') || title.toLowerCase().includes('description')) { + response.infoLog += `Stream ${i} ${lang}.srt is a ${title} track. Skipping!\n`; } else { response.infoLog += `Extracting ${lang}.srt\n`; command += ` -map 0:${index} "${subsFile}"`; From 3cb7fe8d0385adaa618227680684a8d0c755f3f5 Mon Sep 17 00:00:00 2001 From: drpeppershaker <67330126+drpeppershaker@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:36:30 -0500 Subject: [PATCH 2/4] Update Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js --- .../Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index f5788f7..4876261 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -69,9 +69,9 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { let title = 'none'; if (subStream.tags) { - lang = subStream.tags.language.toLowerCase(); + lang = subStream.tags } - + if (subStream.tags.title) { title = subStream.tags.title; } From 31f90319b2827c88f645dda2410b8f165160a34e Mon Sep 17 00:00:00 2001 From: drpeppershaker <67330126+drpeppershaker@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:39:22 -0500 Subject: [PATCH 3/4] Update Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js --- .../Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 4876261..7de46f5 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -69,9 +69,9 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { let title = 'none'; if (subStream.tags) { - lang = subStream.tags + lang = subStream.tags; } - + if (subStream.tags.title) { title = subStream.tags.title; } From 4726f6bf91e39973abce442e748cb33aa9876c7b Mon Sep 17 00:00:00 2001 From: drpeppershaker <67330126+drpeppershaker@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:42:43 -0500 Subject: [PATCH 4/4] Update Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js --- .../Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 7de46f5..88eced3 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -69,7 +69,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { let title = 'none'; if (subStream.tags) { - lang = subStream.tags; + lang = subStream.tags.language; } if (subStream.tags.title) {