From aaaf5a4cddec894aacd7400c59a9f2f5e710362f Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 22 Jul 2013 20:50:34 +0200 Subject: Fixed PEP 8 violations in Hosters (cherry picked from commit 2edeee0532ec6d6b4b26fd045a5971f67ca455da) Conflicts: pyload/plugins/hoster/BasePlugin.py pyload/plugins/hoster/MultishareCz.py pyload/plugins/hoster/NetloadIn.py pyload/plugins/hoster/PremiumizeMe.py pyload/plugins/hoster/RapidshareCom.py --- pyload/plugins/hoster/WrzucTo.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'pyload/plugins/hoster/WrzucTo.py') diff --git a/pyload/plugins/hoster/WrzucTo.py b/pyload/plugins/hoster/WrzucTo.py index 4a5e89f22..861e7f11e 100644 --- a/pyload/plugins/hoster/WrzucTo.py +++ b/pyload/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*\s*(?P.*?)' FILE_NAME_PATTERN = r'id="file_info">\s*(?P.*?)' - + 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) -- cgit v1.2.3