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/accounts/ShareRapidCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 38150e5cf..11cef84e3 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -21,7 +21,7 @@ class ShareRapidCom(Account): found = re.search(ur'Max. počet paralelních stahování: (\d+)', src) if found: data = self.getAccountData(user) - data["options"]["limitDL"] = [int(found.group(1))] + data['options']['limitDL'] = [int(found.group(1))] found = re.search(ur'Paušální stahování aktivní. Vyprší (.*?)', src) if found: @@ -44,6 +44,6 @@ class ShareRapidCom(Account): htm = req.load("http://sharerapid.cz/prihlaseni/", post={"hash": hashes, "login": user, - "pass1": data["password"], + "pass1": data['password'], "remember": 0, "sbmt": u"Přihlásit"}, cookies=True) -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/accounts/ShareRapidCom.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 11cef84e3..8f6e3cfc4 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -9,10 +9,12 @@ class ShareRapidCom(Account): __name__ = "ShareRapidCom" __version__ = "0.33" __type__ = "account" + __description__ = """ShareRapid account plugin""" __author_name__ = ("MikyWoW", "zoidberg") __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz") + login_timeout = 60 def loadAccountInfo(self, user, req): -- cgit v1.2.3 From da308a71c77296793eb5801ceb68298c91a4da7f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:23:40 +0200 Subject: [ShareRapidCom] Fix https://github.com/pyload/pyload/issues/694 --- module/plugins/accounts/ShareRapidCom.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 8f6e3cfc4..3aa67ffd1 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -1,24 +1,25 @@ # -*- coding: utf-8 -*- import re + from time import mktime, strptime from module.plugins.Account import Account class ShareRapidCom(Account): __name__ = "ShareRapidCom" - __version__ = "0.33" + __version__ = "0.34" __type__ = "account" - __description__ = """ShareRapid account plugin""" + __description__ = """MegaRapid.cz account plugin""" __author_name__ = ("MikyWoW", "zoidberg") __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz") - login_timeout = 60 + def loadAccountInfo(self, user, req): - src = req.load("http://sharerapid.cz/mujucet/", decode=True) + src = req.load("http://megarapid.cz/mujucet/", decode=True) found = re.search(ur'Max. počet paralelních stahování: (\d+)', src) if found: @@ -38,12 +39,12 @@ class ShareRapidCom(Account): return {"premium": False, "trafficleft": None, "validuntil": None} def login(self, user, data, req): - htm = req.load("http://sharerapid.cz/prihlaseni/", cookies=True) + htm = req.load("http://megarapid.cz/prihlaseni/", cookies=True) if "Heslo:" in htm: start = htm.index('id="inp_hash" name="hash" value="') htm = htm[start + 33:] hashes = htm[0:32] - htm = req.load("http://sharerapid.cz/prihlaseni/", + htm = req.load("http://megarapid.cz/prihlaseni/", post={"hash": hashes, "login": user, "pass1": data['password'], -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/accounts/ShareRapidCom.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 3aa67ffd1..a1cb40130 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -21,19 +21,19 @@ class ShareRapidCom(Account): def loadAccountInfo(self, user, req): src = req.load("http://megarapid.cz/mujucet/", decode=True) - found = re.search(ur'Max. počet paralelních stahování: (\d+)', src) - if found: + m = re.search(ur'Max. počet paralelních stahování: (\d+)', src) + if m: data = self.getAccountData(user) - data['options']['limitDL'] = [int(found.group(1))] + data['options']['limitDL'] = [int(m.group(1))] - found = re.search(ur'Paušální stahování aktivní. Vyprší (.*?)', src) - if found: - validuntil = mktime(strptime(found.group(1), "%d.%m.%Y - %H:%M")) + m = re.search(ur'Paušální stahování aktivní. Vyprší (.*?)', src) + if m: + validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) return {"premium": True, "trafficleft": -1, "validuntil": validuntil} - found = re.search(r'Kredit(.*?) GiB', src) - if found: - trafficleft = float(found.group(1)) * (1 << 20) + m = re.search(r'Kredit(.*?) GiB', src) + if m: + trafficleft = float(m.group(1)) * (1 << 20) return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} return {"premium": False, "trafficleft": None, "validuntil": None} -- 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/accounts/ShareRapidCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index a1cb40130..50077b1fb 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -8,8 +8,8 @@ from module.plugins.Account import Account class ShareRapidCom(Account): __name__ = "ShareRapidCom" - __version__ = "0.34" __type__ = "account" + __version__ = "0.34" __description__ = """MegaRapid.cz account plugin""" __author_name__ = ("MikyWoW", "zoidberg") -- 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/accounts/ShareRapidCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 50077b1fb..306e7a236 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -12,8 +12,9 @@ class ShareRapidCom(Account): __version__ = "0.34" __description__ = """MegaRapid.cz account plugin""" - __author_name__ = ("MikyWoW", "zoidberg") - __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz") + __authors__ = [("MikyWoW", "mikywow@seznam.cz"), + ("zoidberg", "zoidberg@mujmail.cz")] + login_timeout = 60 -- 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/accounts/ShareRapidCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 306e7a236..62a0067d5 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -12,6 +12,7 @@ class ShareRapidCom(Account): __version__ = "0.34" __description__ = """MegaRapid.cz account plugin""" + __license__ = "GPLv3" __authors__ = [("MikyWoW", "mikywow@seznam.cz"), ("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From 6632ded30de12bc16644b26de2605ec6b3bdd42a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 9 Oct 2014 13:12:12 +0200 Subject: ShareRapidCom -> MegaRapidCz --- module/plugins/accounts/ShareRapidCom.py | 54 -------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 module/plugins/accounts/ShareRapidCom.py (limited to 'module/plugins/accounts/ShareRapidCom.py') diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py deleted file mode 100644 index 62a0067d5..000000000 --- a/module/plugins/accounts/ShareRapidCom.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import mktime, strptime -from module.plugins.Account import Account - - -class ShareRapidCom(Account): - __name__ = "ShareRapidCom" - __type__ = "account" - __version__ = "0.34" - - __description__ = """MegaRapid.cz account plugin""" - __license__ = "GPLv3" - __authors__ = [("MikyWoW", "mikywow@seznam.cz"), - ("zoidberg", "zoidberg@mujmail.cz")] - - - login_timeout = 60 - - - def loadAccountInfo(self, user, req): - src = req.load("http://megarapid.cz/mujucet/", decode=True) - - m = re.search(ur'Max. počet paralelních stahování: (\d+)', src) - if m: - data = self.getAccountData(user) - data['options']['limitDL'] = [int(m.group(1))] - - m = re.search(ur'Paušální stahování aktivní. Vyprší (.*?)', src) - if m: - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) - return {"premium": True, "trafficleft": -1, "validuntil": validuntil} - - m = re.search(r'Kredit(.*?) GiB', src) - if m: - trafficleft = float(m.group(1)) * (1 << 20) - return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} - - return {"premium": False, "trafficleft": None, "validuntil": None} - - def login(self, user, data, req): - htm = req.load("http://megarapid.cz/prihlaseni/", cookies=True) - if "Heslo:" in htm: - start = htm.index('id="inp_hash" name="hash" value="') - htm = htm[start + 33:] - hashes = htm[0:32] - htm = req.load("http://megarapid.cz/prihlaseni/", - post={"hash": hashes, - "login": user, - "pass1": data['password'], - "remember": 0, - "sbmt": u"Přihlásit"}, cookies=True) -- cgit v1.2.3