From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/MultishareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index e38bd048f..8146144fa 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -32,7 +32,7 @@ class MultishareCz(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" FILE_INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' - FILE_OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' + OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' FILE_SIZE_REPLACEMENTS = [(' ', '')] def process(self, pyfile): -- cgit v1.2.3 From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/MultishareCz.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index 8146144fa..b2ae07ef1 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/MultishareCz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index b2ae07ef1..c2fbaf46e 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -68,15 +68,15 @@ class MultishareCz(SimpleHoster): 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} + 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) def checkCredit(self): self.acc_info = self.account.getAccountInfo(self.user, True) - self.logInfo("User %s has %i MB left" % (self.user, self.acc_info["trafficleft"] / 1024)) + self.logInfo("User %s has %i MB left" % (self.user, self.acc_info['trafficleft'] / 1024)) - return self.pyfile.size / 1024 <= self.acc_info["trafficleft"] + return self.pyfile.size / 1024 <= self.acc_info['trafficleft'] getInfo = create_getInfo(MultishareCz) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/MultishareCz.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index c2fbaf46e..fdf5fbd70 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -1,30 +1,19 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - 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://(?:www\.)?multishare.cz/stahnout/(?P\d+).*' __version__ = "0.34" + + __pattern__ = r'http://(?:www\.)?multishare.cz/stahnout/(?P\d+).*' + __description__ = """MultiShare.cz hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -33,6 +22,7 @@ class MultishareCz(SimpleHoster): 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: -- cgit v1.2.3