Compare commits
6 Commits
eb2a7b46c4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fa79a752b | |||
| 4c24372e48 | |||
| e7c224f335 | |||
| c6292e14dd | |||
| 9c60d80bbd | |||
| 45da0baf90 |
@ -4,7 +4,7 @@ const details = () => ({
|
|||||||
Name: 'MrMeeb Extract Subtitles',
|
Name: 'MrMeeb Extract Subtitles',
|
||||||
Type: 'Subtitle',
|
Type: 'Subtitle',
|
||||||
Operation: 'Transcode',
|
Operation: 'Transcode',
|
||||||
Description: 'Automatically extracts SRT subtitles to external files and removes the embedded ones.',
|
Description: 'Automatically extracts SRT subtitles to external files and removes the embedded ones. Created to fix a bug where Infuse cannot auto-select embedded forced subtitles',
|
||||||
Version: '0.1',
|
Version: '0.1',
|
||||||
Tags: 'pre-processing',
|
Tags: 'pre-processing',
|
||||||
Inputs: [],
|
Inputs: [],
|
||||||
@ -56,6 +56,7 @@ const details = () => ({
|
|||||||
let subIdx = -1; // The stream index of the current subtitle stream, relative to all subtitle steams
|
let subIdx = -1; // The stream index of the current subtitle stream, relative to all subtitle steams
|
||||||
|
|
||||||
console.log(` === Running Extract Subs function === `)
|
console.log(` === Running Extract Subs function === `)
|
||||||
|
response.jobLog += `Hello!`
|
||||||
|
|
||||||
// Identify all subtitles
|
// Identify all subtitles
|
||||||
for (let i = 0; i < file.ffProbeData.streams.length; i ++) {
|
for (let i = 0; i < file.ffProbeData.streams.length; i ++) {
|
||||||
@ -153,9 +154,11 @@ const details = () => ({
|
|||||||
|
|
||||||
if (ffmpegSubs.length > 0) {
|
if (ffmpegSubs.length > 0) {
|
||||||
|
|
||||||
|
let subName = removeMKV(otherArguments.originalLibraryFile.meta.FileName)
|
||||||
|
|
||||||
response.infoLog += '☒ Changes are required! \n Extracting SRT files';
|
response.infoLog += '☒ Changes are required! \n Extracting SRT files';
|
||||||
|
|
||||||
require("child_process").execSync(`rm -rf ${otherArguments.originalLibraryFile.meta.Directory}/*.srt`)
|
require("child_process").execSync(`rm -rf "${otherArguments.originalLibraryFile.meta.Directory}/${subName}"*.srt`)
|
||||||
|
|
||||||
response.FFmpegMode = true;
|
response.FFmpegMode = true;
|
||||||
|
|
||||||
|
|||||||
@ -291,7 +291,7 @@ const response = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Identify if stream is DTS-HD MA
|
// Identify if stream is DTS-HD MA
|
||||||
if (file.ffProbeData.streams[i].codec_name.toLowerCase() === 'dts') {
|
if (file.ffProbeData.streams[i].profile != undefined && file.ffProbeData.streams[i].profile.toLowerCase() === 'dts-hd ma') {
|
||||||
|
|
||||||
// Check if DTS-HD MA has already been handled by a previous run
|
// Check if DTS-HD MA has already been handled by a previous run
|
||||||
// Assume that it will be the second stream (first audio stream) - it should be, if already handled
|
// Assume that it will be the second stream (first audio stream) - it should be, if already handled
|
||||||
|
|||||||
Reference in New Issue
Block a user