summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Vuolter <vuolter@gmail.com> 2013-05-20 23:57:14 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2013-05-25 09:29:39 +0200
commit2c8d1c3b562e43f02064c1c70ca763751ad38e64 (patch)
tree0edd295b65fa197d3cca8d28e6a561b01934934f
parentVersion 0.05: several fixed according stickell advices (diff)
downloadpyload-2c8d1c3b562e43f02064c1c70ca763751ad38e64.tar.xz
Version 0.06: improved filename recognition (big thanks to stickell)
-rw-r--r--module/plugins/hooks/SkipRev.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py
index 9e9f1af64..dccb153d8 100644
--- a/module/plugins/hooks/SkipRev.py
+++ b/module/plugins/hooks/SkipRev.py
@@ -19,12 +19,12 @@
from module.plugins.Hook import Hook
from os.path import basename
-from re import group, search
+from re import search
class SkipRev(Hook):
__name__ = "SkipRev"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = "Skip download when filename has rev extension"
__config__ = [
("activated", "bool", "Activated", "False"),
@@ -38,8 +38,8 @@ class SkipRev(Hook):
name = basename(pyfile.name)
if name.endswith(".rev"):
number = self.getConfig("number")
- part = search('(\.part(.+?)\.rev)*$', name).group(2)
- if int(part) <= number:
+ part = search(r'\.part(\d+)\.rev$', name)
+ if not part or int(part.group(1)) <= number:
return
self.logInfo("Skipping " + name)
pyfile.setStatus("skipped")