summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-16 03:44:15 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-16 03:44:15 +0100
commit3d27f5ccee412d38102873a5b02e3f236375eb97 (patch)
treec8d782ccfe267301b8239d5f75e471cdcae7faa2
parentMerge branch 'pr/n959_philou75' into stable (diff)
downloadpyload-3d27f5ccee412d38102873a5b02e3f236375eb97.tar.xz
Update plugins (2)
-rw-r--r--module/plugins/hooks/RestartSlow.py4
-rw-r--r--module/plugins/hooks/SkipRev.py6
-rw-r--r--module/plugins/hoster/FilerNet.py22
-rw-r--r--module/plugins/hoster/SendspaceCom.py4
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py2
-rw-r--r--module/plugins/internal/MultiHoster.py50
6 files changed, 49 insertions, 39 deletions
diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py
index 587799235..c2fdf6f95 100644
--- a/module/plugins/hooks/RestartSlow.py
+++ b/module/plugins/hooks/RestartSlow.py
@@ -8,7 +8,7 @@ from module.plugins.Hook import Hook
class RestartSlow(Hook):
__name__ = "RestartSlow"
__type__ = "hook"
- __version__ = "0.02"
+ __version__ = "0.03"
__config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ),
("free_time" , "int" , "Sample interval in minutes" , 5 ),
@@ -45,7 +45,7 @@ class RestartSlow(Hook):
limit = max(5, self.getConfig("%s_limit" % type) * 1024)
chunks = [chunk for chunk in self.pyfile.req.dl.chunks \
- if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] not is (time, limit)]
+ if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] is not (time, limit)]
for chunk in chunks:
chunk.c.setopt(pycurl.LOW_SPEED_TIME , time)
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py
index 107740a3d..d21aa0f6d 100644
--- a/module/plugins/hooks/SkipRev.py
+++ b/module/plugins/hooks/SkipRev.py
@@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload
class SkipRev(Hook):
__name__ = "SkipRev"
__type__ = "hook"
- __version__ = "0.15"
+ __version__ = "0.16"
__config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)]
@@ -45,13 +45,13 @@ class SkipRev(Hook):
else:
self.logWarning("Unable to grab file name")
- name = urlparse(unquote(url)).path.split('/')[-1])
+ name = urlparse(unquote(url)).path.split('/')[-1]
return name
def downloadPreparing(self, pyfile):
- if pyfile.getStatusName() is "unskipped" or not pyname(pyfile).endswith(".rev"):
+ if pyfile.getStatusName() is "unskipped" or not self.pyname(pyfile).endswith(".rev"):
return
tokeep = self.getConfig("tokeep")
diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py
index 5dd72efe7..5a33439d2 100644
--- a/module/plugins/hoster/FilerNet.py
+++ b/module/plugins/hoster/FilerNet.py
@@ -4,6 +4,7 @@
# http://filer.net/get/ivgf5ztw53et3ogd
# http://filer.net/get/hgo14gzcng3scbvv
+import pycurl
import re
from urlparse import urljoin
@@ -15,13 +16,13 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilerNet(SimpleHoster):
__name__ = "FilerNet"
__type__ = "hoster"
- __version__ = "0.10"
+ __version__ = "0.11"
__pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+'
__description__ = """Filer.net hoster plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")
+ __authors__ = [("stickell", "l.stickell@yahoo.it"),
("Walter Purcaro", "vuolter@gmail.com")]
@@ -57,15 +58,18 @@ class FilerNet(SimpleHoster):
for _i in xrange(5):
challenge, response = recaptcha.challenge()
- header = self.load(self.pyfile.url,
- post={'recaptcha_challenge_field': challenge,
- 'recaptcha_response_field' : response,
- 'hash' : inputs['hash']})
+ #@NOTE: Work-around for v0.4.9 just_header issue
+ #@TODO: Check for v0.4.10
+ self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
+ self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge,
+ 'recaptcha_response_field' : response,
+ 'hash' : inputs['hash']}))
+ self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
- if 'location' in header and header['location']:
+ if 'location' in self.req.http.header.lower():
+ self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1)
self.correctCaptcha()
- self.link = header['location']
- return
+ break
else:
self.invalidCaptcha()
diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py
index 630a85cc4..12f966e31 100644
--- a/module/plugins/hoster/SendspaceCom.py
+++ b/module/plugins/hoster/SendspaceCom.py
@@ -8,9 +8,9 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class SendspaceCom(SimpleHoster):
__name__ = "SendspaceCom"
__type__ = "hoster"
- __version__ = "0.15"
+ __version__ = "0.16"
- __pattern__ = r'https?://(?:www\.)?sendspace\.com/file/.*'
+ __pattern__ = r'https?://(?:www\.)?sendspace\.com/file/\w+'
__description__ = """Sendspace.com hoster plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index 1cb651b12..c40e8560f 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -48,7 +48,7 @@ class ShareonlineBiz(SimpleHoster):
if field[1] == "OK":
info['fileid'] = field[0]
info['status'] = 2
- info['name'] = field[2]
+ info['name'] = field[2]
info['size'] = field[3] #: in bytes
info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5
diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py
index 6ec2e4b82..6d10d17d9 100644
--- a/module/plugins/internal/MultiHoster.py
+++ b/module/plugins/internal/MultiHoster.py
@@ -9,7 +9,7 @@ from module.utils import remove_chars
class MultiHoster(Hook):
__name__ = "MultiHoster"
__type__ = "hook"
- __version__ = "0.20"
+ __version__ = "0.21"
__description__ = """Generic MultiHoster plugin"""
__license__ = "GPLv3"
@@ -18,12 +18,18 @@ class MultiHoster(Hook):
interval = 12 * 60 * 60 #: reload hosters every 12h
- HOSTER_REPLACEMENTS = [("1fichier.com", "onefichier.com"), ("2shared.com", "twoshared.com"),
- ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"),
- ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"),
- ("hellshare.com", "hellshare.cz"), ("ifile.it", "filecloud.io"),
- ("putlocker.com", "firedrive.com"), ("share-rapid.cz", "multishare.cz"),
- ("sharerapid.cz", "multishare.cz"), ("ul.to", "uploaded.to"),
+ HOSTER_REPLACEMENTS = [("1fichier.com", "onefichier.com"),
+ ("2shared.com", "twoshared.com"),
+ ("4shared.com", "fourshared.com"),
+ ("cloudnator.com", "shragle.com"),
+ ("easy-share.com", "crocko.com"),
+ ("freakshare.net", "freakshare.com"),
+ ("hellshare.com", "hellshare.cz"),
+ ("ifile.it", "filecloud.io"),
+ ("putlocker.com", "firedrive.com"),
+ ("share-rapid.cz", "multishare.cz"),
+ ("sharerapid.cz", "multishare.cz"),
+ ("ul.to", "uploaded.to"),
("uploaded.net", "uploaded.to")]
HOSTER_EXCLUDED = []
@@ -152,9 +158,9 @@ class MultiHoster(Hook):
# inject plugin plugin
self.logDebug("Overwritten Hosters", ", ".join(sorted(self.supported)))
for hoster in self.supported:
- dict = self.core.pluginManager.hosterPlugins[hoster]
- dict['new_module'] = module
- dict['new_name'] = self.__name__
+ hdict = self.core.pluginManager.hosterPlugins[hoster]
+ hdict['new_module'] = module
+ hdict['new_name'] = self.__name__
if excludedList:
self.logInfo(_("The following hosters were not overwritten - account exists"), ", ".join(sorted(excludedList)))
@@ -169,19 +175,19 @@ class MultiHoster(Hook):
self.logDebug("Regexp", regexp)
- dict = self.core.pluginManager.hosterPlugins[self.__name__]
- dict['pattern'] = regexp
- dict['re'] = re.compile(regexp)
+ hdict = self.core.pluginManager.hosterPlugins[self.__name__]
+ hdict['pattern'] = regexp
+ hdict['re'] = re.compile(regexp)
def unloadHoster(self, hoster):
- dict = self.core.pluginManager.hosterPlugins[hoster]
- if "module" in dict:
- del dict['module']
+ hdict = self.core.pluginManager.hosterPlugins[hoster]
+ if "module" in hdict:
+ del hdict['module']
- if "new_module" in dict:
- del dict['new_module']
- del dict['new_name']
+ if "new_module" in hdict:
+ del hdict['new_module']
+ del hdict['new_name']
def unload(self):
@@ -191,9 +197,9 @@ class MultiHoster(Hook):
# reset pattern
klass = getattr(self.core.pluginManager.getPlugin(self.__name__), self.__name__)
- dict = self.core.pluginManager.hosterPlugins[self.__name__]
- dict['pattern'] = getattr(klass, "__pattern__", r'^unmatchable$')
- dict['re'] = re.compile(dict['pattern'])
+ hdict = self.core.pluginManager.hosterPlugins[self.__name__]
+ hdict['pattern'] = getattr(klass, "__pattern__", r'^unmatchable$')
+ hdict['re'] = re.compile(hdict['pattern'])
def downloadFailed(self, pyfile):