updated
This commit is contained in:
@@ -12,9 +12,12 @@ skipto = " -ss "
|
|||||||
|
|
||||||
#droppedFile = "test.mkv"
|
#droppedFile = "test.mkv"
|
||||||
|
|
||||||
del sys.argv[0]
|
|
||||||
|
|
||||||
for i, each in enumerate(sys.argv):
|
|
||||||
|
#skip first part of sys.argv since it points to script location
|
||||||
|
arguments = sys.argv[1:]
|
||||||
|
|
||||||
|
for i, each in enumerate(arguments):
|
||||||
|
|
||||||
arg_list = 'ffprobe.exe -i "{each}"'.format(each=each)
|
arg_list = 'ffprobe.exe -i "{each}"'.format(each=each)
|
||||||
|
|
||||||
@@ -36,7 +39,7 @@ x = (int(x) for x in input ("Enter tracks to keep: ").split())
|
|||||||
|
|
||||||
track = "".join(" -map 0:a:{}".format(y) for y in x)
|
track = "".join(" -map 0:a:{}".format(y) for y in x)
|
||||||
|
|
||||||
for each in sys.argv:
|
for each in arguments:
|
||||||
|
|
||||||
path = each
|
path = each
|
||||||
basename = os.path.basename(path)
|
basename = os.path.basename(path)
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ print(droppedName)
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
isExist = os.path.exists(output_path+output_folder_name)
|
||||||
@@ -24,7 +27,7 @@ if not isExist:
|
|||||||
os.makedirs(output_path+output_folder_name)
|
os.makedirs(output_path+output_folder_name)
|
||||||
|
|
||||||
|
|
||||||
for file in sys.argv:
|
for file in arguments:
|
||||||
|
|
||||||
basename = os.path.basename(file)
|
basename = os.path.basename(file)
|
||||||
print(file)
|
print(file)
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ print(droppedName)
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
isExist = os.path.exists(output_path+output_folder_name)
|
||||||
@@ -23,7 +26,7 @@ if not isExist:
|
|||||||
os.makedirs(output_path+output_folder_name)
|
os.makedirs(output_path+output_folder_name)
|
||||||
|
|
||||||
|
|
||||||
for file in sys.argv:
|
for file in arguments:
|
||||||
|
|
||||||
basename = os.path.basename(file)
|
basename = os.path.basename(file)
|
||||||
print(file)
|
print(file)
|
||||||
|
|||||||
@@ -10,9 +10,12 @@ skipto = " -ss "
|
|||||||
|
|
||||||
#droppedFile = "test.mkv"
|
#droppedFile = "test.mkv"
|
||||||
count = 0
|
count = 0
|
||||||
del sys.argv[0]
|
|
||||||
|
|
||||||
for each in sys.argv:
|
|
||||||
|
#skip first part of sys.argv since it points to script location
|
||||||
|
arguments = sys.argv[1:]
|
||||||
|
|
||||||
|
for each in arguments:
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
print(each)
|
print(each)
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ droppedName = Path(droppedFile).name
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[0]
|
output_path = head_tail[0]
|
||||||
|
|
||||||
|
|
||||||
|
#skip first part of sys.argv since it points to script location
|
||||||
arguments = sys.argv[1:]
|
arguments = sys.argv[1:]
|
||||||
|
|
||||||
#check if output folder exists, otherwise create it
|
#check if output folder exists, otherwise create it
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import subprocess, sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
folder_path=os.getcwd()
|
|
||||||
p = subprocess.Popen(["powershell.exe", "dir"])
|
|
||||||
|
|
||||||
|
|
||||||
res=p.communicate()
|
|
||||||
@@ -11,7 +11,10 @@ droppedName = Path(droppedFile).name
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
isExist = os.path.exists(output_path+output_folder_name)
|
||||||
@@ -28,7 +31,7 @@ lines = "-map 0:v -c:v libx265 -preset slow -crf 20 -x265-params level=51:no-sao
|
|||||||
number_of_segments=int(input("Number of segments: "))
|
number_of_segments=int(input("Number of segments: "))
|
||||||
segment_length=int(input("How long should each segment be(seconds)? "))
|
segment_length=int(input("How long should each segment be(seconds)? "))
|
||||||
|
|
||||||
for i, file in enumerate(sys.argv):
|
for i, file in enumerate(arguments):
|
||||||
|
|
||||||
arg_list = 'ffprobe.exe -show_entries format=duration -i "{file}"'.format(file=file)
|
arg_list = 'ffprobe.exe -show_entries format=duration -i "{file}"'.format(file=file)
|
||||||
print(arg_list)
|
print(arg_list)
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ droppedName = Path(droppedFile).name
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
isExist = os.path.exists(output_path+output_folder_name)
|
||||||
@@ -27,7 +30,7 @@ org_lineslines = " -map 0:v -c:v libx264 -crf 5 -map 0:a -c:a copy -map 0:s -c:s
|
|||||||
number_of_segments=int(input("Number of segments: "))
|
number_of_segments=int(input("Number of segments: "))
|
||||||
segment_length=int(input("How long should each segment be(seconds)? "))
|
segment_length=int(input("How long should each segment be(seconds)? "))
|
||||||
|
|
||||||
for i, file in enumerate(sys.argv):
|
for i, file in enumerate(arguments):
|
||||||
|
|
||||||
arg_list = 'ffprobe.exe -show_entries format=duration -i "{file}"'.format(file=file)
|
arg_list = 'ffprobe.exe -show_entries format=duration -i "{file}"'.format(file=file)
|
||||||
print(arg_list)
|
print(arg_list)
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ droppedName = Path(droppedFile).name
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
isExist = os.path.exists(output_path+output_folder_name)
|
||||||
@@ -22,7 +24,7 @@ if not isExist:
|
|||||||
number_of_ss=int(input("Number of ss: "))
|
number_of_ss=int(input("Number of ss: "))
|
||||||
print(number_of_ss)
|
print(number_of_ss)
|
||||||
|
|
||||||
for i, file in enumerate(sys.argv):
|
for i, file in enumerate(arguments):
|
||||||
|
|
||||||
arg_list = 'ffprobe.exe -show_entries format=duration -i "{file}"'.format(file=file)
|
arg_list = 'ffprobe.exe -show_entries format=duration -i "{file}"'.format(file=file)
|
||||||
print(arg_list)
|
print(arg_list)
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ droppedName = Path(droppedFile).name
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
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)
|
arg_list = 'ffprobe.exe -i "{file}"'.format(file=file)
|
||||||
|
|
||||||
cmd = subprocess.Popen(arg_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='UTF-8')
|
cmd = subprocess.Popen(arg_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='UTF-8')
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ droppedName = Path(droppedFile).name
|
|||||||
#get path of script location and remove the tail
|
#get path of script location and remove the tail
|
||||||
head_tail = os.path.split(sys.argv[0])
|
head_tail = os.path.split(sys.argv[0])
|
||||||
output_path = head_tail[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
|
#check if output folder exists, otherwise create it
|
||||||
isExist = os.path.exists(output_path+output_folder_name)
|
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)
|
arg_list = 'ffprobe.exe -i "{file}"'.format(file=file)
|
||||||
|
|
||||||
cmd = subprocess.Popen(arg_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='UTF-8')
|
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())
|
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)
|
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)
|
basename = os.path.basename(file)
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,12 @@ skipto = " -ss "
|
|||||||
|
|
||||||
#droppedFile = "test.mkv"
|
#droppedFile = "test.mkv"
|
||||||
|
|
||||||
del sys.argv[0]
|
|
||||||
|
|
||||||
for i, each in enumerate(sys.argv):
|
|
||||||
|
#skip first part of sys.argv since it points to script location
|
||||||
|
arguments = sys.argv[1:]
|
||||||
|
|
||||||
|
for i, each in enumerate(arguments):
|
||||||
|
|
||||||
arg_list = 'ffprobe.exe -i "{each}"'.format(each=each)
|
arg_list = 'ffprobe.exe -i "{each}"'.format(each=each)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user