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/MultishareCz.py | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'pyload/plugins/hoster/MultishareCz.py') diff --git a/pyload/plugins/hoster/MultishareCz.py b/pyload/plugins/hoster/MultishareCz.py index af7aa94cf..d4f6c41b4 100644 --- a/pyload/plugins/hoster/MultishareCz.py +++ b/pyload/plugins/hoster/MultishareCz.py @@ -20,57 +20,59 @@ import re from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?multishare.cz/stahnout/(?P\d+).*" - __version__ = "0.40" + __version__ = "0.41" __description__ = """MultiShare.cz""" __author_name__ = ("zoidberg") FILE_INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' FILE_OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' FILE_SIZE_REPLACEMENTS = [(' ', '')] - + def process(self, pyfile): msurl = re.match(self.__pattern__, pyfile.url) if msurl: - self.fileID = msurl.group('ID') - self.html = self.load(pyfile.url, decode = True) + self.fileID = msurl.group('ID') + self.html = self.load(pyfile.url, decode=True) self.getFileInfo() - + if self.premium: self.handlePremium() else: - self.handleFree() - else: - self.handleOverriden() + self.handleFree() + else: + self.handleOverriden() def handleFree(self): self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.fileID) - + def handlePremium(self): if not self.checkTrafficLeft(): self.logWarning("Not enough credit left to download file") - self.resetAccount() - + self.resetAccount() + self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) self.checkTrafficLeft() - + def handleOverriden(self): - if not self.premium: + if not self.premium: self.fail("Only premium users can download from other hosters") - - self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post = {"link": self.pyfile.url}, decode = True) - self.getFileInfo() - + + self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post={"link": self.pyfile.url}, decode=True) + self.getFileInfo() + if not self.checkTrafficLeft(): self.fail("Not enough credit left to download file") - - url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random()*10000*random()) - params = {"u_ID" : self.acc_info["u_ID"], "u_hash" : self.acc_info["u_hash"], "link" : self.pyfile.url} + + url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random() * 10000 * random()) + params = {"u_ID": self.acc_info["u_ID"], "u_hash": self.acc_info["u_hash"], "link": self.pyfile.url} self.logDebug(url, params) - self.download(url, get = params) + self.download(url, get=params) self.checkTrafficLeft() -getInfo = create_getInfo(MultishareCz) \ No newline at end of file + +getInfo = create_getInfo(MultishareCz) -- cgit v1.2.3