This commit is contained in:
Elghinnarisa
2022-09-09 20:18:34 +02:00
parent 19ad920d93
commit d4d12e2d41
12 changed files with 54 additions and 30 deletions

View File

@@ -15,7 +15,10 @@ droppedName = Path(droppedFile).name
#get path of script location and remove the tail
head_tail = os.path.split(sys.argv[0])
output_path = head_tail[0]
del sys.argv[0]
#skip first part of sys.argv since it points to script location
arguments = sys.argv[1:]
#check if output folder exists, otherwise create it
isExist = os.path.exists(output_path+output_folder_name)
@@ -28,7 +31,7 @@ if not isExist:
for i, file in enumerate(sys.argv):
for i, file in enumerate(arguments):
arg_list = 'ffprobe.exe -i "{file}"'.format(file=file)
cmd = subprocess.Popen(arg_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='UTF-8')
@@ -51,7 +54,7 @@ audio_track = "".join(" -map 0:a:{}".format(y) for y in x)
z = (int(z) for z in input ("Enter subtitle tracks to keep: ").split())
subtitle_track = "".join(" -map 0:s:{}".format(y) for y in z)
for file in sys.argv:
for file in arguments:
basename = os.path.basename(file)