summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/WrzucTo.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-22 20:50:34 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-22 20:50:34 +0200
commit2edeee0532ec6d6b4b26fd045a5971f67ca455da (patch)
tree8d656afc9c18f7dba7c05d6635f898fdf58d66d6 /module/plugins/hoster/WrzucTo.py
parentFixed PEP 8 violations in Crypters (diff)
downloadpyload-2edeee0532ec6d6b4b26fd045a5971f67ca455da.tar.xz
Fixed PEP 8 violations in Hosters
Diffstat (limited to 'module/plugins/hoster/WrzucTo.py')
-rw-r--r--module/plugins/hoster/WrzucTo.py38
1 files changed, 21 insertions, 17 deletions
diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py
index 4a5e89f22..861e7f11e 100644
--- a/module/plugins/hoster/WrzucTo.py
+++ b/module/plugins/hoster/WrzucTo.py
@@ -17,9 +17,11 @@
"""
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from pycurl import HTTPHEADER
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
class WrzucTo(SimpleHoster):
__name__ = "WrzucTo"
__type__ = "hoster"
@@ -29,30 +31,32 @@ class WrzucTo(SimpleHoster):
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- SH_COOKIES = [("http://www.wrzuc.to", "language", "en")]
+ SH_COOKIES = [("http://www.wrzuc.to", "language", "en")]
FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>'
FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>'
-
+
def setup(self):
- self.multiDL = True
-
+ self.multiDL = True
+
def handleFree(self):
data = dict(re.findall(r'(md5|file): "(.*?)"', self.html))
- if len(data) != 2: self.parseError('File ID')
-
+ if len(data) != 2:
+ self.parseError('File ID')
+
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
self.req.http.lastURL = self.pyfile.url
- self.load("http://www.wrzuc.to/ajax/server/prepair", post = {"md5": data['md5']})
-
+ self.load("http://www.wrzuc.to/ajax/server/prepair", post={"md5": data['md5']})
+
self.req.http.lastURL = self.pyfile.url
- self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post = {"file": data['file']})
-
+ self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post={"file": data['file']})
+
data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html))
- if len(data) != 4: self.parseError('Download URL')
-
- download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link'])
- self.logDebug("Download URL: %s" % download_url)
+ if len(data) != 4:
+ self.parseError('Download URL')
+
+ download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link'])
+ self.logDebug("Download URL: %s" % download_url)
self.download(download_url)
-
-getInfo = create_getInfo(WrzucTo)
+
+getInfo = create_getInfo(WrzucTo)