aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-07-10 18:29:50 +0200
committerneodarz <neodarz@neodarz.net>2017-07-10 18:29:50 +0200
commitb9df2f62197f12c6ddb4b7dd9209f3fb087a177f (patch)
tree1f2ba22327f1928483aa2587bfca02bcae4e446e
parentcdc34f6d6de6d846ce0241f98ffd9c7a07b25483 (diff)
downloadconvert.py-b9df2f62197f12c6ddb4b7dd9209f3fb087a177f.tar.xz
convert.py-b9df2f62197f12c6ddb4b7dd9209f3fb087a177f.zip
Drop some usless comments
-rwxr-xr-xconvert.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/convert.py b/convert.py
index d700698..10e346d 100755
--- a/convert.py
+++ b/convert.py
@@ -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")