summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2009-07-06 17:36:05 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2009-07-06 17:36:05 -0400
commit0b4fc0f69d3bde6645aebdc0f3a0f37646bee32a (patch)
tree2b6d6e39404e77f79f0580a53b6d2bf550dd28ff
parentAllow for audio track selection via vlc and another zenity prompt. (diff)
downloadOldSchoolRipper-0b4fc0f69d3bde6645aebdc0f3a0f37646bee32a.tar.xz
OldSchoolRipper-0b4fc0f69d3bde6645aebdc0f3a0f37646bee32a.zip
View 20% in.
-rwxr-xr-xrip.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/rip.py b/rip.py
index e19affa..bcb355d 100755
--- a/rip.py
+++ b/rip.py
@@ -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