diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-05 02:26:08 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-05 02:27:40 +0200 |
commit | 56971d70884e7d4f3242e7c52da88c4298ba130a (patch) | |
tree | 970c6c19b220f92642fba76a91eab0a3500c4107 /module/plugins | |
parent | Spare code fixes about COOKIES (diff) | |
download | pyload-56971d70884e7d4f3242e7c52da88c4298ba130a.tar.xz |
[XFSPAccount] COOKIES attribute support
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/accounts/CramitIn.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/File4safeCom.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/FilerioCom.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/MovReelCom.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/RarefileNet.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/RyushareCom.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/UptoboxCom.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/XFSPAccount.py | 20 |
8 files changed, 27 insertions, 21 deletions
diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py index 34aa3ab40..f0cf2c6c7 100644 --- a/module/plugins/accounts/CramitIn.py +++ b/module/plugins/accounts/CramitIn.py @@ -6,10 +6,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class CramitIn(XFSPAccount): __name__ = "CramitIn" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Cramit.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://cramit.in/" + HOSTER_URL = "http://cramit.in/" diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py index aa7894e98..17a94195a 100644 --- a/module/plugins/accounts/File4safeCom.py +++ b/module/plugins/accounts/File4safeCom.py @@ -6,13 +6,13 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class File4safeCom(XFSPAccount): __name__ = "File4safeCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """File4safe.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - MAIN_PAGE = "http://file4safe.com/" + HOSTER_URL = "http://file4safe.com/" LOGIN_FAIL_PATTERN = r'input_login' PREMIUM_PATTERN = r'Extend Premium' diff --git a/module/plugins/accounts/FilerioCom.py b/module/plugins/accounts/FilerioCom.py index 544a7f3a6..8b5c41fee 100644 --- a/module/plugins/accounts/FilerioCom.py +++ b/module/plugins/accounts/FilerioCom.py @@ -6,10 +6,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class FilerioCom(XFSPAccount): __name__ = "FilerioCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """FileRio.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://filerio.in/" + HOSTER_URL = "http://filerio.in/" diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py index 34862c4ef..1c2f3bbd4 100644 --- a/module/plugins/accounts/MovReelCom.py +++ b/module/plugins/accounts/MovReelCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class MovReelCom(XFSPAccount): __name__ = "MovReelCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Movreel.com account plugin""" __author_name__ = "t4skforce" @@ -15,7 +15,7 @@ class MovReelCom(XFSPAccount): login_timeout = 60 info_threshold = 30 - MAIN_PAGE = "http://movreel.com/" + HOSTER_URL = "http://movreel.com/" TRAFFIC_LEFT_PATTERN = r'Traffic.*?<b>([^<]+)</b>' LOGIN_FAIL_PATTERN = r'<b[^>]*>Incorrect Login or Password</b><br>' diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index c8eae79a8..e1fa7878a 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -6,10 +6,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RarefileNet(XFSPAccount): __name__ = "RarefileNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """RareFile.net account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://rarefile.net/" + HOSTER_URL = "http://rarefile.net/" diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py index 7fb373ca7..e6f9d486d 100644 --- a/module/plugins/accounts/RyushareCom.py +++ b/module/plugins/accounts/RyushareCom.py @@ -6,13 +6,13 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RyushareCom(XFSPAccount): __name__ = "RyushareCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Ryushare.com account plugin""" __author_name__ = ("zoidberg", "trance4us") __author_mail__ = ("zoidberg@mujmail.cz", "") - MAIN_PAGE = "http://ryushare.com/" + HOSTER_URL = "http://ryushare.com/" def login(self, user, data, req): diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py index 60de213ae..2c5f79ea1 100644 --- a/module/plugins/accounts/UptoboxCom.py +++ b/module/plugins/accounts/UptoboxCom.py @@ -6,12 +6,12 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class UptoboxCom(XFSPAccount): __name__ = "UptoboxCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """DDLStorage.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://uptobox.com/" + HOSTER_URL = "http://uptobox.com/" VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire: ([^<]+)</strong>' diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py index 5c0bfc893..b93fb5d30 100644 --- a/module/plugins/internal/XFSPAccount.py +++ b/module/plugins/internal/XFSPAccount.py @@ -5,20 +5,23 @@ import re from time import mktime, strptime from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm +from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies from module.utils import parseFileSize class XFSPAccount(Account): __name__ = "XFSPAccount" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """XFileSharingPro base account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = None + + HOSTER_URL = None + + COOKIES = None #: or list of tuples [(domain, name, value)] VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:</TD><TD><b>([^<]+)</b>' TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><b>([^<]+)</b>' @@ -27,7 +30,7 @@ class XFSPAccount(Account): def loadAccountInfo(self, user, req): - html = req.load(self.MAIN_PAGE + "?op=my_account", decode=True) + html = req.load(self.HOSTER_URL + "?op=my_account", decode=True) validuntil = trafficleft = None premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -52,18 +55,21 @@ class XFSPAccount(Account): return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + def login(self, user, data, req): - html = req.load('%slogin.html' % self.MAIN_PAGE, decode=True) + set_cookies(req.cj, self.COOKIES) + + html = req.load('%slogin.html' % self.HOSTER_URL, decode=True) action, inputs = parseHtmlForm('name="FL"', html) if not inputs: inputs = {"op": "login", - "redirect": self.MAIN_PAGE} + "redirect": self.HOSTER_URL} inputs.update({"login": user, "password": data['password']}) - html = req.load(self.MAIN_PAGE, post=inputs, decode=True) + html = req.load(self.HOSTER_URL, post=inputs, decode=True) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() |