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/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 2b647a49c..afc2f2a18 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -47,7 +47,7 @@ class UnrestrictLi(Account): self.logError("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry") return - post_data = {"username": user, "password": data["password"], + post_data = {"username": user, "password": data['password'], "remember_me": "remember", "signin": "Sign in"} self.html = req.load("https://unrestrict.li/sign_in", post=post_data) -- 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/UnrestrictLi.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index afc2f2a18..ac2d2d82a 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -22,10 +22,12 @@ class UnrestrictLi(Account): __name__ = "UnrestrictLi" __version__ = "0.03" __type__ = "account" + __description__ = """Unrestrict.li account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def loadAccountInfo(self, user, req): json_data = req.load('http://unrestrict.li/api/jdownloader/user.php?format=json') self.logDebug("JSON data: " + json_data) -- cgit v1.2.3 From 9762ac2fe94e3c6709fc46b6e9bde99e10cb3681 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 02:25:53 +0200 Subject: [account] self.html -> html (where was possible) --- module/plugins/accounts/UnrestrictLi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index ac2d2d82a..94452b966 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -51,7 +51,7 @@ class UnrestrictLi(Account): post_data = {"username": user, "password": data['password'], "remember_me": "remember", "signin": "Sign in"} - self.html = req.load("https://unrestrict.li/sign_in", post=post_data) + html = req.load("https://unrestrict.li/sign_in", post=post_data) - if 'sign_out' not in self.html: + if 'sign_out' not in html: self.wrongPassword() -- 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/UnrestrictLi.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 94452b966..a65f19c5b 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -20,8 +6,8 @@ from module.common.json_layer import json_loads class UnrestrictLi(Account): __name__ = "UnrestrictLi" - __version__ = "0.03" __type__ = "account" + __version__ = "0.03" __description__ = """Unrestrict.li account plugin""" __author_name__ = "stickell" -- 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/UnrestrictLi.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index a65f19c5b..3a6f36e88 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -10,8 +10,7 @@ class UnrestrictLi(Account): __version__ = "0.03" __description__ = """Unrestrict.li account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def loadAccountInfo(self, user, req): -- 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/UnrestrictLi.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 3a6f36e88..e3da5e913 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -10,6 +10,7 @@ class UnrestrictLi(Account): __version__ = "0.03" __description__ = """Unrestrict.li account plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From 6a0fb7fdd4ea2749be44625225d8a235a78f032f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:42:39 +0200 Subject: [accounts] Code cosmetics --- module/plugins/accounts/UnrestrictLi.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index e3da5e913..5a02e04a2 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -27,6 +27,7 @@ class UnrestrictLi(Account): return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} + def login(self, user, data, req): req.cj.setCookie("unrestrict.li", "lang", "EN") html = req.load("https://unrestrict.li/sign_in") -- cgit v1.2.3 From 5d26b3f5c3b18d916b2ea24a22770cf62e207a50 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 16 Oct 2014 12:12:14 +0200 Subject: Fix trafficleft size in some account plugins --- module/plugins/accounts/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 5a02e04a2..f89eab473 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -23,7 +23,7 @@ class UnrestrictLi(Account): return {"premium": False} validuntil = json_data['result']['expires'] - trafficleft = int(json_data['result']['traffic'] / 1024) + trafficleft = int(json_data['result']['traffic']) return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} -- 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/accounts/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index f89eab473..27abb3f51 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -33,7 +33,7 @@ class UnrestrictLi(Account): html = req.load("https://unrestrict.li/sign_in") if 'solvemedia' in html: - self.logError("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry") + self.logError(_("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry")) return post_data = {"username": user, "password": data['password'], -- 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/accounts/UnrestrictLi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 27abb3f51..e43d6bbd7 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -5,13 +5,13 @@ from module.common.json_layer import json_loads class UnrestrictLi(Account): - __name__ = "UnrestrictLi" - __type__ = "account" + __name__ = "UnrestrictLi" + __type__ = "account" __version__ = "0.03" __description__ = """Unrestrict.li account plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def loadAccountInfo(self, user, req): -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/accounts/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index e43d6bbd7..60e501d2e 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -29,7 +29,7 @@ class UnrestrictLi(Account): def login(self, user, data, req): - req.cj.setCookie("unrestrict.li", "lang", "EN") + req.cj.setCookie(".unrestrict.li", "lang", "EN") html = req.load("https://unrestrict.li/sign_in") if 'solvemedia' in html: -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/accounts/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 60e501d2e..e43d6bbd7 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -29,7 +29,7 @@ class UnrestrictLi(Account): def login(self, user, data, req): - req.cj.setCookie(".unrestrict.li", "lang", "EN") + req.cj.setCookie("unrestrict.li", "lang", "EN") html = req.load("https://unrestrict.li/sign_in") if 'solvemedia' in html: -- cgit v1.2.3 From fb65d5354c3cc80c3f48c3a2745b8dc01105edfd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:02:29 +0100 Subject: Update account plugins --- module/plugins/accounts/UnrestrictLi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/UnrestrictLi.py') diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index e43d6bbd7..f5db3f888 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class UnrestrictLi(Account): __name__ = "UnrestrictLi" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Unrestrict.li account plugin""" __license__ = "GPLv3" @@ -23,7 +23,7 @@ class UnrestrictLi(Account): return {"premium": False} validuntil = json_data['result']['expires'] - trafficleft = int(json_data['result']['traffic']) + trafficleft = float(json_data['result']['traffic'] / 1024) #@TODO: Remove `/ 1024` in 0.4.10 return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} -- cgit v1.2.3