Fixed bug where added args would get injected improperly if they had a value (#745)

This commit is contained in:
Tzahi12345
2023-04-21 16:34:47 -04:00
parent 24cabc1f02
commit e2c68713ba
2 changed files with 11 additions and 5 deletions

View File

@@ -414,10 +414,11 @@ exports.injectArgs = (original_args, new_args) => {
if (CONSTS.YTDL_ARGS_WITH_VALUES.has(new_arg)) {
if (original_args.includes(new_arg)) {
const original_index = original_args.indexOf(new_arg);
original_args.splice(original_index, 2);
updated_args.splice(original_index, 2);
}
updated_args.push(new_arg, new_args[i + 1]);
i++; // we need to skip the arg value on the next loop
} else {
if (!original_args.includes(new_arg)) {
updated_args.push(new_arg);