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 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/MultishareCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index fdf5fbd70..2e59925b6 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -15,8 +15,8 @@ class MultishareCz(SimpleHoster): __pattern__ = r'http://(?:www\.)?multishare.cz/stahnout/(?P\d+).*' __description__ = """MultiShare.cz hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FILE_INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/MultishareCz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index 2e59925b6..42ad115ac 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -15,6 +15,7 @@ class MultishareCz(SimpleHoster): __pattern__ = r'http://(?:www\.)?multishare.cz/stahnout/(?P\d+).*' __description__ = """MultiShare.cz hoster plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- 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 42ad115ac..1ce16f30c 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -12,7 +12,7 @@ class MultishareCz(SimpleHoster): __type__ = "hoster" __version__ = "0.34" - __pattern__ = r'http://(?:www\.)?multishare.cz/stahnout/(?P\d+).*' + __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+).*' __description__ = """MultiShare.cz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/MultishareCz.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index 1ce16f30c..f7c8b47fd 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -38,9 +38,11 @@ class MultishareCz(SimpleHoster): 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.checkCredit(): self.logWarning("Not enough credit left to download file") @@ -48,6 +50,7 @@ class MultishareCz(SimpleHoster): self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) + def handleOverriden(self): if not self.premium: self.fail("Only premium users can download from other hosters") @@ -63,6 +66,7 @@ class MultishareCz(SimpleHoster): 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)) -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/MultishareCz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index f7c8b47fd..24aabfb24 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -45,7 +45,7 @@ class MultishareCz(SimpleHoster): def handlePremium(self): if not self.checkCredit(): - self.logWarning("Not enough credit left to download file") + self.logWarning(_("Not enough credit left to download file")) self.resetAccount() self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) @@ -53,13 +53,13 @@ class MultishareCz(SimpleHoster): def handleOverriden(self): if not self.premium: - self.fail("Only premium users can download from other hosters") + 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() if not self.checkCredit(): - self.fail("Not enough credit left to download file") + 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} @@ -69,7 +69,7 @@ class MultishareCz(SimpleHoster): 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'] -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/MultishareCz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index 24aabfb24..3f988600e 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -8,15 +8,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MultishareCz(SimpleHoster): - __name__ = "MultishareCz" - __type__ = "hoster" + __name__ = "MultishareCz" + __type__ = "hoster" __version__ = "0.34" __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+).*' __description__ = """MultiShare.cz hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FILE_INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/MultishareCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index 3f988600e..10628149f 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -19,9 +19,9 @@ class MultishareCz(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' + INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' - FILE_SIZE_REPLACEMENTS = [(' ', '')] + SIZE_REPLACEMENTS = [(' ', '')] def process(self, pyfile): -- cgit v1.2.3 From ca0ce20d5a805080f69dad4c24997ace1958bbcb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Dec 2014 17:18:40 +0100 Subject: Plugin code cosmetics --- module/plugins/hoster/MultishareCz.py | 9 ++++++--- 1 file changed, 6 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 10628149f..fc866e2b1 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" - __version__ = "0.34" + __version__ = "0.35" __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+).*' @@ -19,10 +19,13 @@ class MultishareCz(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' - OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' SIZE_REPLACEMENTS = [(' ', '')] + MULTI_HOSTER = True + + INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' + OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' + def process(self, pyfile): msurl = re.match(self.__pattern__, pyfile.url) -- cgit v1.2.3 From 57300575fa97107d172e0c9909b244c8c8ae6c12 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 20:02:20 +0100 Subject: Extend SimpleHoster in multi-hoster plugins --- module/plugins/hoster/MultishareCz.py | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'module/plugins/hoster/MultishareCz.py') diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index fc866e2b1..d7ddb753c 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -27,23 +27,8 @@ class MultishareCz(SimpleHoster): OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' - 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.getFileInfo() - - if self.premium: - self.handlePremium() - else: - self.handleFree() - else: - self.handleOverriden() - - def handleFree(self): - self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.fileID) + self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.info['pattern']['ID']) def handlePremium(self): @@ -51,27 +36,29 @@ class MultishareCz(SimpleHoster): self.logWarning(_("Not enough credit left to download file")) self.resetAccount() - self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) - + self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.info['pattern']['ID']) - def handleOverriden(self): - if not self.premium: - self.fail(_("Only premium users can download from other hosters")) + def handleMulti(self): self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post={"link": self.pyfile.url}, decode=True) - self.getFileInfo() + + self.checkInfo() if not self.checkCredit(): self.fail(_("Not enough credit left to download file")) - url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random() * 10000 * random()) + 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.link = True 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)) return self.pyfile.size / 1024 <= self.acc_info['trafficleft'] -- cgit v1.2.3 From 46f748a94ea5ab62ab0839ff0ce01e12e3eac688 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 21:47:39 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (2) --- 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 d7ddb753c..62acab84c 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+).*' -- cgit v1.2.3 From cdb06469a640c1875229903a2dbdfa8be469b5bc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:52:30 +0100 Subject: Improve a lot of plugin __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 62acab84c..adbae2da4 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -12,7 +12,7 @@ class MultishareCz(SimpleHoster): __type__ = "hoster" __version__ = "0.36" - __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+).*' + __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+)' __description__ = """MultiShare.cz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3