summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/DateiTo.py
diff options
context:
space:
mode:
authorGravatar lazlev <lazlev@yopmail.com> 2015-08-09 00:50:54 +0200
committerGravatar lazlev <lazlev@yopmail.com> 2015-08-09 00:50:54 +0200
commitb0ef3f1673e1930916604bb1264ca3a38414bc8d (patch)
treec97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/hoster/DateiTo.py
parent[XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff)
parentFix https://github.com/pyload/pyload/issues/1707 (diff)
downloadpyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/hoster/DateiTo.py')
-rw-r--r--module/plugins/hoster/DateiTo.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 92a96b9ec..d90fc5864 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -2,14 +2,15 @@
import re
-from module.plugins.internal.ReCaptcha import ReCaptcha
+from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DateiTo(SimpleHoster):
__name__ = "DateiTo"
__type__ = "hoster"
- __version__ = "0.09"
+ __version__ = "0.10"
+ __status__ = "testing"
__pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P<ID>\w+)\.html'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -29,21 +30,21 @@ class DateiTo(SimpleHoster):
DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",'
- def handleFree(self, pyfile):
+ def handle_free(self, pyfile):
url = 'http://datei.to/ajax/download.php'
data = {'P': 'I', 'ID': self.info['pattern']['ID']}
recaptcha = ReCaptcha(self)
for _i in xrange(10):
- self.logDebug("URL", url, "POST", data)
+ self.log_debug("URL", url, "POST", data)
self.html = self.load(url, post=data)
- self.checkErrors()
+ self.check_errors()
if url.endswith('download.php') and 'P' in data:
- if data['P'] == 'I':
- self.doWait()
+ if data['P'] == "I":
+ self.do_wait()
- elif data['P'] == 'IV':
+ elif data['P'] == "IV":
break
m = re.search(self.DATA_PATTERN, self.html)
@@ -60,7 +61,7 @@ class DateiTo(SimpleHoster):
self.link = self.html
- def doWait(self):
+ def do_wait(self):
m = re.search(self.WAIT_PATTERN, self.html)
wait_time = int(m.group(1)) if m else 30