From 3fa1f23039cd64a71f5eacf6cfa8988c947ec32c Mon Sep 17 00:00:00 2001 From: GamaC0de Date: Wed, 8 Jun 2016 22:24:25 +0300 Subject: [FilefactoryCom] Fix #2498 --- module/plugins/accounts/FilefactoryCom.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 5be4f3cf6..527acbd82 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -11,13 +11,14 @@ from module.plugins.internal.Account import Account class FilefactoryCom(Account): __name__ = "FilefactoryCom" __type__ = "account" - __version__ = "0.21" + __version__ = "0.22" __status__ = "testing" __description__ = """Filefactory.com account plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + __authors__ = [("zoidberg", "zoidberg@mujmail.cz" ), + ("stickell", "l.stickell@yahoo.it" ), + ("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")] VALID_UNTIL_PATTERN = r'Premium valid until: (?P\d{1,2})\w{1,2} (?P\w{3}), (?P\d{4})' @@ -31,6 +32,7 @@ class FilefactoryCom(Account): premium = True validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g \g \g', m.group(0)) validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y")) + else: premium = False validuntil = -1 @@ -39,12 +41,14 @@ class FilefactoryCom(Account): def signin(self, user, password, data): - self.req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php") + html = self.load("https://www.filefactory.com/member/signin.php") + if "/member/signout.php" in html: + self.skip_login() html = self.load("https://www.filefactory.com/member/signin.php", post={'loginEmail' : user, 'loginPassword': password, 'Submit' : "Sign In"}) - if self.req.lastEffectiveURL != "http://www.filefactory.com/account/": + if "/member/signout.php" not in html: self.fail_login() -- cgit v1.2.3