Added --allDubs and --allSubs options
This commit is contained in:
parent
d824fd15af
commit
9633a21250
3 changed files with 22 additions and 5 deletions
|
|
@ -1,2 +1,2 @@
|
||||||
ffmpeg: "C:\\Program Files\\ffmpeg\\bin\\ffmpeg.exe"
|
ffmpeg: "./bin/ffmpeg/ffmpeg.exe"
|
||||||
mkvmerge: "./bin/mkvtoolnix/mkvmerge.exe"
|
mkvmerge: "./bin/mkvtoolnix/mkvmerge.exe"
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, outp
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let vid of videoAndAudio) {
|
for (let vid of videoAndAudio) {
|
||||||
console.log(vid, vid.lang);
|
|
||||||
if (!hasVideo) {
|
if (!hasVideo) {
|
||||||
args.push(
|
args.push(
|
||||||
'--video-tracks 0',
|
'--video-tracks 0',
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ const availableFilenameVars = [
|
||||||
'height'
|
'height'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const subLang = [ 'enUS', 'esLA', 'ptBR' ]
|
||||||
|
const dubLang = [ 'enUS', 'esLA', 'ptBR', 'zhMN', 'jaJP' ]
|
||||||
|
|
||||||
const appArgv = (cfg) => {
|
const appArgv = (cfg) => {
|
||||||
// init
|
// init
|
||||||
const argv = yargs.parserConfiguration({
|
const argv = yargs.parserConfiguration({
|
||||||
|
|
@ -74,7 +77,7 @@ const appArgv = (cfg) => {
|
||||||
.option('dub', {
|
.option('dub', {
|
||||||
group: 'Downloading:',
|
group: 'Downloading:',
|
||||||
describe: 'Download non-Japanese Dub (English Dub mode by default)',
|
describe: 'Download non-Japanese Dub (English Dub mode by default)',
|
||||||
choices: [ 'enUS', 'esLA', 'ptBR', 'zhMN', 'jaJP' ],
|
choices: dubLang,
|
||||||
default: cfg.dub || 'enUS',
|
default: cfg.dub || 'enUS',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
})
|
})
|
||||||
|
|
@ -82,7 +85,7 @@ const appArgv = (cfg) => {
|
||||||
group: 'Downloading:',
|
group: 'Downloading:',
|
||||||
describe: 'Set the subtitle language (English is default and fallback)',
|
describe: 'Set the subtitle language (English is default and fallback)',
|
||||||
default: cfg.subLang || 'enUS',
|
default: cfg.subLang || 'enUS',
|
||||||
choices: [ 'enUS', 'esLA', 'ptBR' ],
|
choices: subLang,
|
||||||
type: 'array'
|
type: 'array'
|
||||||
})
|
})
|
||||||
.option('fontSize', {
|
.option('fontSize', {
|
||||||
|
|
@ -91,6 +94,18 @@ const appArgv = (cfg) => {
|
||||||
default: cfg.fontSize || 55,
|
default: cfg.fontSize || 55,
|
||||||
type: 'number'
|
type: 'number'
|
||||||
})
|
})
|
||||||
|
.option('allSubs', {
|
||||||
|
group: 'Downloading:',
|
||||||
|
describe: 'If set to true, all available subs will get downloaded',
|
||||||
|
default: false,
|
||||||
|
type: 'boolean'
|
||||||
|
})
|
||||||
|
.option('allDubs', {
|
||||||
|
group: 'Downloading:',
|
||||||
|
describe: 'If set to true, all available dubs will get downloaded',
|
||||||
|
default: false,
|
||||||
|
type: 'boolean'
|
||||||
|
})
|
||||||
// simulcast
|
// simulcast
|
||||||
.option('simul', {
|
.option('simul', {
|
||||||
group: 'Downloading:',
|
group: 'Downloading:',
|
||||||
|
|
@ -195,8 +210,11 @@ const appArgv = (cfg) => {
|
||||||
|
|
||||||
// --
|
// --
|
||||||
.argv;
|
.argv;
|
||||||
|
|
||||||
// Resolve unwanted arrays
|
// Resolve unwanted arrays
|
||||||
|
if (argv.allDubs)
|
||||||
|
argv.dub = dubLang
|
||||||
|
if (argv.allSubs)
|
||||||
|
argv.subLang = subLang
|
||||||
for (let key in argv) {
|
for (let key in argv) {
|
||||||
if (argv[key] instanceof Array && !(key === 'subLang' || key === 'dub')) {
|
if (argv[key] instanceof Array && !(key === 'subLang' || key === 'dub')) {
|
||||||
argv[key] = argv[key].pop();
|
argv[key] = argv[key].pop();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue