summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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