summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-07-10 18:27:54 +0200
committerneodarz <neodarz@neodarz.net>2017-07-10 18:27:54 +0200
commit64e26e695f6522aa9cf678c3308aa4de18b2fe3e (patch)
treed29447e614b335805e4a322848875444dcb53469
parent5656ca6b16d050cd0c3f1f404915ed2c55855c7d (diff)
downloadvideo_save-64e26e695f6522aa9cf678c3308aa4de18b2fe3e.tar.xz
video_save-64e26e695f6522aa9cf678c3308aa4de18b2fe3e.zip
Add argument option for choose input folder and output folder
Diffstat (limited to '')
-rwxr-xr-xconvert.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/convert.py b/convert.py
index ba1bc08..d700698 100755
--- a/convert.py
+++ b/convert.py
@@ -4,16 +4,25 @@ import sys
import os
import subprocess
import re
-#from subprocess import PIPE, CalledProcessError, check_call, Popen
from subprocess import check_output, STDOUT, CalledProcessError, Popen, PIPE
import pexpect
import time
-import progressbar
+#import progressbar
import datetime
+if len(sys.argv) == 3:
+ sourcedir = sys.argv[1]
+ outdir = sys.argv[2]
-sourcedir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum/Cracktro"
-outdir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum_mp3/Cracktro"
+ if not os.path.isdir(sourcedir):
+ print("No such file or directory: '"+str(sourcedir)+"'")
+ sys.exit()
+else:
+ print("Simple tool for convert mp4 file to mp3")
+ print("Usage:\nconvert.py [SOURCE] [DESTINATION]")
+
+#sourcedir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum/Cracktro"
+#outdir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum_mp3/Cracktro"
def dirSize(path,ext1,ext2):
list_dir = []