summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-18 05:25:09 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-18 05:25:09 +0200
commit14600aa22812176c4f61ffcfd4ae3b0ee62ae368 (patch)
tree8bdd5b4e5e88c50564f5ce4ce9d1743e27fab01e /module/plugins/hoster
parent[SimpleHoster] Improve checkErrors (diff)
downloadpyload-14600aa22812176c4f61ffcfd4ae3b0ee62ae368.tar.xz
Spare plugins updates
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BezvadataCz.py6
-rw-r--r--module/plugins/hoster/CatShareNet.py10
-rw-r--r--module/plugins/hoster/CloudzillaTo.py13
-rw-r--r--module/plugins/hoster/DateiTo.py16
-rw-r--r--module/plugins/hoster/GigapetaCom.py17
-rw-r--r--module/plugins/hoster/NitroflareCom.py26
6 files changed, 21 insertions, 67 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index fbb17635c..b47c2902d 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class BezvadataCz(SimpleHoster):
__name__ = "BezvadataCz"
__type__ = "hoster"
- __version__ = "0.26"
+ __version__ = "0.27"
__pattern__ = r'http://(?:www\.)?bezvadata\.cz/stahnout/.+'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -84,8 +84,8 @@ class BezvadataCz(SimpleHoster):
self.longWait(5 * 60, 24) #: parallel dl limit
elif '<div class="infobox' in self.html:
self.tempOffline()
-
- self.info.pop('error', None)
+ else:
+ return super(BezvadataCz, self).checkErrors()
def loadcaptcha(self, data, *args, **kwargs):
diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py
index 9e3f28cfa..868be4033 100644
--- a/module/plugins/hoster/CatShareNet.py
+++ b/module/plugins/hoster/CatShareNet.py
@@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha
class CatShareNet(SimpleHoster):
__name__ = "CatShareNet"
__type__ = "hoster"
- __version__ = "0.13"
+ __version__ = "0.14"
__pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -38,14 +38,6 @@ class CatShareNet(SimpleHoster):
self.resumeDownload = True
- def checkErrors(self):
- m = re.search(self.IP_BLOCKED_PATTERN, self.html)
- if m:
- self.fail(_("Only connections from Polish IP address are allowed"))
-
- return super(CatShareNet, self).checkErrors()
-
-
def handleFree(self, pyfile):
recaptcha = ReCaptcha(self)
diff --git a/module/plugins/hoster/CloudzillaTo.py b/module/plugins/hoster/CloudzillaTo.py
index 362a8d953..09453137d 100644
--- a/module/plugins/hoster/CloudzillaTo.py
+++ b/module/plugins/hoster/CloudzillaTo.py
@@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class CloudzillaTo(SimpleHoster):
__name__ = "CloudzillaTo"
__type__ = "hoster"
- __version__ = "0.06"
+ __version__ = "0.07"
__pattern__ = r'http://(?:www\.)?cloudzilla\.to/share/file/(?P<ID>[\w^_]+)'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -25,12 +25,17 @@ class CloudzillaTo(SimpleHoster):
def checkErrors(self):
- m = re.search(self.PASSWORD_PATTERN, self.html)
- if m:
- self.html = self.load(self.pyfile.url, get={'key': self.getPassword()})
+ if re.search(self.PASSWORD_PATTERN, self.html):
+ pw = self.getPassword()
+ if pw:
+ self.html = self.load(self.pyfile.url, get={'key': pw})
+ else:
+ self.fail(_("Missing password"))
if re.search(self.PASSWORD_PATTERN, self.html):
self.retry(reason="Wrong password")
+ else:
+ return super(CloudzillaTo, self).checkErrors()
def handleFree(self, pyfile):
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 71a9eb4bf..f0ad95d1e 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DateiTo(SimpleHoster):
__name__ = "DateiTo"
__type__ = "hoster"
- __version__ = "0.07"
+ __version__ = "0.08"
__pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P<ID>\w+)\.html'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -24,7 +24,7 @@ class DateiTo(SimpleHoster):
OFFLINE_PATTERN = r'>Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <'
WAIT_PATTERN = r'countdown\({seconds: (\d+)'
- MULTIDL_PATTERN = r'>Du lädst bereits eine Datei herunter<'
+ DOWNLOAD_PATTERN = r'>Du lädst bereits eine Datei herunter'
DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",'
@@ -60,18 +60,6 @@ class DateiTo(SimpleHoster):
self.link = self.html
- def checkErrors(self):
- m = re.search(self.MULTIDL_PATTERN, self.html)
- if m:
- m = re.search(self.WAIT_PATTERN, self.html)
- wait_time = int(m.group(1)) if m else 30
-
- errmsg = self.info['error'] = _("Parallel downloads")
- self.retry(wait_time=wait_time, reason=errmsg)
-
- self.info.pop('error', None)
-
-
def doWait(self):
m = re.search(self.WAIT_PATTERN, self.html)
wait_time = int(m.group(1)) if m else 30
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index e4d0601fc..c2feeb6f8 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class GigapetaCom(SimpleHoster):
__name__ = "GigapetaCom"
__type__ = "hoster"
- __version__ = "0.03"
+ __version__ = "0.04"
__pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -20,10 +20,12 @@ class GigapetaCom(SimpleHoster):
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- NAME_PATTERN = r'<img src=".*" alt="file" />-->\s*(?P<N>.*?)\s*</td>'
- SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>'
+ NAME_PATTERN = r'<img src=".*" alt="file" />-->\s*(?P<N>.*?)\s*</td>'
+ SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>'
OFFLINE_PATTERN = r'<div id="page_error">'
+ DOWNLOAD_PATTERN = r'"All threads for IP'
+
COOKIES = [("gigapeta.com", "lang", "us")]
@@ -54,13 +56,4 @@ class GigapetaCom(SimpleHoster):
self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
- def checkErrors(self):
- if "All threads for IP" in self.html:
- self.logDebug("Your IP is already downloading a file")
- self.wait(5 * 60, True)
- self.retry()
-
- self.info.pop('error', None)
-
-
getInfo = create_getInfo(GigapetaCom)
diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py
index 40bf0749f..e10bf130b 100644
--- a/module/plugins/hoster/NitroflareCom.py
+++ b/module/plugins/hoster/NitroflareCom.py
@@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster
class NitroflareCom(SimpleHoster):
__name__ = "NitroflareCom"
__type__ = "hoster"
- __version__ = "0.09"
+ __version__ = "0.10"
__pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P<ID>[\w^_]+)'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -34,30 +34,6 @@ class NitroflareCom(SimpleHoster):
ERROR_PATTERN = r'downloading is not possible'
- def checkErrors(self):
- if not self.html:
- return
-
- if not self.premium and re.search(self.PREMIUM_ONLY_PATTERN, self.html):
- self.fail(_("Link require a premium account to be handled"))
-
- elif hasattr(self, 'WAIT_PATTERN'):
- m = re.search(self.WAIT_PATTERN, self.html)
- if m:
- wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in
- re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I))
- self.wait(wait_time, wait_time > 300)
- return
-
- elif hasattr(self, 'ERROR_PATTERN'):
- m = re.search(self.ERROR_PATTERN, self.html)
- if m:
- errmsg = self.info['error'] = m.group(1)
- self.error(errmsg)
-
- self.info.pop('error', None)
-
-
def handleFree(self, pyfile):
# used here to load the cookies which will be required later
self.load(pyfile.url, post={'goToFreePage': ""})