diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2009-07-06 17:36:05 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2009-07-06 17:36:05 -0400 |
commit | 0b4fc0f69d3bde6645aebdc0f3a0f37646bee32a (patch) | |
tree | 2b6d6e39404e77f79f0580a53b6d2bf550dd28ff | |
parent | Allow for audio track selection via vlc and another zenity prompt. (diff) | |
download | OldSchoolRipper-0b4fc0f69d3bde6645aebdc0f3a0f37646bee32a.tar.xz OldSchoolRipper-0b4fc0f69d3bde6645aebdc0f3a0f37646bee32a.zip |
View 20% in.
-rwxr-xr-x | rip.py | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -25,10 +25,20 @@ class Rip(threading.Thread): def isVob(file): return file.endswith(".VOB") movies = filter(isVob, movies) movies.sort() - index = 0 - if len(movies) > 1: - index = 1 - os.system("vlc ./ripping/%s/VIDEO_TS/%s" % (movie, movies[index])) + totalSize = 0 + if len(movies) >= 3: + os.path.getsize("./ripping/%s/VIDEO_TS/%s" % (movie, movies[0])) + 300 < os.path.getsize("./ripping/%s/VIDEO_TS/%s" % (movie, movies[1])): + del movies[0] + for vob in movies: + totalSize += os.path.getsize("./ripping/%s/VIDEO_TS/%s" % (movie, vob)) + partialSize = 0 + twentyPercent = movies[0] + for vob in movies: + partialSize += os.path.getsize("./ripping/%s/VIDEO_TS/%s" % (movie, vob)) + if float(partialSize) / float(totalSize) >= .2: + twentyPercent = vob + break + os.system("vlc ./ripping/%s/VIDEO_TS/%s" % (movie, twentyPercent)) os.system("zenity --entry --text=\"Please enter the correct audio track number. This must be a digit.\" --entry-text=1 > ./ripping/%s/VIDEO_TS/audiotrack.txt" % movie) except: pass |