From 7a7e3e211e36af06d00e0effbcc37ac59e152427 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:00:23 +0200 Subject: nopremium.pl files added --- module/plugins/accounts/NoPremiumPl.py | 102 +++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 module/plugins/accounts/NoPremiumPl.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py new file mode 100644 index 000000000..e44a6acff --- /dev/null +++ b/module/plugins/accounts/NoPremiumPl.py @@ -0,0 +1,102 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" + +from datetime import datetime + +from module.plugins.Account import Account +from module.plugins.internal.SimpleHoster import parseHtmlForm +import re +from time import mktime, strptime +import module.lib.beaker.crypto as crypto + +try: + from json import loads +except ImportError: + from simplejson import loads + +class NoPremiumPl(Account): + __name__ = "NoPremiumPl" + __version__ = "0.01" + __type__ = "account" + __description__ = "NoPremium.pl account plugin" + __author_name__ = ("goddie") + __author_mail__ = ("dev@nopremium.pl") + + _api_url = "http://crypt.nopremium.pl" + + _api_query = { + "site": "nopremium", + "username": "", + "password": "", + "output": "json", + "loc": "1", + "info": "1" + } + + _req = None + _usr = None + _pwd = None + + def loadAccountInfo(self, name, req): + + self._req = req + + try: + result = loads(self.runAuthQuery()) + except: + #todo: ret? + return + + premium = False + valid_untill = -1 + + is_premium = "expire" in result.keys() and result["expire"] is not None + + if is_premium: + + premium = True + valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + + traffic_left = result["balance"] * 1024 + + return ({ + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) + + def login(self, user, data, req): + + self._usr = user + self._pwd = crypto.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() + + self._req = req + + try: + response = loads(self.runAuthQuery()) + except: + self.wrongPassword() + + if "errno" in response.keys(): + self.wrongPassword() + + data['usr'] = self._usr + data['pwd'] = self._pwd + + def createAuthQuery(self): + + query = self._api_query + query["username"] = self._usr + query["password"] = self._pwd + + return query + + def runAuthQuery(self): + + data = self._req.load(self._api_url, post=self.createAuthQuery()) + + return data \ No newline at end of file -- cgit v1.2.3 From 2404538888ced4e6964df55823d0514b1c0ba685 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:03:27 +0200 Subject: rapideo.pl files added --- module/plugins/accounts/RapideoPl.py | 102 +++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 module/plugins/accounts/RapideoPl.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py new file mode 100644 index 000000000..f7343cf02 --- /dev/null +++ b/module/plugins/accounts/RapideoPl.py @@ -0,0 +1,102 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" + +from datetime import datetime + +from module.plugins.Account import Account +from module.plugins.internal.SimpleHoster import parseHtmlForm +import re +from time import mktime, strptime +import module.lib.beaker.crypto as crypto + +try: + from json import loads +except ImportError: + from simplejson import loads + +class RapideoPl(Account): + __name__ = "RapideoPl" + __version__ = "0.01" + __type__ = "account" + __description__ = "Rapideo.pl account plugin" + __author_name__ = ("goddie") + __author_mail__ = ("dev@rapideo.pl") + + _api_url = "http://enc.rapideo.pl" + + _api_query = { + "site": "newrd", + "username": "", + "password": "", + "output": "json", + "loc": "1", + "info": "1" + } + + _req = None + _usr = None + _pwd = None + + def loadAccountInfo(self, name, req): + + self._req = req + + try: + result = loads(self.runAuthQuery()) + except: + #todo: ret? + return + + premium = False + valid_untill = -1 + + is_premium = "expire" in result.keys() and result["expire"] is not None + + if is_premium: + + premium = True + valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + + traffic_left = result["balance"] + + return ({ + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) + + def login(self, user, data, req): + + self._usr = user + self._pwd = crypto.md5(data["password"]).hexdigest() + + self._req = req + + try: + response = loads(self.runAuthQuery()) + except: + self.wrongPassword() + + if "errno" in response.keys(): + self.wrongPassword() + + data['usr'] = user + data['pwd'] = crypto.md5(data['password']).hexdigest() + + def createAuthQuery(self): + + query = self._api_query + query["username"] = self._usr + query["password"] = self._pwd + + return query + + def runAuthQuery(self): + + data = self._req.load(self._api_url, post=self.createAuthQuery()) + + return data \ No newline at end of file -- cgit v1.2.3 From fa0db462b06e2d6b64b3b07ed2d7d6c31de22448 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:10:53 +0200 Subject: to-do & small simplification in username and password saving --- module/plugins/accounts/RapideoPl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index f7343cf02..8abfa4989 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -48,7 +48,7 @@ class RapideoPl(Account): try: result = loads(self.runAuthQuery()) except: - #todo: ret? + #todo: return or let it be thrown? return premium = False @@ -84,8 +84,8 @@ class RapideoPl(Account): if "errno" in response.keys(): self.wrongPassword() - data['usr'] = user - data['pwd'] = crypto.md5(data['password']).hexdigest() + data['usr'] = self._usr + data['pwd'] = self._pwd def createAuthQuery(self): -- cgit v1.2.3 From 4a33d2e93055299e0108a23e0f2615e5cfd422f2 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:12:15 +0200 Subject: to-do elaborate --- module/plugins/accounts/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index e44a6acff..7ba89b881 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -48,7 +48,7 @@ class NoPremiumPl(Account): try: result = loads(self.runAuthQuery()) except: - #todo: ret? + #todo: return or let it be thrown? return premium = False -- cgit v1.2.3 From ccf15e75c12ad1e8347fdff834f8c62e5e2ab617 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 21:33:01 +0200 Subject: remove redundant author information --- module/plugins/accounts/NoPremiumPl.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 7ba89b881..8cfdbe1a7 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,10 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" - from datetime import datetime from module.plugins.Account import Account -- cgit v1.2.3 From ea1cbeda0006bbf427223686892c9e6f87cfbe94 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 21:36:14 +0200 Subject: remove redundant author information --- module/plugins/accounts/RapideoPl.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 8abfa4989..679f7eab0 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,10 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" - from datetime import datetime from module.plugins.Account import Account -- cgit v1.2.3 From 2ed13d51ab8cd28f2f3db4caabde9b6d2e2cec25 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 11:55:23 +0200 Subject: remove enviroment line --- module/plugins/accounts/RapideoPl.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 679f7eab0..0463bba69 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime -- cgit v1.2.3 From e325412cd71ae329f3f0b7084e5989e6ffbdbd18 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 11:57:05 +0200 Subject: remove enviroment line --- module/plugins/accounts/NoPremiumPl.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 8cfdbe1a7..df9e94a42 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime -- cgit v1.2.3 From 352301e4892d311d1a4cf6127f6bc70bc23eede3 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:02:59 +0200 Subject: remove blank lines and unused imports --- module/plugins/accounts/NoPremiumPl.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index df9e94a42..494b559c3 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -3,9 +3,7 @@ from datetime import datetime from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm -import re -from time import mktime, strptime +from time import mktime import module.lib.beaker.crypto as crypto try: @@ -13,6 +11,7 @@ try: except ImportError: from simplejson import loads + class NoPremiumPl(Account): __name__ = "NoPremiumPl" __version__ = "0.01" @@ -37,38 +36,31 @@ class NoPremiumPl(Account): _pwd = None def loadAccountInfo(self, name, req): - self._req = req - try: result = loads(self.runAuthQuery()) except: - #todo: return or let it be thrown? + # todo: return or let it be thrown? return premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None if is_premium: - premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) - traffic_left = result["balance"] * 1024 return ({ - "validuntil": valid_untill, - "trafficleft": traffic_left, - "premium": premium - }) + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) def login(self, user, data, req): - self._usr = user self._pwd = crypto.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() - self._req = req try: @@ -78,12 +70,10 @@ class NoPremiumPl(Account): if "errno" in response.keys(): self.wrongPassword() - data['usr'] = self._usr data['pwd'] = self._pwd def createAuthQuery(self): - query = self._api_query query["username"] = self._usr query["password"] = self._pwd @@ -91,7 +81,6 @@ class NoPremiumPl(Account): return query def runAuthQuery(self): - data = self._req.load(self._api_url, post=self.createAuthQuery()) return data \ No newline at end of file -- cgit v1.2.3 From ce18793af9864acdf9e9c71b7324d923a53adaad Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:05:22 +0200 Subject: fix json loads, dumps on ImportError exception --- module/plugins/accounts/NoPremiumPl.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 494b559c3..7b4140169 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -7,9 +7,10 @@ from time import mktime import module.lib.beaker.crypto as crypto try: - from json import loads + from json import loads, dumps except ImportError: - from simplejson import loads + from module.common.json_layer import json_loads as loads + from module.common.json_layer import json_dumps as dumps class NoPremiumPl(Account): -- cgit v1.2.3 From dfd5cb44138494b803f66559747cacc1260b5595 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:15:03 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/accounts/NoPremiumPl.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 7b4140169..0f3b5286f 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,16 +1,12 @@ # -*- coding: utf-8 -*- from datetime import datetime +import hashlib from module.plugins.Account import Account from time import mktime -import module.lib.beaker.crypto as crypto -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps +from module.common.json_layer import json_loads as loads class NoPremiumPl(Account): @@ -61,7 +57,7 @@ class NoPremiumPl(Account): def login(self, user, data, req): self._usr = user - self._pwd = crypto.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() + self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest() self._req = req try: -- cgit v1.2.3 From 0fc351436bfb4a94749899e34c46bf81a44c92c9 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:16:36 +0200 Subject: replace is_premium with direct expression --- module/plugins/accounts/NoPremiumPl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 0f3b5286f..49c9b7653 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -42,9 +42,8 @@ class NoPremiumPl(Account): premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None - if is_premium: + if "expire" in result.keys() and result["expire"] is not None: premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] * 1024 -- cgit v1.2.3 From 1df1779ded75e863994449ba034ed31ab2018ddc Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:40:13 +0200 Subject: remove explicit "is not None" --- module/plugins/accounts/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 49c9b7653..5f70440ac 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -43,7 +43,7 @@ class NoPremiumPl(Account): premium = False valid_untill = -1 - if "expire" in result.keys() and result["expire"] is not None: + if "expire" in result.keys() and result["expire"]: premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] * 1024 -- cgit v1.2.3 From 2e8ed2bf0b357e907f6921c7bb88719bb347367b Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:47:49 +0200 Subject: remove blank lines and unused imports --- module/plugins/accounts/RapideoPl.py | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 0463bba69..853731f26 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -3,9 +3,7 @@ from datetime import datetime from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm -import re -from time import mktime, strptime +from time import mktime import module.lib.beaker.crypto as crypto try: @@ -13,6 +11,7 @@ try: except ImportError: from simplejson import loads + class RapideoPl(Account): __name__ = "RapideoPl" __version__ = "0.01" @@ -37,40 +36,32 @@ class RapideoPl(Account): _pwd = None def loadAccountInfo(self, name, req): - self._req = req - try: result = loads(self.runAuthQuery()) except: - #todo: return or let it be thrown? + # todo: return or let it be thrown? return premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None - if is_premium: - premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] return ({ - "validuntil": valid_untill, - "trafficleft": traffic_left, - "premium": premium - }) + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) def login(self, user, data, req): - self._usr = user self._pwd = crypto.md5(data["password"]).hexdigest() - self._req = req - try: response = loads(self.runAuthQuery()) except: @@ -78,12 +69,10 @@ class RapideoPl(Account): if "errno" in response.keys(): self.wrongPassword() - data['usr'] = self._usr data['pwd'] = self._pwd def createAuthQuery(self): - query = self._api_query query["username"] = self._usr query["password"] = self._pwd @@ -91,7 +80,6 @@ class RapideoPl(Account): return query def runAuthQuery(self): - data = self._req.load(self._api_url, post=self.createAuthQuery()) return data \ No newline at end of file -- cgit v1.2.3 From 25d2cceff065a0268a7e183449ef54edf98f1783 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:12 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/accounts/RapideoPl.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 853731f26..6ace9ede0 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,16 +1,11 @@ # -*- coding: utf-8 -*- from datetime import datetime +import hashlib from module.plugins.Account import Account from time import mktime -import module.lib.beaker.crypto as crypto - -try: - from json import loads -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads class RapideoPl(Account): __name__ = "RapideoPl" @@ -60,7 +55,7 @@ class RapideoPl(Account): def login(self, user, data, req): self._usr = user - self._pwd = crypto.md5(data["password"]).hexdigest() + self._pwd = hashlib.md5(data["password"]).hexdigest() self._req = req try: response = loads(self.runAuthQuery()) -- cgit v1.2.3 From 88ba5ecd9027ffa7a8bb5eb207085295ad35724d Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:42 +0200 Subject: newline fix --- module/plugins/accounts/RapideoPl.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 6ace9ede0..cbec9809a 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -7,6 +7,7 @@ from module.plugins.Account import Account from time import mktime from module.common.json_layer import json_loads as loads + class RapideoPl(Account): __name__ = "RapideoPl" __version__ = "0.01" -- cgit v1.2.3 From d0eea8f9baced6fd882e396e019940cff5fcf777 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:50:58 +0200 Subject: replace is_premium with direct expression, remove explicit "is not None" --- module/plugins/accounts/RapideoPl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index cbec9809a..f35d23827 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -41,8 +41,7 @@ class RapideoPl(Account): premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None - if is_premium: + if "expire" in result.keys() and result["expire"]: premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) -- cgit v1.2.3 From 0824528da43d0842c15ffa0d4fe132309ca592eb Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 14:05:40 +0200 Subject: newline fix --- module/plugins/accounts/NoPremiumPl.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 5f70440ac..bf1aec841 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -5,7 +5,6 @@ import hashlib from module.plugins.Account import Account from time import mktime - from module.common.json_layer import json_loads as loads -- cgit v1.2.3 From 36b5bfedc2e57bd000831559ca8fb4d7e7899e24 Mon Sep 17 00:00:00 2001 From: tjeh Date: Sun, 20 Jul 2014 21:49:27 +0200 Subject: Added support for Multihosters.com multihoster. --- module/plugins/accounts/MultihostersCom.py | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 module/plugins/accounts/MultihostersCom.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/MultihostersCom.py b/module/plugins/accounts/MultihostersCom.py new file mode 100644 index 000000000..3f96fdf41 --- /dev/null +++ b/module/plugins/accounts/MultihostersCom.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +from time import mktime, strptime +from module.plugins.Account import Account + +class MultihostersCom(Account): + __name__ = "MultihostersCom" + __version__ = "0.01" + __type__ = "account" + __description__ = """Multihosters.com account plugin""" + __author_name__ = "tjeh" + __author_mail__ = "tjeh@gmx.net" + + def loadAccountInfo(self, user, req): + data = self.getAPIData(req) + if data == "No traffic": + account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + else: + account_info = { + "trafficleft": int(data['availabletodaytraffic']) * 1024, + "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")), + "premium": True + } + return account_info + + def login(self, user, data, req): + self.loginname = user + self.password = data['password'] + if self.getAPIData(req) == "No traffic": + self.wrongPassword() + + def getAPIData(self, req, just_header=False, **kwargs): + get_data = { + 'cmd': 'accountinfo', + 'login': self.loginname, + 'pass': self.password + } + get_data.update(kwargs) + + response = req.load("http://www.multihosters.com/jDownloader.ashx", get=get_data, + decode=True, just_header=just_header) + self.logDebug(response) + + if ':' in response: + if not just_header: + response = response.replace(',', '\n') + return dict((y.strip().lower(), z.strip()) for (y, z) in + [x.split(':', 1) for x in response.splitlines() if ':' in x]) + else: + return response -- cgit v1.2.3 From 168f175ce4765dec7e847c45d95e4babe20a7193 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Mon, 3 Nov 2014 14:42:05 +0100 Subject: New __authors__ key, added __license__ --- module/plugins/accounts/NoPremiumPl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index bf1aec841..f2223b7d9 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -13,8 +13,8 @@ class NoPremiumPl(Account): __version__ = "0.01" __type__ = "account" __description__ = "NoPremium.pl account plugin" - __author_name__ = ("goddie") - __author_mail__ = ("dev@nopremium.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] _api_url = "http://crypt.nopremium.pl" -- cgit v1.2.3 From 005710831caa04bbe372b54ac357658963fe02bb Mon Sep 17 00:00:00 2001 From: synweap15 Date: Mon, 3 Nov 2014 14:44:44 +0100 Subject: New __authors__ key, added __license__ --- module/plugins/accounts/RapideoPl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index f35d23827..438ce7ad3 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -13,8 +13,8 @@ class RapideoPl(Account): __version__ = "0.01" __type__ = "account" __description__ = "Rapideo.pl account plugin" - __author_name__ = ("goddie") - __author_mail__ = ("dev@rapideo.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] _api_url = "http://enc.rapideo.pl" -- cgit v1.2.3 From 136f63dc39603814b215606f888fb2e639021277 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 04:27:41 +0100 Subject: Spare code fixes --- module/plugins/accounts/ShareonlineBiz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 596be9b7c..49afa12b8 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -16,7 +16,7 @@ class ShareonlineBiz(Account): def getUserAPI(self, user, req): return req.load("http://api.share-online.biz/account.php", - {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"}) + get={"username": user, "password": self.accounts[user]['password'], 'act': "userDetails"}) def loadAccountInfo(self, user, req): @@ -34,9 +34,9 @@ class ShareonlineBiz(Account): if "a" in info and info['a'].lower() != "not_available": req.cj.setCookie("share-online.biz", "a", info['a']) - return {"validuntil": float(info['expire_date']) if "expire_date" in info else -1, + return {"validuntil" : float(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, - "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} + "premium" : True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} def login(self, user, data, req): -- cgit v1.2.3 From a2324280a11b22ef75f7c86bad3392a2179c486c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 16:48:14 +0100 Subject: [ShareonlineBiz] Fix login --- module/plugins/accounts/ShareonlineBiz.py | 53 ++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 49afa12b8..c08d6f963 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -6,40 +6,57 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.25" + __version__ = "0.26" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("zoidberg", "zoidberg@mujmail.cz")] + ("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] - def getUserAPI(self, user, req): - return req.load("http://api.share-online.biz/account.php", - get={"username": user, "password": self.accounts[user]['password'], 'act': "userDetails"}) + def api_response(self, user, req): + return req.load("http://api.share-online.biz/cgi-bin", + get={'q': "userdetails", 'aux': "traffic", "username": user, "password": self.accounts[user]['password']}) def loadAccountInfo(self, user, req): - html = self.getUserAPI(user, req) + premium = False + validuntil = None + trafficleft = -1 + maxtraffic = 100 * 1024 * 1024 * 1024 #: 100 GB - info = {} - for line in html.splitlines(): + api = {} + for line in self.api_response(user, req).splitlines(): if "=" in line: key, value = line.split("=") - info[key] = value - self.logDebug(info) + api[key] = value - if "dl" in info and info['dl'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "dl", info['dl']) - if "a" in info and info['a'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info['a']) + self.logDebug(api) - return {"validuntil" : float(info['expire_date']) if "expire_date" in info else -1, - "trafficleft": -1, - "premium" : True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} + for key in ("dl", "a"): + if key not in api: + continue + + if api['group'] != "Sammler": + premium = True + + if api[key].lower() != "not_available": + req.cj.setCookie("share-online.biz", key, api[key]) + break + + if 'expire_date' in api: + validuntil = float(api['expire_date']) + + if 'traffic_1d' in api: + traffic = int(api['traffic_1d'].split(";")[0]) + maxtraffic = max(maxtraffic, traffic) + trafficleft = maxtraffic - traffic + + return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft, 'maxtraffic': maxtraffic} def login(self, user, data, req): - html = self.getUserAPI(user, req) + html = self.api_response(user, req) if "EXCEPTION" in html: self.wrongPassword() -- cgit v1.2.3 From ff42cec46274b0f2019272424c1a57ec4b413507 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 17:58:54 +0100 Subject: [PremiumTo] Fixup --- module/plugins/accounts/PremiumTo.py | 2 +- module/plugins/accounts/ShareonlineBiz.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index efc64706b..ef3d0cc19 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -19,7 +19,7 @@ class PremiumTo(Account): api_r = req.load("http://premium.to/api/straffic.php", get={'username': self.username, 'password': self.password}) - trafficleft = float(sum(map(int, api_r.split(';')))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 + trafficleft = sum(map(float, api_r.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1} diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index c08d6f963..fea278559 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -49,7 +49,7 @@ class ShareonlineBiz(Account): validuntil = float(api['expire_date']) if 'traffic_1d' in api: - traffic = int(api['traffic_1d'].split(";")[0]) + traffic = float(api['traffic_1d'].split(";")[0]) maxtraffic = max(maxtraffic, traffic) trafficleft = maxtraffic - traffic -- cgit v1.2.3 From c26db1f8fcd736d9de00095343779fd5519d565c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 18:48:10 +0100 Subject: [LomafileCom] Mark dead --- module/plugins/accounts/LomafileCom.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 module/plugins/accounts/LomafileCom.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/LomafileCom.py b/module/plugins/accounts/LomafileCom.py deleted file mode 100644 index cfd21679c..000000000 --- a/module/plugins/accounts/LomafileCom.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class LomafileCom(XFSAccount): - __name__ = "LomafileCom" - __type__ = "account" - __version__ = "0.02" - - __description__ = """Lomafile.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it")] - - - HOSTER_DOMAIN = "lomafile.com" -- cgit v1.2.3 From 24bf61533574a5ff81559d60627a7a9b2a926696 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 18:48:57 +0100 Subject: [NowVideoSx] Fixup --- module/plugins/accounts/NowVideoAt.py | 56 ----------------------------------- module/plugins/accounts/NowVideoSx.py | 56 +++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 56 deletions(-) delete mode 100644 module/plugins/accounts/NowVideoAt.py create mode 100644 module/plugins/accounts/NowVideoSx.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/NowVideoAt.py b/module/plugins/accounts/NowVideoAt.py deleted file mode 100644 index 234984b6b..000000000 --- a/module/plugins/accounts/NowVideoAt.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import gmtime, mktime, strptime - -from module.plugins.Account import Account - - -class NowVideoAt(Account): - __name__ = "NowVideoAt" - __type__ = "account" - __version__ = "0.01" - - __description__ = """NowVideo.at account plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = -1 - premium = None - - html = req.load("http://www.nowvideo.at/premium.php") - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1).strip() - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) - - except Exception, e: - self.logError(e) - - else: - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = -1 - - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} - - - def login(self, user, data, req): - html = req.load("http://www.nowvideo.at/login.php", - post={'user': user, 'pass': data['password']}) - - if ">Invalid login details" is html: - self.wrongPassword() diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py new file mode 100644 index 000000000..e2dcaba12 --- /dev/null +++ b/module/plugins/accounts/NowVideoSx.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +import re + +from time import gmtime, mktime, strptime + +from module.plugins.Account import Account + + +class NowVideoSx(Account): + __name__ = "NowVideoSx" + __type__ = "account" + __version__ = "0.02" + + __description__ = """NowVideo.at account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' + + + def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = -1 + premium = None + + html = req.load("http://www.nowvideo.sx/premium.php") + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + expiredate = m.group(1).strip() + self.logDebug("Expire date: " + expiredate) + + try: + validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) + + except Exception, e: + self.logError(e) + + else: + if validuntil > mktime(gmtime()): + premium = True + else: + premium = False + validuntil = -1 + + return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + + + def login(self, user, data, req): + html = req.load("http://www.nowvideo.sx/login.php", + post={'user': user, 'pass': data['password']}) + + if ">Invalid login details" is html: + self.wrongPassword() -- cgit v1.2.3 From 1f7d9ee163bc6416400989431c98db27a7c446a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:40:46 +0100 Subject: [Keep2shareCc] Fix login (still no captcha support) --- module/plugins/accounts/Keep2shareCc.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py index ffae02ae4..fac3cc4a6 100644 --- a/module/plugins/accounts/Keep2shareCc.py +++ b/module/plugins/accounts/Keep2shareCc.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class Keep2shareCc(Account): __name__ = "Keep2shareCc" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Keep2share.cc account plugin""" __license__ = "GPLv3" @@ -18,7 +18,7 @@ class Keep2shareCc(Account): VALID_UNTIL_PATTERN = r'Premium expires: (.+?)' - TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):(.+?)' + TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):\s*(.+?)<' LOGIN_FAIL_PATTERN = r'Please fix the following input errors' @@ -63,7 +63,10 @@ class Keep2shareCc(Account): req.cj.setCookie("keep2share.cc", "lang", "en") html = req.load("http://keep2share.cc/login.html", - post={'LoginForm[username]': user, 'LoginForm[password]': data['password']}) + post={'LoginForm[username]' : user, + 'LoginForm[password]' : data['password'], + 'LoginForm[rememberMe]': 1, + 'yt0' : ""}) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() -- cgit v1.2.3 From cbf7c2a394f5d829f52b11ea3cbaad64aa7f2595 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:57:40 +0100 Subject: [UlozTo] Improve account login --- module/plugins/accounts/UlozTo.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 3c9b24f3a..7236a4fa8 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class UlozTo(Account): __name__ = "UlozTo" __type__ = "account" - __version__ = "0.09" + __version__ = "0.10" __description__ = """Uloz.to account plugin""" __license__ = "GPLv3" @@ -22,12 +22,8 @@ class UlozTo(Account): def loadAccountInfo(self, user, req): - self.phpsessid = req.cj.getCookie("ULOSESSID") #@NOTE: this cookie gets lost somehow after each request - html = req.load("http://www.ulozto.net/", decode=True) - req.cj.setCookie("ulozto.net", "ULOSESSID", self.phpsessid) - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048 if m else 0 @@ -46,7 +42,8 @@ class UlozTo(Account): 'do' : "loginForm-submit", 'login' : u"Přihlásit", 'password': data['password'], - 'username': user}, + 'username': user, + 'remember': "on"}, decode=True) if '
' in html: -- cgit v1.2.3 From 993803c222f54a6ae0a12230a5e51789ec8ed564 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:58:27 +0100 Subject: [ShareonlineBiz] Fix account wrong password recognition --- module/plugins/accounts/ShareonlineBiz.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index fea278559..056f14876 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.26" + __version__ = "0.27" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -58,5 +58,7 @@ class ShareonlineBiz(Account): def login(self, user, data, req): html = self.api_response(user, req) - if "EXCEPTION" in html: + err = re.search(r'**(.+?)**', html) + if err: + self.logError(err.group(1)) self.wrongPassword() -- cgit v1.2.3 From 27f0f486bb859d25c49916d4131f882e1b5ba8dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 21:13:09 +0100 Subject: [ShareonlineBiz] Account fixup --- module/plugins/accounts/ShareonlineBiz.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 056f14876..3f737896e 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -1,18 +1,18 @@ # -*- coding: utf-8 -*- +import re + from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.27" + __version__ = "0.28" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] def api_response(self, user, req): @@ -34,21 +34,13 @@ class ShareonlineBiz(Account): self.logDebug(api) - for key in ("dl", "a"): - if key not in api: - continue - - if api['group'] != "Sammler": - premium = True + if api['a'].lower() != "not_available": + req.cj.setCookie("share-online.biz", 'a', api['a']) - if api[key].lower() != "not_available": - req.cj.setCookie("share-online.biz", key, api[key]) - break + premium = api['group'] == "Premium" - if 'expire_date' in api: validuntil = float(api['expire_date']) - if 'traffic_1d' in api: traffic = float(api['traffic_1d'].split(";")[0]) maxtraffic = max(maxtraffic, traffic) trafficleft = maxtraffic - traffic @@ -58,7 +50,7 @@ class ShareonlineBiz(Account): def login(self, user, data, req): html = self.api_response(user, req) - err = re.search(r'**(.+?)**', html) + err = re.search(r'\*\*(.+?)\*\*', html) if err: self.logError(err.group(1)) self.wrongPassword() -- cgit v1.2.3 From cef160bb1a77a7a30aa9dde0d8c708e769bc0533 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 23:37:03 +0100 Subject: [ShareonlineBiz] Account fixup (2) --- module/plugins/accounts/ShareonlineBiz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 3f737896e..57fe52385 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.28" + __version__ = "0.29" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -45,6 +45,9 @@ class ShareonlineBiz(Account): maxtraffic = max(maxtraffic, traffic) trafficleft = maxtraffic - traffic + maxtraffic /= 1024 #@TODO: Remove `/ 1024` in 0.4.10 + trafficleft /= 1024 #@TODO: Remove `/ 1024` in 0.4.10 + return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft, 'maxtraffic': maxtraffic} -- cgit v1.2.3 From 522b3b5cb04ae74cd441b3c1a32512e8576da357 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 30 Dec 2014 02:12:47 +0100 Subject: [AlldebridCom] Code cosmetics --- module/plugins/accounts/AlldebridCom.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 8fb841a39..278f3af06 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -4,7 +4,6 @@ import re import xml.dom.minidom as dom from time import time -from urllib import urlencode from BeautifulSoup import BeautifulSoup @@ -25,35 +24,40 @@ class AlldebridCom(Account): data = self.getAccountData(user) html = req.load("http://www.alldebrid.com/account/") soup = BeautifulSoup(html) + #Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string + self.logDebug("Account expires in: %s" % time_text) + p = re.compile('\d+') exp_data = p.findall(time_text) exp_time = time() + int(exp_data[0]) * 24 * 60 * 60 + int( exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60 + #Get expiration date from API except: data = self.getAccountData(user) html = req.load("http://www.alldebrid.com/api.php", get={'action': "info_user", 'login': user, 'pw': data['password']}) + self.logDebug(html) + xml = dom.parseString(html) exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 + account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info def login(self, user, data, req): - urlparams = urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']}) - html = req.load("http://www.alldebrid.com/register/?%s" % urlparams) - - if "This login doesn't exist" in html: - self.wrongPassword() - - if "The password is not valid" in html: - self.wrongPassword() - - if "Invalid captcha" in html: + html = req.load("http://www.alldebrid.com/register/", + get={'action' : "login", + 'login_login' : user, + 'login_password': data['password']}) + + if "This login doesn't exist" in html \ + or "The password is not valid" in html \ + or "Invalid captcha" in html: self.wrongPassword() -- cgit v1.2.3 From f23eea11a1db7b742684c2cace195748dd684020 Mon Sep 17 00:00:00 2001 From: gsasch Date: Tue, 30 Dec 2014 02:15:15 +0100 Subject: [UploadableCh] Account --- module/plugins/accounts/UploadableCh.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 module/plugins/accounts/UploadableCh.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py new file mode 100644 index 000000000..14c19adda --- /dev/null +++ b/module/plugins/accounts/UploadableCh.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +from module.plugins.Account import Account + + +class UploadableCh(Account): + __name__ = "UploadableCh" + __type__ = "account" + __version__ = "0.02" + + __description__ = """Uploadable.ch account plugin""" + __license__ = "GPLv3" + __authors__ = [("Sasch", "gsasch@gmail.com")] + + + def loadAccountInfo(self, user, req): + html = req.load("http://www.uploadable.ch/login.php") + + premium = ' Date: Thu, 1 Jan 2015 02:01:37 +0100 Subject: [RapiduNet] Fixup --- module/plugins/accounts/RapiduNet.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index fe465bc48..60283e5bd 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -8,7 +8,7 @@ from module.common.json_layer import json_loads class RapiduNet(Account): __name__ = "RapiduNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Rapidu.net account plugin""" __license__ = "GPLv3" @@ -19,24 +19,29 @@ class RapiduNet(Account): def loadAccountInfo(self, user, req): - info = {'validuntil': None, 'trafficleft': None, 'premium': False} + validuntil = None + trafficleft = None + premium = False + + req.load("https://rapidu.net/ajax.php?a=getChangeLang", + post={'_go': "", 'lang': "en"}) - req.load("https://rapidu.net/ajax.php", get={'a': "getChangeLang"}, post={"_go": "", "lang": "en"}) html = req.load("https://rapidu.net/", decode=True) if re.search(self.PREMIUM_PATTERN, html): - info['premium'] = True + premium = True + trafficleft = -1 - return info + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} def login(self, user, data, req): try: json = json_loads(req.load("https://rapidu.net/ajax.php?a=getUserLogin", - post={'_go': "", - 'login': user, - 'pass': data['password'], - 'member': "1"})) + post={'_go' : "", + 'login' : user, + 'pass' : data['password'], + 'remember': "1"})) self.logDebug(json) -- cgit v1.2.3 From c06dbc2e7b7fbba6ad6de3a28b4fcf21df04814d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 01:11:12 +0100 Subject: [RapiduNet] Fixup (2) --- module/plugins/accounts/RapiduNet.py | 54 +++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 60283e5bd..2d4770f67 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- import re + +from time import time + from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -8,45 +11,50 @@ from module.common.json_layer import json_loads class RapiduNet(Account): __name__ = "RapiduNet" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Rapidu.net account plugin""" __license__ = "GPLv3" - __authors__ = [("prOq", None)] + __authors__ = [("prOq", None), + ("Walter Purcaro", "vuolter@gmail.com")] - PREMIUM_PATTERN = r'Account: Premium' + PREMIUM_PATTERN = r'>Account: Premium' + + VALID_UNTIL_PATTERN = r'>Account: \w+ \((\d+)' def loadAccountInfo(self, user, req): validuntil = None - trafficleft = None + trafficleft = -1 premium = False - req.load("https://rapidu.net/ajax.php?a=getChangeLang", - post={'_go': "", 'lang': "en"}) - html = req.load("https://rapidu.net/", decode=True) if re.search(self.PREMIUM_PATTERN, html): - premium = True - trafficleft = -1 + premium = True + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + validuntil = time() + (86400 * int(m.group(1))) return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} def login(self, user, data, req): - try: - json = json_loads(req.load("https://rapidu.net/ajax.php?a=getUserLogin", - post={'_go' : "", - 'login' : user, - 'pass' : data['password'], - 'remember': "1"})) - - self.logDebug(json) - - if not json['message'] == "success": - self.wrongPassword() - - except Exception, e: - self.logError(e) + req.load("https://rapidu.net/ajax.php", + get={'a': "getChangeLang"}, + post={'_go' : "", + 'lang': "en"}) + + json = json_loads(req.load("https://rapidu.net/ajax.php", + get={'a': "getUserLogin"}, + post={'_go' : "", + 'login' : user, + 'pass' : data['password'], + 'remember': "1"})) + + self.logDebug(json) + + if not json['message'] == "success": + self.wrongPassword() -- cgit v1.2.3 From 3639af423fab5d905e9222f0125aeea2dcf58118 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 01:17:16 +0100 Subject: [RapiduNet] Account trafficleft --- module/plugins/accounts/RapiduNet.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 2d4770f67..8da698c57 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -11,7 +11,7 @@ from module.common.json_layer import json_loads class RapiduNet(Account): __name__ = "RapiduNet" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Rapidu.net account plugin""" __license__ = "GPLv3" @@ -23,6 +23,8 @@ class RapiduNet(Account): VALID_UNTIL_PATTERN = r'>Account: \w+ \((\d+)' + TRAFFIC_LEFT_PATTERN = r'class="tipsyS">(.+?)<' + def loadAccountInfo(self, user, req): validuntil = None @@ -38,6 +40,10 @@ class RapiduNet(Account): if m: validuntil = time() + (86400 * int(m.group(1))) + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + trafficleft = self.parseTraffic(m.group(1)) + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -- cgit v1.2.3 From e0cba81ae8d59ee24e1cd1f1cf1697c5e61118ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 02:37:18 +0100 Subject: [PremiumTo] Fixup --- module/plugins/accounts/PremiumTo.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index ef3d0cc19..2c486a1dd 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class PremiumTo(Account): __name__ = "PremiumTo" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Premium.to account plugin""" __license__ = "GPLv3" @@ -16,12 +16,14 @@ class PremiumTo(Account): def loadAccountInfo(self, user, req): - api_r = req.load("http://premium.to/api/straffic.php", - get={'username': self.username, 'password': self.password}) - - trafficleft = sum(map(float, api_r.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - - return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1} + traffic = req.load("http://premium.to/api/traffic.php", + get={'username': self.username, 'password': self.password}) + + if "wrong username" not in traffic: + trafficleft = float(traffic.strip()) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 + return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1} + else: + return {'premium': False, 'trafficleft': None, 'validuntil': None} def login(self, user, data, req): -- cgit v1.2.3 From f2e2201a3dec0d801c406a8e2bd9f06a126b0512 Mon Sep 17 00:00:00 2001 From: marley2013 Date: Sat, 3 Jan 2015 19:09:30 +0100 Subject: Update OverLoadMe.py Fixed https --- module/plugins/accounts/OverLoadMe.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index fb9732986..e06fc2023 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class OverLoadMe(Account): __name__ = "OverLoadMe" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Over-Load.me account plugin""" __license__ = "GPLv3" @@ -16,7 +16,8 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() + https = "https" if self.getConfig("https") else "http" + html = req.load(https + "://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() data = json_loads(html) # Check for premium @@ -28,7 +29,8 @@ class OverLoadMe(Account): def login(self, user, data, req): - jsondata = req.load("https://api.over-load.me/account.php", + https = "https" if self.getConfig("https") else "http" + jsondata = req.load(https + "://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() data = json_loads(jsondata) -- cgit v1.2.3 From 5f8de1193343d162963d167aa1f26e411e882a4a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 3 Jan 2015 22:13:18 +0100 Subject: [OverLoadMe] Code cosmetics --- module/plugins/accounts/OverLoadMe.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index e06fc2023..1fb2a2a10 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class OverLoadMe(Account): __name__ = "OverLoadMe" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Over-Load.me account plugin""" __license__ = "GPLv3" @@ -15,23 +15,28 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): - data = self.getAccountData(user) https = "https" if self.getConfig("https") else "http" - html = req.load(https + "://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() + data = self.getAccountData(user) + html = req.load(https + "://api.over-load.me/account.php", + get={'user': user, + 'auth': data['password']}).strip() + data = json_loads(html) + self.logDebug(data) # Check for premium if data['membership'] == "Free": - return {"premium": False} - - account_info = {"validuntil": data['expirationunix'], "trafficleft": -1} - return account_info + return {'premium': False, 'validuntil': None, 'trafficleft': None} + else: + return {'premium': True, 'validuntil': data['expirationunix'], 'trafficleft': -1} def login(self, user, data, req): - https = "https" if self.getConfig("https") else "http" + https = "https" if self.getConfig("https") else "http" jsondata = req.load(https + "://api.over-load.me/account.php", - get={"user": user, "auth": data['password']}).strip() + get={'user': user, + 'auth': data['password']}).strip() + data = json_loads(jsondata) if data['err'] == 1: -- cgit v1.2.3 From 75b6540be746d66d3fba3ab364c78addbc50c485 Mon Sep 17 00:00:00 2001 From: Smoozed Date: Mon, 5 Jan 2015 16:49:39 +0100 Subject: Added multihoster smoozed.com --- module/plugins/accounts/SmoozedCom.py | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 module/plugins/accounts/SmoozedCom.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py new file mode 100644 index 000000000..8157806c8 --- /dev/null +++ b/module/plugins/accounts/SmoozedCom.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- + +from module.plugins.Account import Account + +from module.common.json_layer import json_loads + +from time import time + +import hashlib +from beaker.crypto.pbkdf2 import PBKDF2 + + + +class SmoozedCom(Account): + __name__ = "SmoozedCom" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Smoozed.com account plugin""" + __license__ = "GPLv3" + __authors__ = [] + + + def loadAccountInfo(self, user, req): + # Get user data from premiumize.me + status = self.getAccountStatus(user, req) + self.logDebug(status) + + # Parse account info + account_info = {"validuntil": float(status["data"]["user"]["user_premium"]), + "trafficleft": max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]), + "session_key": status["data"]["session_key"], + "hoster": [hoster["name"] for hoster in status["data"]["hoster"]]} + + if account_info["validuntil"] < time(): + account_info['premium'] = False + else: + account_info['premium'] = True + + return account_info + + def login(self, user, data, req): + # Get user data from premiumize.me + status = self.getAccountStatus(user, req) + + # Check if user and password are valid + if status['state'] != 'ok': + self.wrongPassword() + + def getAccountStatus(self, user, req): + salt = hashlib.sha256(self.accounts[user]['password']).hexdigest() + encrypted = PBKDF2(self.accounts[user]['password'], salt, iterations=1000).hexread(32) + answer = req.load('http://www2.smoozed.com/api/login?auth=%s&password=%s' % ( + user, encrypted)) + return json_loads(answer) -- cgit v1.2.3 From 36e60a23497ae05736c24fed2f4ce936fb61f744 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:31:33 +0100 Subject: "New Year" Update: account plugins --- module/plugins/accounts/AlldebridCom.py | 5 +- module/plugins/accounts/BackinNet.py | 16 ++++++ module/plugins/accounts/BitshareCom.py | 6 ++- module/plugins/accounts/CatShareNet.py | 5 +- module/plugins/accounts/CloudzillaTo.py | 5 +- module/plugins/accounts/CzshareCom.py | 12 ++--- module/plugins/accounts/DebridItaliaCom.py | 5 +- module/plugins/accounts/DepositfilesCom.py | 6 ++- module/plugins/accounts/EuroshareEu.py | 12 ++--- module/plugins/accounts/FastixRu.py | 5 +- module/plugins/accounts/File4safeCom.py | 8 +-- module/plugins/accounts/FilecloudIo.py | 8 +-- module/plugins/accounts/FilefactoryCom.py | 10 ++-- module/plugins/accounts/FilejungleCom.py | 17 ++++--- module/plugins/accounts/FilerNet.py | 13 +++-- module/plugins/accounts/FilesMailRu.py | 14 ++++-- module/plugins/accounts/FourSharedCom.py | 33 ------------- module/plugins/accounts/FreakshareCom.py | 8 +-- module/plugins/accounts/FreeWayMe.py | 15 +++--- module/plugins/accounts/FshareVn.py | 20 ++++---- module/plugins/accounts/HellshareCz.py | 21 ++++---- module/plugins/accounts/HundredEightyUploadCom.py | 16 ------ module/plugins/accounts/Keep2shareCc.py | 33 +++++++------ module/plugins/accounts/LetitbitNet.py | 4 +- module/plugins/accounts/LinksnappyCom.py | 14 ++++-- module/plugins/accounts/MegaRapidCz.py | 23 ++++----- module/plugins/accounts/MegasharesCom.py | 14 +++--- module/plugins/accounts/MultihostersCom.py | 52 ++++---------------- module/plugins/accounts/MultishareCz.py | 12 ++--- module/plugins/accounts/MyfastfileCom.py | 6 ++- module/plugins/accounts/NetloadIn.py | 12 +++-- module/plugins/accounts/NowVideoSx.py | 7 +-- module/plugins/accounts/OboomCom.py | 7 ++- module/plugins/accounts/OneFichierCom.py | 55 --------------------- module/plugins/accounts/PremiumTo.py | 5 +- module/plugins/accounts/PremiumizeMe.py | 4 +- module/plugins/accounts/PutdriveCom.py | 16 ++++++ module/plugins/accounts/QuickshareCz.py | 12 ++--- module/plugins/accounts/RPNetBiz.py | 4 +- module/plugins/accounts/RapidgatorNet.py | 5 +- module/plugins/accounts/RealdebridCom.py | 8 ++- module/plugins/accounts/RehostTo.py | 9 ++-- module/plugins/accounts/ShareonlineBiz.py | 7 ++- module/plugins/accounts/SimplyPremiumCom.py | 4 +- module/plugins/accounts/SimplydebridCom.py | 7 +-- module/plugins/accounts/SmoozedCom.py | 53 +++++++++++--------- module/plugins/accounts/StahnuTo.py | 11 +++-- module/plugins/accounts/TurbobitNet.py | 11 +++-- module/plugins/accounts/UnrestrictLi.py | 6 +-- module/plugins/accounts/UploadableCh.py | 5 +- module/plugins/accounts/UploadedTo.py | 9 ++-- module/plugins/accounts/UploadheroCom.py | 5 +- module/plugins/accounts/YibaishiwuCom.py | 14 +++--- module/plugins/accounts/ZeveraCom.py | 53 +++++++++++--------- module/plugins/accounts/_180UploadCom.py | 16 ++++++ module/plugins/accounts/_1FichierCom.py | 60 +++++++++++++++++++++++ module/plugins/accounts/_4SharedCom.py | 34 +++++++++++++ 57 files changed, 473 insertions(+), 384 deletions(-) create mode 100644 module/plugins/accounts/BackinNet.py delete mode 100644 module/plugins/accounts/FourSharedCom.py delete mode 100644 module/plugins/accounts/HundredEightyUploadCom.py delete mode 100644 module/plugins/accounts/OneFichierCom.py create mode 100644 module/plugins/accounts/PutdriveCom.py create mode 100644 module/plugins/accounts/_180UploadCom.py create mode 100644 module/plugins/accounts/_1FichierCom.py create mode 100644 module/plugins/accounts/_4SharedCom.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 278f3af06..1f2371e28 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -13,7 +13,7 @@ from module.plugins.Account import Account class AlldebridCom(Account): __name__ = "AlldebridCom" __type__ = "account" - __version__ = "0.22" + __version__ = "0.23" __description__ = """AllDebrid.com account plugin""" __license__ = "GPLv3" @@ -55,7 +55,8 @@ class AlldebridCom(Account): html = req.load("http://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, - 'login_password': data['password']}) + 'login_password': data['password']}, + decode=True) if "This login doesn't exist" in html \ or "The password is not valid" in html \ diff --git a/module/plugins/accounts/BackinNet.py b/module/plugins/accounts/BackinNet.py new file mode 100644 index 000000000..46c8d7ac5 --- /dev/null +++ b/module/plugins/accounts/BackinNet.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSAccount import XFSAccount + + +class BackinNet(XFSAccount): + __name__ = "BackinNet" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Backin.net account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + HOSTER_DOMAIN = "backin.net" diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 960ff6c3c..412aae534 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class BitshareCom(Account): __name__ = "BitshareCom" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """Bitshare account plugin""" __license__ = "GPLv3" @@ -27,7 +27,9 @@ class BitshareCom(Account): def login(self, user, data, req): html = req.load("http://bitshare.com/login.html", - post={"user": user, "password": data['password'], "submit": "Login"}, cookies=True) + post={"user": user, "password": data['password'], "submit": "Login"}, + cookies=True, + decode=True) if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index c33219685..bcb14bee3 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class CatShareNet(Account): __name__ = "CatShareNet" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """CatShareNet account plugin""" __license__ = "GPLv3" @@ -50,7 +50,8 @@ class CatShareNet(Account): post={'user_email': user, 'user_password': data['password'], 'remindPassword': 0, - 'user[submit]': "Login"}) + 'user[submit]': "Login"}, + decode=True) if not 'Wyloguj' in html: self.wrongPassword() diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py index f0676f42f..d22d5e4b3 100644 --- a/module/plugins/accounts/CloudzillaTo.py +++ b/module/plugins/accounts/CloudzillaTo.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class CloudzillaTo(Account): __name__ = "CloudzillaTo" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Cloudzilla.to account plugin""" __license__ = "GPLv3" @@ -30,7 +30,8 @@ class CloudzillaTo(Account): html = req.load("http://www.cloudzilla.to/", post={'lusername': user, 'lpassword': data['password'], - 'w' : "dologin"}) + 'w' : "dologin"}, + decode=True) if "ERROR" in html: self.wrongPassword() diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index 414883228..f84bc67f3 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class CzshareCom(Account): __name__ = "CzshareCom" __type__ = "account" - __version__ = "0.15" + __version__ = "0.16" __description__ = """Czshare.com account plugin, now Sdilej.cz""" __license__ = "GPLv3" @@ -33,11 +33,11 @@ class CzshareCom(Account): def login(self, user, data, req): - html = req.load('https://sdilej.cz/index.php', post={ - "Prihlasit": "Prihlasit", - "login-password": data['password'], - "login-name": user - }) + html = req.load('https://sdilej.cz/index.php', + post={"Prihlasit": "Prihlasit", + "login-password": data['password'], + "login-name": user}, + decode=True) if '' in html: self.wrongPassword() diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index c75f8ee33..f92a4e821 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class EuroshareEu(Account): __name__ = "EuroshareEu" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Euroshare.eu account plugin""" __license__ = "GPLv3" @@ -31,11 +31,11 @@ class EuroshareEu(Account): def login(self, user, data, req): - html = req.load('http://euroshare.eu/customer-zone/login/', post={ - "trvale": "1", - "login": user, - "password": data['password'] - }, decode=True) + html = req.load('http://euroshare.eu/customer-zone/login/', + post={"trvale": "1", + "login": user, + "password": data['password']}, + decode=True) if u">Nesprávne prihlasovacie meno alebo heslo" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index d33d611c9..51be3880f 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Fastix account plugin""" __license__ = "GPLv3" @@ -31,8 +31,11 @@ class FastixRu(Account): def login(self, user, data, req): html = req.load("http://fastix.ru/api_v2/", get={'sub': "get_apikey", 'email': user, 'password': data['password']}) + api = json_loads(html) api = api['apikey'] + data['api'] = api + if "error_code" in html: self.wrongPassword() diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py index 20053d895..50fe1aac8 100644 --- a/module/plugins/accounts/File4safeCom.py +++ b/module/plugins/accounts/File4safeCom.py @@ -3,12 +3,12 @@ from module.plugins.internal.XFSAccount import XFSAccount -class File4safeCom(XFSAccount): - __name__ = "File4safeCom" +class File4SafeCom(XFSAccount): + __name__ = "File4SafeCom" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" - __description__ = """File4safe.com account plugin""" + __description__ = """File4Safe.com account plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index d20f756f3..8ca55b1bc 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FilecloudIo(Account): __name__ = "FilecloudIo" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """FilecloudIo account plugin""" __license__ = "GPLv3" @@ -19,7 +19,7 @@ class FilecloudIo(Account): # It looks like the first API request always fails, so we retry 5 times, it should work on the second try for _i in xrange(5): rep = req.load("https://secure.filecloud.io/api-fetch_apikey.api", - post={"username": user, "password": self.accounts[user]['password']}) + post={"username": user, "password": self.getAccountData(user)['password']}) rep = json_loads(rep) if rep['status'] == 'ok': break @@ -55,5 +55,5 @@ class FilecloudIo(Account): post=self.form_data, multipart=True) - self.logged_in = True if "you have successfully logged in - filecloud.io" in html else False - self.form_data = {} + if "you have successfully logged in" not in html: + self.wrongPassword() diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 8394c549e..426d572db 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -11,7 +11,7 @@ from module.plugins.Account import Account class FilefactoryCom(Account): __name__ = "FilefactoryCom" __type__ = "account" - __version__ = "0.14" + __version__ = "0.15" __description__ = """Filefactory.com account plugin""" __license__ = "GPLv3" @@ -40,10 +40,10 @@ class FilefactoryCom(Account): def login(self, user, data, req): req.http.c.setopt(REFERER, "http://www.filefactory.com/member/login.php") - html = req.load("http://www.filefactory.com/member/signin.php", post={ - "loginEmail": user, - "loginPassword": data['password'], - "Submit": "Sign In"}) + html = req.load("http://www.filefactory.com/member/signin.php", + post={"loginEmail" : user, + "loginPassword": data['password'], + "Submit" : "Sign In"}) if req.lastEffectiveURL != "http://www.filefactory.com/account/": self.wrongPassword() diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index a3ec7af64..9f7474207 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class FilejungleCom(Account): __name__ = "FilejungleCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Filejungle.com account plugin""" __license__ = "GPLv3" @@ -37,13 +37,14 @@ class FilejungleCom(Account): def login(self, user, data, req): - html = req.load(self.URL + "login.php", post={ - "loginUserName": user, - "loginUserPassword": data['password'], - "loginFormSubmit": "Login", - "recaptcha_challenge_field": "", - "recaptcha_response_field": "", - "recaptcha_shortencode_field": ""}) + html = req.load(self.URL + "login.php", + post={"loginUserName": user, + "loginUserPassword": data['password'], + "loginFormSubmit": "Login", + "recaptcha_challenge_field": "", + "recaptcha_response_field": "", + "recaptcha_shortencode_field": ""}, + decode=True) if re.search(self.LOGIN_FAILED_PATTERN, html): self.wrongPassword() diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index a845e7ba4..4067445af 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Filer.net account plugin""" __license__ = "GPLv3" @@ -44,9 +44,16 @@ class FilerNet(Account): def login(self, user, data, req): html = req.load("https://filer.net/login") + token = re.search(self.TOKEN_PATTERN, html).group(1) + html = req.load("https://filer.net/login_check", - post={"_username": user, "_password": data['password'], - "_remember_me": "on", "_csrf_token": token, "_target_path": "https://filer.net/"}) + post={"_username": user, + "_password": data['password'], + "_remember_me": "on", + "_csrf_token": token, + "_target_path": "https://filer.net/"}, + decode=True) + if 'Logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index f91f4d5ba..15926589e 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class FilesMailRu(Account): __name__ = "FilesMailRu" __type__ = "account" - __version__ = "0.10" + __version__ = "0.11" __description__ = """Filesmail.ru account plugin""" __license__ = "GPLv3" @@ -20,9 +20,13 @@ class FilesMailRu(Account): def login(self, user, data, req): user, domain = user.split("@") - html = req.load("http://swa.mail.ru/cgi-bin/auth", None, - {"Domain": domain, "Login": user, "Password": data['password'], - "Page": "http://files.mail.ru/"}, cookies=True) + html = req.load("http://swa.mail.ru/cgi-bin/auth", + post={"Domain": domain, + "Login": user, + "Password": data['password'], + "Page": "http://files.mail.ru/"}, + cookies=True, + decode=True) - if "Неверное имя пользователя или пароль" in html: # @TODO seems not to work + if "Неверное имя пользователя или пароль" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py deleted file mode 100644 index ec19f83f5..000000000 --- a/module/plugins/accounts/FourSharedCom.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.common.json_layer import json_loads -from module.plugins.Account import Account - - -class FourSharedCom(Account): - __name__ = "FourSharedCom" - __type__ = "account" - __version__ = "0.03" - - __description__ = """FourShared.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] - - - def loadAccountInfo(self, user, req): - # Free mode only for now - return {"premium": False} - - - def login(self, user, data, req): - req.cj.setCookie("4shared.com", "4langcookie", "en") - res = req.load('http://www.4shared.com/web/login', - post={'login': user, - 'password': data['password'], - 'remember': "on", - '_remember': "on", - 'returnTo': "http://www.4shared.com/account/home.jsp"}) - - if 'Please log in to access your 4shared account' in res: - self.wrongPassword() diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 576d835e2..83f4a9a84 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class FreakshareCom(Account): __name__ = "FreakshareCom" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """Freakshare.com account plugin""" __license__ = "GPLv3" @@ -44,8 +44,10 @@ class FreakshareCom(Account): def login(self, user, data, req): req.load("http://freakshare.com/index.php?language=EN") - html = req.load("http://freakshare.com/login.html", None, - {"submit": "Login", "user": user, "pass": data['password']}, cookies=True) + html = req.load("http://freakshare.com/login.html", + post={"submit": "Login", "user": user, "pass": data['password']}, + cookies=True, + decode=True) if ">Wrong Username or Password" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 3b9841630..14b9f1e9a 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" @@ -16,8 +16,7 @@ class FreeWayMe(Account): def loadAccountInfo(self, user, req): status = self.getAccountStatus(user, req) - if not status: - return False + self.logDebug(status) account_info = {"validuntil": -1, "premium": False} @@ -33,10 +32,6 @@ class FreeWayMe(Account): return account_info - def getpw(self, user): - return self.accounts[user]['password'] - - def login(self, user, data, req): status = self.getAccountStatus(user, req) @@ -47,9 +42,11 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): answer = req.load("https://www.free-way.me/ajax/jd.php", - get={"id": 4, "user": user, "pass": self.accounts[user]['password']}) + get={"id": 4, "user": user, "pass": self.getAccountData(user)['password']}) + self.logDebug("Login: %s" % answer) + if answer == "Invalid login": self.wrongPassword() - return False + return json_loads(answer) diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 2da45aac6..66d912958 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -1,16 +1,16 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime -from pycurl import REFERER import re +from time import mktime, strptime + from module.plugins.Account import Account class FshareVn(Account): __name__ = "FshareVn" __type__ = "account" - __version__ = "0.08" + __version__ = "0.09" __description__ = """Fshare.vn account plugin""" __license__ = "GPLv3" @@ -46,13 +46,13 @@ class FshareVn(Account): def login(self, user, data, req): - req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php") - - html = req.load('https://www.fshare.vn/login.php', post={ - "login_password": data['password'], - "login_useremail": user, - "url_refe": "http://www.fshare.vn/index.php" - }, referer=True, decode=True) + html = req.load("https://www.fshare.vn/login.php", + post={'LoginForm[email]' : user, + 'LoginForm[password]' : data['password'], + 'LoginForm[rememberMe]': 1, + 'yt0' : "Login"}, + referer=True, + decode=True) if not re.search(r'You input a wrong user name or wrong password

" in html: self.wrongPassword() diff --git a/module/plugins/accounts/HundredEightyUploadCom.py b/module/plugins/accounts/HundredEightyUploadCom.py deleted file mode 100644 index 39f91a8af..000000000 --- a/module/plugins/accounts/HundredEightyUploadCom.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class HundredEightyUploadCom(XFSAccount): - __name__ = "HundredEightyUploadCom" - __type__ = "account" - __version__ = "0.02" - - __description__ = """180upload.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_DOMAIN = "180upload.com" diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py index fac3cc4a6..e855fb977 100644 --- a/module/plugins/accounts/Keep2shareCc.py +++ b/module/plugins/accounts/Keep2shareCc.py @@ -7,12 +7,12 @@ from time import gmtime, mktime, strptime from module.plugins.Account import Account -class Keep2shareCc(Account): - __name__ = "Keep2shareCc" +class Keep2ShareCc(Account): + __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" - __description__ = """Keep2share.cc account plugin""" + __description__ = """Keep2Share.cc account plugin""" __license__ = "GPLv3" __authors__ = [("aeronaut", "aeronaut@pianoguy.de")] @@ -35,18 +35,22 @@ class Keep2shareCc(Account): expiredate = m.group(1).strip() self.logDebug("Expire date: " + expiredate) - try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) + if expiredate == "LifeTime": + premium = True + validuntil = -1 + else: + try: + validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) - except Exception, e: - self.logError(e) + except Exception, e: + self.logError(e) - else: - if validuntil > mktime(gmtime()): - premium = True else: - premium = False - validuntil = None + if validuntil > mktime(gmtime()): + premium = True + else: + premium = False + validuntil = None m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: @@ -66,7 +70,8 @@ class Keep2shareCc(Account): post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, - 'yt0' : ""}) + 'yt0' : ""}, + decode=True) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index b8244a06d..7f973d2d3 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -7,7 +7,7 @@ from module.plugins.Account import Account class LetitbitNet(Account): __name__ = "LetitbitNet" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Letitbit.net account plugin""" __license__ = "GPLv3" @@ -16,7 +16,7 @@ class LetitbitNet(Account): def loadAccountInfo(self, user, req): ## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ## - # api_key = self.accounts[user]['password'] + # api_key = self.getAccountData(user)['password'] # json_data = [api_key, ['key/info']] # api_rep = req.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) # self.logDebug("API Key Info: " + api_rep) diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 19986157b..dff28a055 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class LinksnappyCom(Account): __name__ = "LinksnappyCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Linksnappy.com account plugin""" __license__ = "GPLv3" @@ -20,17 +20,22 @@ class LinksnappyCom(Account): data = self.getAccountData(user) r = req.load('http://gen.linksnappy.com/lseAPI.php', get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()}) + self.logDebug("JSON data: " + r) + j = json_loads(r) if j['error']: return {"premium": False} validuntil = j['return']['expire'] + if validuntil == 'lifetime': validuntil = -1 + elif validuntil == 'expired': return {"premium": False} + else: validuntil = float(validuntil) @@ -43,8 +48,11 @@ class LinksnappyCom(Account): def login(self, user, data, req): - r = req.load('http://gen.linksnappy.com/lseAPI.php', - get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()}) + r = req.load("http://gen.linksnappy.com/lseAPI.php", + get={'act' : 'USERDETAILS', + 'username': user, + 'password': md5(data['password']).hexdigest()}, + decode=True) if 'Invalid Account Details' in r: self.wrongPassword() diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index 41da7ac73..b229fe47d 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class MegaRapidCz(Account): __name__ = "MegaRapidCz" __type__ = "account" - __version__ = "0.34" + __version__ = "0.35" __description__ = """MegaRapid.cz account plugin""" __license__ = "GPLv3" @@ -25,19 +25,19 @@ class MegaRapidCz(Account): def loadAccountInfo(self, user, req): - html = req.load("http://megarapid.cz/mujucet/", decode=True) + htmll = req.load("http://megarapid.cz/mujucet/", decode=True) - m = re.search(self.LIMITDL_PATTERN, html) + m = re.search(self.LIMITDL_PATTERN, htmll) if m: data = self.getAccountData(user) data['options']['limitDL'] = [int(m.group(1))] - m = re.search(self.VALID_UNTIL_PATTERN, html) + m = re.search(self.VALID_UNTIL_PATTERN, htmll) if m: validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) return {"premium": True, "trafficleft": -1, "validuntil": validuntil} - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + m = re.search(self.TRAFFIC_LEFT_PATTERN, htmll) if m: trafficleft = float(m.group(1)) * (1 << 20) return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} @@ -46,12 +46,13 @@ class MegaRapidCz(Account): def login(self, user, data, req): - htm = req.load("http://megarapid.cz/prihlaseni/") - 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/", + html = req.load("http://megarapid.cz/prihlaseni/", decode=True) + + if "Heslo:" in html: + start = html.index('id="inp_hash" name="hash" value="') + html = html[start + 33:] + hashes = html[0:32] + html = req.load("http://megarapid.cz/prihlaseni/", post={"hash": hashes, "login": user, "pass1": data['password'], diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 6e0a4358e..127ebadc8 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class MegasharesCom(Account): __name__ = "MegasharesCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Megashares.com account plugin""" __license__ = "GPLv3" @@ -37,12 +37,12 @@ class MegasharesCom(Account): def login(self, user, data, req): - html = req.load('http://d01.megashares.com/myms_login.php', post={ - "httpref": "", - "myms_login": "Login", - "mymslogin_name": user, - "mymspassword": data['password'] - }, decode=True) + html = req.load('http://d01.megashares.com/myms_login.php', + post={"httpref" : "", + "myms_login" : "Login", + "mymslogin_name": user, + "mymspassword" : data['password']}, + decode=True) if not '%s' % user in html: self.wrongPassword() diff --git a/module/plugins/accounts/MultihostersCom.py b/module/plugins/accounts/MultihostersCom.py index 3f96fdf41..0be64af7f 100644 --- a/module/plugins/accounts/MultihostersCom.py +++ b/module/plugins/accounts/MultihostersCom.py @@ -1,50 +1,16 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime -from module.plugins.Account import Account +from module.plugins.accounts.ZeveraCom import ZeveraCom -class MultihostersCom(Account): - __name__ = "MultihostersCom" - __version__ = "0.01" - __type__ = "account" - __description__ = """Multihosters.com account plugin""" - __author_name__ = "tjeh" - __author_mail__ = "tjeh@gmx.net" - - def loadAccountInfo(self, user, req): - data = self.getAPIData(req) - if data == "No traffic": - account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} - else: - account_info = { - "trafficleft": int(data['availabletodaytraffic']) * 1024, - "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")), - "premium": True - } - return account_info - def login(self, user, data, req): - self.loginname = user - self.password = data['password'] - if self.getAPIData(req) == "No traffic": - self.wrongPassword() +class MultihostersCom(ZeveraCom): + __name__ = "MultihostersCom" + __type__ = "account" + __version__ = "0.02" - def getAPIData(self, req, just_header=False, **kwargs): - get_data = { - 'cmd': 'accountinfo', - 'login': self.loginname, - 'pass': self.password - } - get_data.update(kwargs) + __description__ = """Multihosters.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("tjeh", "tjeh@gmx.net")] - response = req.load("http://www.multihosters.com/jDownloader.ashx", get=get_data, - decode=True, just_header=just_header) - self.logDebug(response) - if ':' in response: - if not just_header: - response = response.replace(',', '\n') - return dict((y.strip().lower(), z.strip()) for (y, z) in - [x.split(':', 1) for x in response.splitlines() if ':' in x]) - else: - return response + API_URL = "http://api.multihosters.com/jDownloader.ashx" diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 878413007..0ac764ee1 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class MultishareCz(Account): __name__ = "MultishareCz" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Multishare.cz account plugin""" __license__ = "GPLv3" @@ -34,11 +34,11 @@ class MultishareCz(Account): def login(self, user, data, req): - html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', post={ - "akce": "Přihlásit", - "heslo": data['password'], - "jmeno": user - }, decode=True) + html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', + post={"akce" : "Přihlásit", + "heslo": data['password'], + "jmeno": user}, + decode=True) if '
' in html: self.wrongPassword() diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 36923470e..4c75b27f0 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class MyfastfileCom(Account): __name__ = "MyfastfileCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Myfastfile.com account plugin""" __license__ = "GPLv3" @@ -27,8 +27,10 @@ class MyfastfileCom(Account): def login(self, user, data, req): # Password to use is the API-Password written in http://myfastfile.com/myaccount html = req.load("http://myfastfile.com/api.php", - get={"user": user, "pass": data['password']}) + get={"user": user, "pass": data['password']}) + self.logDebug("JSON data: " + html) + self.json_data = json_loads(html) if self.json_data['status'] != 'ok': self.logError(_('Invalid login. The password to use is the API-Password you find in your "My Account" page')) diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 15bad6966..1abd7fa84 100755 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class NetloadIn(Account): __name__ = "NetloadIn" __type__ = "account" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Netload.in account plugin""" __license__ = "GPLv3" @@ -33,8 +33,12 @@ class NetloadIn(Account): def login(self, user, data, req): - html = req.load("http://netload.in/index.php", None, - {"txtuser": user, "txtpass": data['password'], "txtcheck": "login", "txtlogin": "Login"}, - cookies=True) + html = req.load("http://netload.in/index.php", + post={"txtuser" : user, + "txtpass" : data['password'], + "txtcheck": "login", + "txtlogin": "Login"}, + cookies=True, + decode=True) if "password or it might be invalid!" in html: self.wrongPassword() diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index e2dcaba12..f44ae3865 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class NowVideoSx(Account): __name__ = "NowVideoSx" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" @@ -50,7 +50,8 @@ class NowVideoSx(Account): def login(self, user, data, req): html = req.load("http://www.nowvideo.sx/login.php", - post={'user': user, 'pass': data['password']}) + post={'user': user, 'pass': data['password']}, + decode=True) - if ">Invalid login details" is html: + if re.search(r'>Log In<', html): self.wrongPassword() diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 4d90e1b25..0acacbb2a 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -11,7 +11,7 @@ from module.plugins.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Oboom.com account plugin""" __license__ = "GPLv3" @@ -20,12 +20,15 @@ class OboomCom(Account): def loadAccountData(self, user, req): passwd = self.getAccountData(user)['password'] - salt = passwd[::-1] + salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) + result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2})) + if not result[0] == 200: self.logWarning(_("Failed to log in: %s") % result[1]) self.wrongPassword() + return result[1] diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py deleted file mode 100644 index 2f1c914c1..000000000 --- a/module/plugins/accounts/OneFichierCom.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from time import strptime, mktime - -from pycurl import REFERER - -from module.plugins.Account import Account - - -class OneFichierCom(Account): - __name__ = "OneFichierCom" - __type__ = "account" - __version__ = "0.11" - - __description__ = """1fichier.com account plugin""" - __license__ = "GPLv3" - __authors__ = [("Elrick69", "elrick69[AT]rocketmail[DOT]com"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = -1 - premium = None - - html = req.load("https://1fichier.com/console/abo.pl") - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) - except Exception, e: - self.logError(e) - else: - premium = True - - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} - - - def login(self, user, data, req): - req.http.c.setopt(REFERER, "https://1fichier.com/login.pl?lg=en") - - html = req.load("https://1fichier.com/login.pl?lg=en", - post={'mail': user, 'pass': data['password'], 'It': "on", 'purge': "off", 'valider': "Send"}) - - if '>Invalid email address' in html or '>Invalid password' in html: - self.wrongPassword() diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index 2c486a1dd..ea6fbbf65 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class PremiumTo(Account): __name__ = "PremiumTo" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Premium.to account plugin""" __license__ = "GPLv3" @@ -30,7 +30,8 @@ class PremiumTo(Account): self.username = user self.password = data['password'] authcode = req.load("http://premium.to/api/getauthcode.php", - get={'username': user, 'password': self.password}).strip() + get={'username': user, 'password': self.password}, + decode=True) if "wrong username" in authcode: self.wrongPassword() diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index c1abde309..7d061ec2d 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -8,7 +8,7 @@ from module.common.json_layer import json_loads class PremiumizeMe(Account): __name__ = "PremiumizeMe" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """Premiumize.me account plugin""" __license__ = "GPLv3" @@ -45,5 +45,5 @@ class PremiumizeMe(Account): answer = req.load("https://api.premiumize.me/pm-api/v1.php", get={'method' : "accountstatus", 'params[login]': user, - 'params[pass]' : self.accounts[user]['password']}) + 'params[pass]' : self.getAccountData(user)['password']}) return json_loads(answer) diff --git a/module/plugins/accounts/PutdriveCom.py b/module/plugins/accounts/PutdriveCom.py new file mode 100644 index 000000000..7e7410d4e --- /dev/null +++ b/module/plugins/accounts/PutdriveCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.accounts.ZeveraCom import ZeveraCom + + +class PutdriveCom(ZeveraCom): + __name__ = "PutdriveCom" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Putdrive.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + API_URL = "http://api.putdrive.com/jDownloader.ashx" diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index 18af5f736..16141d63e 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class QuickshareCz(Account): __name__ = "QuickshareCz" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Quickshare.cz account plugin""" __license__ = "GPLv3" @@ -33,11 +33,11 @@ class QuickshareCz(Account): def login(self, user, data, req): - html = req.load('http://www.quickshare.cz/html/prihlaseni_process.php', post={ - "akce": u'Přihlásit', - "heslo": data['password'], - "jmeno": user - }, decode=True) + html = req.load('http://www.quickshare.cz/html/prihlaseni_process.php', + post={"akce": u'Přihlásit', + "heslo": data['password'], + "jmeno": user}, + decode=True) if u'>Takový uživatel neexistuje.<' in html or u'>Špatné heslo.<' in html: self.wrongPassword() diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 813453c03..829e54a46 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" @@ -44,7 +44,7 @@ class RPNetBiz(Account): def getAccountStatus(self, user, req): # Using the rpnet API, check if valid premium account res = req.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": self.accounts[user]['password'], + get={"username": user, "password": self.getAccountData(user)['password'], "action": "showAccountInformation"}) self.logDebug("JSON data: %s" % res) diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 2899d5a68..b29d94228 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Rapidgator.net account plugin""" __license__ = "GPLv3" @@ -44,7 +44,9 @@ class RapidgatorNet(Account): def login(self, user, data, req): try: json = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']}) + self.logDebug("API:LOGIN", json) + json = json_loads(json) if json['response_status'] == 200: @@ -52,6 +54,7 @@ class RapidgatorNet(Account): return else: self.logError(json['response_details']) + except Exception, e: self.logError(e) diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 48b17df5f..41d8a0975 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class RealdebridCom(Account): __name__ = "RealdebridCom" __type__ = "account" - __version__ = "0.44" + __version__ = "0.45" __description__ = """Real-Debrid.com account plugin""" __license__ = "GPLv3" @@ -28,9 +28,13 @@ class RealdebridCom(Account): def login(self, user, data, req): self.pin_code = False - html = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']}) + html = req.load("https://real-debrid.com/ajax/login.php", + get={"user": user, "pass": data['password']}, + decode=True) + if "Your login informations are incorrect" in html: self.wrongPassword() + elif "PIN Code required" in html: self.logWarning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com")) self.pin_code = True diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 00a45dedd..660bef07e 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Rehost.to account plugin""" __license__ = "GPLv3" @@ -17,8 +17,10 @@ class RehostTo(Account): data = self.getAccountData(user) html = req.load("http://rehost.to/api.php", get={'cmd': "login", 'user': user, 'pass': data['password']}) + data = [x.split("=") for x in html.split(",")] - ses = data[0][1] + + ses = data[0][1] long_ses = data[1][1] html = req.load("http://rehost.to/api.php", @@ -39,7 +41,8 @@ class RehostTo(Account): def login(self, user, data, req): html = req.load("http://rehost.to/api.php", - get={'cmd': "login", 'user': user, 'pass': data['password']}) + get={'cmd': "login", 'user': user, 'pass': data['password']}, + decode=True) if "Login failed." in html: self.wrongPassword() diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 57fe52385..3ee6e04af 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.29" + __version__ = "0.30" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -17,7 +17,10 @@ class ShareonlineBiz(Account): def api_response(self, user, req): return req.load("http://api.share-online.biz/cgi-bin", - get={'q': "userdetails", 'aux': "traffic", "username": user, "password": self.accounts[user]['password']}) + get={'q' : "userdetails", + 'aux' : "traffic", + 'username': user, + 'password': self.getAccountData(user)['password']}) def loadAccountInfo(self, user, req): diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 465757457..accb3aba8 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -7,7 +7,7 @@ from module.plugins.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Simply-Premium.com account plugin""" __license__ = "GPLv3" @@ -42,7 +42,7 @@ class SimplyPremiumCom(Account): else: post_data = {"login_name": user, "login_pass": data['password']} - html = req.load("http://www.simply-premium.com/login.php", post=post_data) + html = req.load("http://www.simply-premium.com/login.php", post=post_data, decode=True) if 'logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 406534364..29be2f73d 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class SimplydebridCom(Account): __name__ = "SimplydebridCom" __type__ = "account" - __version__ = "0.10" + __version__ = "0.11" __description__ = """Simply-Debrid.com account plugin""" __license__ = "GPLv3" @@ -27,8 +27,9 @@ class SimplydebridCom(Account): def login(self, user, data, req): self.loginname = user - self.password = data['password'] - get_data = {'login': 1, 'u': self.loginname, 'p': self.password} + self.password = data['password'] + get_data = {'login': 1, 'u': self.loginname, 'p': self.password} + res = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) if res != "02: loggin success": self.wrongPassword() diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 8157806c8..d192f20cf 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -1,43 +1,48 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account - -from module.common.json_layer import json_loads - -from time import time - import hashlib + from beaker.crypto.pbkdf2 import PBKDF2 +from time import time +from module.common.json_layer import json_loads +from module.plugins.Account import Account class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" - __authors__ = [] + __authors__ = [("", "")] def loadAccountInfo(self, user, req): # Get user data from premiumize.me status = self.getAccountStatus(user, req) - self.logDebug(status) - # Parse account info - account_info = {"validuntil": float(status["data"]["user"]["user_premium"]), - "trafficleft": max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]), - "session_key": status["data"]["session_key"], - "hoster": [hoster["name"] for hoster in status["data"]["hoster"]]} + self.logDebug(status) - if account_info["validuntil"] < time(): - account_info['premium'] = False + if status['state'] != 'ok': + info = {'validuntil' : None, + 'trafficleft': None, + 'premium' : False} else: - account_info['premium'] = True + # Parse account info + info = {'validuntil' : float(status["data"]["user"]["user_premium"]), + 'trafficleft': max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]), + 'session_key': status["data"]["session_key"], + 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]} + + if info['validuntil'] < time(): + info['premium'] = False + else: + info['premium'] = True + + return info - return account_info def login(self, user, data, req): # Get user data from premiumize.me @@ -47,9 +52,11 @@ class SmoozedCom(Account): if status['state'] != 'ok': self.wrongPassword() + def getAccountStatus(self, user, req): - salt = hashlib.sha256(self.accounts[user]['password']).hexdigest() - encrypted = PBKDF2(self.accounts[user]['password'], salt, iterations=1000).hexread(32) - answer = req.load('http://www2.smoozed.com/api/login?auth=%s&password=%s' % ( - user, encrypted)) - return json_loads(answer) + password = self.getAccountData(user)['password'] + salt = hashlib.sha256(password).hexdigest() + encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) + + return json_loads(req.load("http://www2.smoozed.com/api/login", + get={'auth': user, 'password': encrypted})) diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py index 2b08c67cd..882dbd2c3 100644 --- a/module/plugins/accounts/StahnuTo.py +++ b/module/plugins/accounts/StahnuTo.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class StahnuTo(Account): __name__ = "StahnuTo" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """StahnuTo account plugin""" __license__ = "GPLv3" @@ -25,10 +25,11 @@ class StahnuTo(Account): def login(self, user, data, req): - html = req.load("http://www.stahnu.to/login.php", post={ - "username": user, - "password": data['password'], - "submit": "Login"}) + html = req.load("http://www.stahnu.to/login.php", + post={"username": user, + "password": data['password'], + "submit": "Login"}, + decode=True) if not '' in html: self.wrongPassword() diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index f87d234a7..a857649eb 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class TurbobitNet(Account): __name__ = "TurbobitNet" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """TurbobitNet account plugin""" __license__ = "GPLv3" @@ -33,10 +33,11 @@ class TurbobitNet(Account): def login(self, user, data, req): req.cj.setCookie("turbobit.net", "user_lang", "en") - html = req.load("http://turbobit.net/user/login", post={ - "user[login]": user, - "user[pass]": data['password'], - "user[submit]": "Login"}) + html = req.load("http://turbobit.net/user/login", + post={"user[login]": user, + "user[pass]": data['password'], + "user[submit]": "Login"}, + decode=True) if not '", html).group(1) - validuntil = mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(validuntil, "%Y-%m-%d %H:%M:%S")) return {"validuntil": validuntil, "trafficleft": -1} diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index f92a4e821..db4539e2e 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime import re +import time from module.plugins.Account import Account @@ -25,7 +25,7 @@ class EuroshareEu(Account): premium, validuntil = False, -1 else: premium = True - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y %H:%M")) return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 426d572db..f07f4895a 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from pycurl import REFERER @@ -29,7 +29,7 @@ class FilefactoryCom(Account): if m: premium = True validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g \g \g', m.group(0)) - validuntil = mktime(strptime(validuntil, "%d %b %Y")) + validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y")) else: premium = False validuntil = -1 diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index 9f7474207..b92a371a5 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from module.plugins.Account import Account @@ -28,7 +28,7 @@ class FilejungleCom(Account): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: premium = True - validuntil = mktime(strptime(m.group(1), "%d %b %Y")) + validuntil = time.mktime(time.strptime(m.group(1), "%d %b %Y")) else: premium = False validuntil = -1 diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 1cf2a3a3c..5eb6b844c 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -24,7 +24,7 @@ class FileserveCom(Account): res = json_loads(html) if res['type'] == "premium": - validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) return {"trafficleft": res['traffic'], "validuntil": validuntil} else: return {"premium": False, "trafficleft": None, "validuntil": None} diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index a1c7b5662..ca3602a2c 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import strptime, mktime +import time from module.plugins.Account import Account @@ -26,7 +25,7 @@ class FreakshareCom(Account): try: m = re.search(r'ltig bis:\s*([\d.:-]+)', html, re.M) - validuntil = mktime(strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) except Exception: pass diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 66d912958..0c76e2824 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime +import time from module.plugins.Account import Account @@ -35,7 +34,7 @@ class FshareVn(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: premium = True - validuntil = mktime(strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) + validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) trafficleft = self.getTrafficLeft() else: premium = False diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 9f28799a2..d2ba1d237 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import gmtime, mktime, strptime +import time from module.plugins.Account import Account @@ -41,13 +40,13 @@ class Keep2ShareCc(Account): validuntil = -1 else: try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) + validuntil = time.mktime(time.strptime(expiredate, "%Y.%m.%d")) except Exception, e: self.logError(e) else: - premium = True if validuntil > mktime(gmtime()) else False + premium = True if validuntil > time.mktime(time.gmtime()) else False m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index b229fe47d..262d5a818 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- import re +import time -from time import mktime, strptime from module.plugins.Account import Account @@ -34,7 +34,7 @@ class MegaRapidCz(Account): m = re.search(self.VALID_UNTIL_PATTERN, htmll) if m: - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M")) return {"premium": True, "trafficleft": -1, "validuntil": validuntil} m = re.search(self.TRAFFIC_LEFT_PATTERN, htmll) diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 127ebadc8..3d7ddbe46 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from module.plugins.Account import Account @@ -29,7 +29,7 @@ class MegasharesCom(Account): try: timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug(timestr) - validuntil = mktime(strptime(timestr, "%b %d, %Y")) + validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y")) except Exception, e: self.logError(e) diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 4c75b27f0..9a13e2e42 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import time +import time from module.common.json_layer import json_loads from module.plugins.Account import Account @@ -18,7 +18,7 @@ class MyfastfileCom(Account): def loadAccountInfo(self, user, req): if 'days_left' in self.json_data: - validuntil = time() + self.json_data['days_left'] * 24 * 60 * 60 + validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60 return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError(_("Unable to get account information")) diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index a36b114eb..7e3f757d3 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -from datetime import datetime +import datetime import hashlib +import time from module.plugins.Account import Account -from time import mktime from module.common.json_layer import json_loads as loads @@ -44,7 +44,7 @@ class NoPremiumPl(Account): if "expire" in result.keys() and result["expire"]: premium = True - valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] * 1024 return ({ diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index f44ae3865..2f7b033bd 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import gmtime, mktime, strptime +import time from module.plugins.Account import Account @@ -33,13 +32,13 @@ class NowVideoSx(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%b-%d")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): + if validuntil > time.mktime(time.gmtime()): premium = True else: premium = False diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 1fc8d994d..be4b5e67e 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import strptime, mktime +import time from pycurl import REFERER @@ -36,7 +35,7 @@ class OneFichierCom(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) + validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) except Exception, e: self.logError(e) else: diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 426c680a6..3e9d52fe8 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -from datetime import datetime +import datetime import hashlib +import time from module.plugins.Account import Account -from time import mktime from module.common.json_layer import json_loads as loads @@ -43,7 +43,7 @@ class RapideoPl(Account): valid_untill = -1 if "expire" in result.keys() and result["expire"]: premium = True - valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 8da698c57..70f47b673 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import time +import time from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -38,7 +37,7 @@ class RapiduNet(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: - validuntil = time() + (86400 * int(m.group(1))) + validuntil = time.time() + (86400 * int(m.group(1))) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 29be2f73d..24108eb0b 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time from module.plugins.Account import Account @@ -22,7 +22,7 @@ class SimplydebridCom(Account): if str(data[0]) != "1": return {"premium": False} else: - return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} + return {"trafficleft": -1, "validuntil": time.mktime(time.strptime(str(data[2]), "%d/%m/%Y"))} def login(self, user, data, req): diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index e6c25752b..87efb89b3 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- import hashlib +import time from beaker.crypto.pbkdf2 import PBKDF2 -from time import time from module.common.json_layer import json_loads from module.plugins.Account import Account @@ -36,7 +36,7 @@ class SmoozedCom(Account): 'session' : status["data"]["session_key"], 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]} - if info['validuntil'] < time(): + if info['validuntil'] < time.time(): info['premium'] = False else: info['premium'] = True diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index a857649eb..010fbc270 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from module.plugins.Account import Account @@ -22,7 +22,7 @@ class TurbobitNet(Account): m = re.search(r'Turbo Access to ([\d.]+)', html) if m: premium = True - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y")) else: premium = False validuntil = -1 diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py index 279dfd00a..d06ba0583 100644 --- a/module/plugins/accounts/TusfilesNet.py +++ b/module/plugins/accounts/TusfilesNet.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime, gmtime +import time from module.plugins.internal.XFSAccount import XFSAccount diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 4e5c8035b..d1556b6db 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import time +import time from module.plugins.Account import Account @@ -39,7 +39,7 @@ class UploadedTo(Account): else: m = re.findall(r'(\d+) (week|day|hour)', expiredate) if m: - validuntil = time() + validuntil = time.time() for n, u in m: validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index c70d2ec11..5d02ff3a3 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import time, strptime, mktime +import time from module.plugins.Account import Account from module.plugins.internal.SimpleHoster import set_cookies @@ -37,13 +36,13 @@ class UploadingCom(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%b %d, %Y")) + validuntil = time.mktime(time.strptime(expiredate, "%b %d, %Y")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): + if validuntil > time.mktime(time.gmtime()): premium = True else: premium = False @@ -59,5 +58,5 @@ class UploadingCom(Account): ("uploading.com", "_lang", "en")] req.load("http://uploading.com/") - req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000), + req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000), post={'email': user, 'password': data['password'], 'remember': "on"}) diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py index f8e3eeb73..3c5f45d34 100644 --- a/module/plugins/accounts/WebshareCz.py +++ b/module/plugins/accounts/WebshareCz.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- import re +import time from hashlib import md5, sha1 from passlib.hash import md5_crypt -from time import mktime, strptime, time from module.plugins.Account import Account @@ -34,9 +34,9 @@ class WebshareCz(Account): expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug("Expire date: " + expiredate) - validuntil = mktime(strptime(expiredate, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S")) trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1)) - premium = validuntil > time() + premium = validuntil > time.time() return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index d1585111a..9bc6d0487 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time from module.plugins.Account import Account @@ -40,7 +40,7 @@ class ZeveraCom(Account): api = self.api_response(req) if "No trafic" not in api and api['endsubscriptiondate'] != "Expired!": - validuntil = mktime(strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) trafficleft = float(api['availabletodaytraffic']) * 1024 if api['orondaytrafficlimit'] != '0' else -1 premium = True -- cgit v1.2.3 From e50ae73744ef9cb3341e328fdee2adbd3032b7c9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 15 Mar 2015 14:37:42 +0100 Subject: Fix https://github.com/pyload/pyload/issues/945 (thx https://github.com/mikkiste) --- module/plugins/accounts/FastshareCz.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index d6e94f2e3..b946e29ba 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class FastshareCz(Account): __name__ = "FastshareCz" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Fastshare.cz account plugin""" __license__ = "GPLv3" @@ -16,13 +16,13 @@ class FastshareCz(Account): ("stickell", "l.stickell@yahoo.it")] - CREDIT_PATTERN = r'My account\s*\((.+?)\)' + CREDIT_PATTERN = r'Credit\s*:\s*\s*(.+?)\s*<' def loadAccountInfo(self, user, req): - validuntil = None + validuntil = -1 trafficleft = None - premium = None + premium = False html = req.load("http://www.fastshare.cz/user", decode=True) @@ -30,13 +30,11 @@ class FastshareCz(Account): if m: trafficleft = self.parseTraffic(m.group(1)) - if trafficleft: - premium = True - validuntil = -1 - else: - premium = False + premium = bool(trafficleft) - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): -- cgit v1.2.3 From 48c8826b9be24f655d3fb2d69c3906ef7a4f9c60 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 18 Mar 2015 13:32:30 +0100 Subject: [UploadingCom] Account fixup --- module/plugins/accounts/UploadingCom.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index 5d02ff3a3..a20c44535 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import set_cookies class UploadingCom(Account): __name__ = "UploadingCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Uploading.com account plugin""" __license__ = "GPLv3" @@ -43,19 +43,22 @@ class UploadingCom(Account): else: if validuntil > time.mktime(time.gmtime()): - premium = True + premium = True else: - premium = False + premium = False validuntil = None - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): - set_cookies([("uploading.com", "lang", "1"), - ("uploading.com", "language", "1"), - ("uploading.com", "setlang", "en"), - ("uploading.com", "_lang", "en")] + set_cookies(req.cj, + [("uploading.com", "lang" , "1" ), + ("uploading.com", "language", "1" ), + ("uploading.com", "setlang" , "en"), + ("uploading.com", "_lang" , "en")]) req.load("http://uploading.com/") req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000), -- cgit v1.2.3 From 61457a4e1b1ef95edbd7e7d82d01ad44d4158bdf Mon Sep 17 00:00:00 2001 From: Kagenoshin Date: Wed, 25 Mar 2015 10:51:46 +0100 Subject: New plugin: MegaRapidoNet --- module/plugins/accounts/MegaRapidoNet.py | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 module/plugins/accounts/MegaRapidoNet.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py new file mode 100644 index 000000000..55b52907c --- /dev/null +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +import re +from time import mktime, strptime, time + +from module.plugins.Account import Account + + +class MegaRapidoNet(Account): + __name__ = "MegaRapidoNet" + __version__ = "0.01" + __type__ = "account" + __description__ = """Megarapido.net account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + VALIDUNTIL_PATTERN = re.compile(r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"][^>]*>[^<]*?<[^>]*?b[^>]*>\s*?TEMPO\s*?PREMIUM[^<]*<[^>]*?/b[^>]*>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS', re.I) + USER_ID_PATTERN= re.compile(r' <\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']', re.I) + + def loadAccountInfo(self, user, req): + response = req.load("http://megarapido.net/gerador", decode=True) + + validuntil = self.VALIDUNTIL_PATTERN.search(response) + if validuntil: + #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) + validuntil = time() + int(validuntil.group(1))*24*3600 + int(validuntil.group(2))*3600 + int(validuntil.group(3))*60 + int(validuntil.group(4)) + + if validuntil: + return {"trafficleft": -1, "validuntil": validuntil} + else: + return {"premium": False} + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + post_data = {'login': self.loginname, 'senha': self.password} + req.load("http://megarapido.net/login") + response = req.load("http://megarapido.net/painel_user/ajax/logar.php", post=post_data, decode=True) + response = req.load("http://megarapido.net/gerador") + if 'sair' not in response.lower(): + self.wrongPassword() + else: + user_id = self.USER_ID_PATTERN.search(response) + if user_id: + user_id = user_id.group(1) + self.setStorage("MegarapidoNet_userID", user_id) + else: + self.fail("Couldn't find the user ID") \ No newline at end of file -- cgit v1.2.3 From aaa8b74cbc8cab1ccd314c820b1fff5999bd2fd9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 12:08:31 +0100 Subject: [MegaRapidoNet] Cleanup --- module/plugins/accounts/MegaRapidoNet.py | 64 ++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py index 55b52907c..80e066244 100644 --- a/module/plugins/accounts/MegaRapidoNet.py +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -1,47 +1,57 @@ # -*- coding: utf-8 -*- + import re -from time import mktime, strptime, time +import time from module.plugins.Account import Account class MegaRapidoNet(Account): - __name__ = "MegaRapidoNet" - __version__ = "0.01" - __type__ = "account" - __description__ = """Megarapido.net account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") + __name__ = "MegaRapidoNet" + __type__ = "account" + __version__ = "0.02" + + __description__ = """MegaRapido.net account plugin""" + __license__ = "GPLv3" + __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + + + VALID_UNTIL_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"][^>]*>[^<]*?<[^>]*?b[^>]*>\s*?TEMPO\s*?PREMIUM[^<]*<[^>]*?/b[^>]*>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS' + USER_ID_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']' - VALIDUNTIL_PATTERN = re.compile(r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"][^>]*>[^<]*?<[^>]*?b[^>]*>\s*?TEMPO\s*?PREMIUM[^<]*<[^>]*?/b[^>]*>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS', re.I) - USER_ID_PATTERN= re.compile(r' <\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']', re.I) def loadAccountInfo(self, user, req): - response = req.load("http://megarapido.net/gerador", decode=True) + validuntil = None + trafficleft = None + premium = False + + html = req.load("http://megarapido.net/gerador", decode=True) - validuntil = self.VALIDUNTIL_PATTERN.search(response) + validuntil = re.search(self.VALID_UNTIL_PATTERN, html) if validuntil: #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) - validuntil = time() + int(validuntil.group(1))*24*3600 + int(validuntil.group(2))*3600 + int(validuntil.group(3))*60 + int(validuntil.group(4)) + validuntil = time.time() + int(validuntil.group(1)) * 24 * 3600 + int(validuntil.group(2)) * 3600 + int(validuntil.group(3)) * 60 + int(validuntil.group(4)) + trafficleft = -1 + premium = True + + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} - if validuntil: - return {"trafficleft": -1, "validuntil": validuntil} - else: - return {"premium": False} def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - post_data = {'login': self.loginname, 'senha': self.password} req.load("http://megarapido.net/login") - response = req.load("http://megarapido.net/painel_user/ajax/logar.php", post=post_data, decode=True) - response = req.load("http://megarapido.net/gerador") - if 'sair' not in response.lower(): + req.load("http://megarapido.net/painel_user/ajax/logar.php", + post={'login': user, 'senha': data['password']}, + decode=True) + + html = req.load("http://megarapido.net/gerador") + + if "sair" not in html.lower(): self.wrongPassword() else: - user_id = self.USER_ID_PATTERN.search(response) - if user_id: - user_id = user_id.group(1) - self.setStorage("MegarapidoNet_userID", user_id) + m = re.search(self.USER_ID_PATTERN, html) + if m: + data['uid'] = m.group(1) else: - self.fail("Couldn't find the user ID") \ No newline at end of file + self.fail("Couldn't find the user ID") -- cgit v1.2.3 From 589121e80835c63aea0880a53c6678de5c31c16e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 28 Mar 2015 01:59:01 +0100 Subject: Spare code cosmetics --- module/plugins/accounts/FilerNet.py | 2 +- module/plugins/accounts/FshareVn.py | 4 ++-- module/plugins/accounts/MegaRapidoNet.py | 14 +++++++------- module/plugins/accounts/MultishareCz.py | 2 +- module/plugins/accounts/UlozTo.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 4067445af..ac5fd11da 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -16,7 +16,7 @@ class FilerNet(Account): __authors__ = [("stickell", "l.stickell@yahoo.it")] - TOKEN_PATTERN = r'_csrf_token" value="([^"]+)" />' + TOKEN_PATTERN = r'_csrf_token" value="(.+?)" />' WALID_UNTIL_PATTERN = r'Der Premium-Zugang ist gültig bis (.+)\.\s*' TRAFFIC_PATTERN = r'Traffic\s*([^<]+)' FREE_PATTERN = r'Account Status\s*\s*Free' diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 0c76e2824..7fcf88f20 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -18,8 +18,8 @@ class FshareVn(Account): VALID_UNTIL_PATTERN = ur'
Thời hạn dùng:
\s*
([^<]+)
' - LIFETIME_PATTERN = ur'
Lần đăng nhập trước:
\s*
[^<]+
' - TRAFFIC_LEFT_PATTERN = ur'
Tổng Dung Lượng Tài Khoản
\s*]*>([\d.]+) ([kKMG])B' + LIFETIME_PATTERN = ur'
Lần đăng nhập trước:
\s*
.+?
' + TRAFFIC_LEFT_PATTERN = ur'
Tổng Dung Lượng Tài Khoản
\s*([\d.]+) ([kKMG])B' DIRECT_DOWNLOAD_PATTERN = ur']*)[^>]*/>Kích hoạt download trực tiếp' diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py index 80e066244..d061d02bc 100644 --- a/module/plugins/accounts/MegaRapidoNet.py +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -16,8 +16,8 @@ class MegaRapidoNet(Account): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - VALID_UNTIL_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"][^>]*>[^<]*?<[^>]*?b[^>]*>\s*?TEMPO\s*?PREMIUM[^<]*<[^>]*?/b[^>]*>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS' - USER_ID_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']' + VALID_UNTIL_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"].*?>[^<]*?<[^>]*?b.*?>\s*?TEMPO\s*?PREMIUM.*?<[^>]*?/b.*?>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS' + USER_ID_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']' def loadAccountInfo(self, user, req): @@ -50,8 +50,8 @@ class MegaRapidoNet(Account): if "sair" not in html.lower(): self.wrongPassword() else: - m = re.search(self.USER_ID_PATTERN, html) - if m: - data['uid'] = m.group(1) - else: - self.fail("Couldn't find the user ID") + m = re.search(self.USER_ID_PATTERN, html) + if m: + data['uid'] = m.group(1) + else: + self.fail("Couldn't find the user ID") diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 0ac764ee1..3488e3288 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -16,7 +16,7 @@ class MultishareCz(Account): TRAFFIC_LEFT_PATTERN = r'Kredit:\s*(?P[\d.,]+) (?P[\w^_]+)' - ACCOUNT_INFO_PATTERN = r'' + ACCOUNT_INFO_PATTERN = r'' def loadAccountInfo(self, user, req): diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 7236a4fa8..6ddb34385 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -18,7 +18,7 @@ class UlozTo(Account): ("pulpe", None)] - TRAFFIC_LEFT_PATTERN = r'