diff options
author | neodarz <neodarz@neodarz.net> | 2017-07-10 18:29:50 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2017-07-10 18:29:50 +0200 |
commit | 25ca561cfc9ca92eb3172dd23d0962a8fc9554f4 (patch) | |
tree | 6cd12d8111b6b3643f0defe524297929ebb17a0d | |
parent | 64e26e695f6522aa9cf678c3308aa4de18b2fe3e (diff) | |
download | video_save-25ca561cfc9ca92eb3172dd23d0962a8fc9554f4.tar.xz video_save-25ca561cfc9ca92eb3172dd23d0962a8fc9554f4.zip |
Drop some usless comments
-rwxr-xr-x | convert.py | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -7,7 +7,6 @@ import re from subprocess import check_output, STDOUT, CalledProcessError, Popen, PIPE import pexpect import time -#import progressbar import datetime if len(sys.argv) == 3: @@ -21,9 +20,6 @@ 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 = [] list_dir = os.listdir(path) @@ -70,39 +66,12 @@ for file in sorted(os.listdir(sourcedir)): totalRange = time.strptime(total.split('.')[0],'%H:%M:%S') totalRangeS = datetime.timedelta(hours=totalRange.tm_hour,minutes=totalRange.tm_min,seconds=totalRange.tm_sec).total_seconds() if re.match(r'.*time=.*', str(unknown_line)): - #print(str(unknown_line)+total) - #print(str(unknown_line).split("=")[2].split()[0]+"/"+total) timeRange = time.strptime(str(unknown_line).split("=")[2].split()[0].split('.')[0],'%H:%M:%S') timeRangeS = datetime.timedelta(hours=timeRange.tm_hour,minutes=timeRange.tm_min,seconds=timeRange.tm_sec).total_seconds() print(str(round(100*timeRangeS/totalRangeS, 1))+"% / 100%", end='\r') - #else if print(unknown_line) # for show other type of error thread.close - #pass - - - - - - - - #p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE) - - #for line in p.stdout: - # print(str(line.rstrip())) - #p.stdout.flush() - - #try: - # print(str(count)+"/"+str(total)) - #output = check_output(["ffmpeg", "-n", "-i", sourcedir+"/"+name+".mp4", "-c:a", "libmp3lame", outdir+"/"+name+".mp3"], stderr=STDOUT) - #except CalledProcessError as e: - #except CalledProcessError as e: - # print(e.message) - # if os.path.getsize(outdir+"/"+name+".mp3") < os.path.getsize(sourcedir+"/"+name+".mp4") and re.search(r'.*[already exists].*', str(e)): - # print("\n\nout: "+str(os.path.getsize(outdir+"/"+name+".mp3"))+" < source:"+str(os.path.getsize(sourcedir+"/"+name+".mp4"))) - # print("BAD") - #sys.exit(1) except KeyboardInterrupt: # Read the comment here => https://stackoverflow.com/a/1112357 ! os.remove(outdir+"/"+name+".mp3") |