FFMpeg-Compressor: Windows cmd support
This commit is contained in:
parent
dc858b4ebb
commit
7ed04ffd22
4 changed files with 19 additions and 4 deletions
|
@ -26,6 +26,7 @@ def get_file_type(filename):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
utils.win_ascii_esc()
|
||||
try:
|
||||
if sys.argv[1][len(sys.argv[1])-1] == "/":
|
||||
arg_path = sys.argv[1][:len(sys.argv[1])-1]
|
||||
|
@ -35,8 +36,8 @@ if __name__ == "__main__":
|
|||
print(utils.help_message())
|
||||
exit()
|
||||
|
||||
orig_folder = arg_path
|
||||
printer.orig_folder = arg_path
|
||||
orig_folder = os.path.abspath(arg_path)
|
||||
printer.orig_folder = os.path.abspath(arg_path)
|
||||
|
||||
printer.bar_init(orig_folder)
|
||||
|
||||
|
@ -72,3 +73,4 @@ if __name__ == "__main__":
|
|||
pass
|
||||
|
||||
utils.get_compression_status(orig_folder)
|
||||
utils.sys_pause()
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
from progress.bar import IncrementalBar
|
||||
import colorama
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
# Fill whole string with spaces for cleaning progress bar
|
||||
|
@ -38,3 +40,8 @@ def files(source, dest, dest_ext, comment):
|
|||
def unknown_file(file):
|
||||
print(clean_str(f"\r* \033[0;33m{file}\033[0m (Not recognized)"))
|
||||
bar.next()
|
||||
|
||||
|
||||
def win_ascii_esc():
|
||||
if sys.platform == "win32":
|
||||
colorama.init()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from modules import configloader
|
||||
from modules import printer
|
||||
from shutil import copyfile
|
||||
from glob import glob
|
||||
import sys
|
||||
import os
|
||||
|
||||
errors_count = 0
|
||||
|
@ -70,5 +70,10 @@ def check_duplicates(new_folder):
|
|||
return new_folder
|
||||
|
||||
|
||||
def sys_pause():
|
||||
if sys.platform == "win32":
|
||||
os.system("pause")
|
||||
|
||||
|
||||
def help_message():
|
||||
return "Usage: ffmpeg-comp {folder}"
|
||||
|
|
|
@ -2,3 +2,4 @@ Pillow==9.5.0
|
|||
pillow-avif-plugin==1.4.1
|
||||
ffmpeg-python==0.2.0
|
||||
progress==1.6
|
||||
colorama==0.4.6
|
Loading…
Add table
Add a link
Reference in a new issue