diff options
| author | 2015-10-02 10:09:26 +0200 | |
|---|---|---|
| committer | 2015-10-02 10:09:26 +0200 | |
| commit | 3a08656c5665f4b8db98744fb323e64b8630e084 (patch) | |
| tree | 28f9f62ffc57888b76ca32540dbf5af3a4cfc8d0 /module/plugins/accounts | |
| parent | Merge pull request #1 from pyload/stable (diff) | |
| parent | [Account] Improve parse_traffic method + code cosmetics (diff) | |
| download | pyload-3a08656c5665f4b8db98744fb323e64b8630e084.tar.xz | |
Merge pull request #2 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts')
95 files changed, 746 insertions, 475 deletions
| diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 6a2f09c9c..12d0582a8 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -12,16 +12,25 @@ from module.plugins.internal.Account import Account  class AlldebridCom(Account):      __name__    = "AlldebridCom"      __type__    = "account" -    __version__ = "0.26" +    __version__ = "0.28"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """AllDebrid.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("Andy Voigt", "spamsales@online.de")] -    def parse_info(self, user, password, data, req): -        data = self.get_data(user) +    def grab_hosters(self, user, password, data): +        html = self.load("https://www.alldebrid.com/api.php", +                         get={'action': "get_host"}) +        return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] + + +    def grab_info(self, user, password, data):          html = self.load("http://www.alldebrid.com/account/")          soup = BeautifulSoup.BeautifulSoup(html) @@ -38,7 +47,6 @@ class AlldebridCom(Account):          #: Get expiration date from API          except Exception: -            data = self.get_data(user)              html = self.load("https://www.alldebrid.com/api.php",                               get={'action': "info_user",                                    'login' : user, @@ -54,7 +62,7 @@ class AlldebridCom(Account):                  'premium'    : True    } -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://www.alldebrid.com/register/",                           get={'action'        : "login",                                'login_login'   : user, @@ -63,4 +71,4 @@ class AlldebridCom(Account):          if "This login doesn't exist" in html \             or "The password is not valid" in html \             or "Invalid captcha" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/AniStreamCom.py b/module/plugins/accounts/AniStreamCom.py index 53ca1d5b8..5c7ac9fff 100644 --- a/module/plugins/accounts/AniStreamCom.py +++ b/module/plugins/accounts/AniStreamCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class AniStreamCom(XFSAccount):      __name__    = "AniStreamCom"      __type__    = "account" -    __version__ = "0.01" +    __version__ = "0.02"      __status__  = "testing"      __description__ = """Ani-Stream.com account plugin""" @@ -14,4 +14,4 @@ class AniStreamCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "ani-stream.com" +    PLUGIN_DOMAIN = "ani-stream.com" diff --git a/module/plugins/accounts/BackinNet.py b/module/plugins/accounts/BackinNet.py index 58939c13a..d903f020c 100644 --- a/module/plugins/accounts/BackinNet.py +++ b/module/plugins/accounts/BackinNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class BackinNet(XFSAccount):      __name__    = "BackinNet"      __type__    = "account" -    __version__ = "0.02" +    __version__ = "0.03"      __status__  = "testing"      __description__ = """Backin.net account plugin""" @@ -14,4 +14,4 @@ class BackinNet(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "backin.net" +    PLUGIN_DOMAIN = "backin.net" diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 280f008b2..e8028b9d0 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account  class BitshareCom(Account):      __name__    = "BitshareCom"      __type__    = "account" -    __version__ = "0.15" +    __version__ = "0.17"      __status__  = "testing"      __description__ = """Bitshare account plugin""" @@ -14,7 +14,7 @@ class BitshareCom(Account):      __authors__     = [("Paul King", None)] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://bitshare.com/mysettings.html")          if "\"http://bitshare.com/myupgrade.html\">Free" in html: @@ -26,11 +26,11 @@ class BitshareCom(Account):          return {'validuntil': -1, 'trafficleft': -1, 'premium': True} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://bitshare.com/login.html",                           post={'user'    : user,                                 'password': password,                                 'submit'  : "Login"}) -        if "login" in req.lastEffectiveURL: -            self.login_fail() +        if "login" in self.req.lastEffectiveURL: +            self.fail_login() diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index 92f1cb27e..6e11064a6 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class CatShareNet(Account):      __name__    = "CatShareNet"      __type__    = "account" -    __version__ = "0.08" +    __version__ = "0.10"      __status__  = "testing"      __description__ = """Catshare.net account plugin""" @@ -22,7 +22,7 @@ class CatShareNet(Account):      TRAFFIC_LEFT_PATTERN = r'<a href="/premium">([0-9.]+ [kMG]B)' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          premium     = False          validuntil  = -1          trafficleft = -1 @@ -50,7 +50,7 @@ class CatShareNet(Account):          return {'premium': premium, 'trafficleft': trafficleft, 'validuntil': validuntil} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("http://catshare.net/login",  #@TODO: Revert to `https` in 0.4.10                           post={'user_email'    : user,                                 'user_password' : password, @@ -58,4 +58,4 @@ class CatShareNet(Account):                                 'user[submit]'  : "Login"})          if not '<a href="/logout">Wyloguj</a>' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/CloudsixMe.py b/module/plugins/accounts/CloudsixMe.py index 973e37044..3410af002 100644 --- a/module/plugins/accounts/CloudsixMe.py +++ b/module/plugins/accounts/CloudsixMe.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class CloudsixMe(XFSAccount):      __name__    = "CloudsixMe"      __type__    = "account" -    __version__ = "0.01" +    __version__ = "0.02"      __status__  = "testing"      __description__ = """Cloudsix.me account plugin""" @@ -14,4 +14,4 @@ class CloudsixMe(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "cloudsix.me" +    PLUGIN_DOMAIN = "cloudsix.me" diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py index 0d473eb7d..821975ef0 100644 --- a/module/plugins/accounts/CloudzillaTo.py +++ b/module/plugins/accounts/CloudzillaTo.py @@ -8,7 +8,7 @@ from module.plugins.internal.Account import Account  class CloudzillaTo(Account):      __name__    = "CloudzillaTo"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.06"      __status__  = "testing"      __description__ = """Cloudzilla.to account plugin""" @@ -19,7 +19,7 @@ class CloudzillaTo(Account):      PREMIUM_PATTERN = r'<h2>account type</h2>\s*Premium Account' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://www.cloudzilla.to/")          premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -27,11 +27,11 @@ class CloudzillaTo(Account):          return {'validuntil': -1, 'trafficleft': -1, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://www.cloudzilla.to/",                           post={'lusername': user,                                 'lpassword': password,                                 'w'        : "dologin"})          if "ERROR" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py index d3f2e0d77..084aa79a6 100644 --- a/module/plugins/accounts/CramitIn.py +++ b/module/plugins/accounts/CramitIn.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class CramitIn(XFSAccount):      __name__    = "CramitIn"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.05"      __status__  = "testing"      __description__ = """Cramit.in account plugin""" @@ -14,4 +14,4 @@ class CramitIn(XFSAccount):      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_DOMAIN = "cramit.in" +    PLUGIN_DOMAIN = "cramit.in" diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index e9a34cb83..209a94f60 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class CzshareCom(Account):      __name__    = "CzshareCom"      __type__    = "account" -    __version__ = "0.20" +    __version__ = "0.23"      __status__  = "testing"      __description__ = """Czshare.com account plugin, now Sdilej.cz""" @@ -21,7 +21,7 @@ class CzshareCom(Account):      CREDIT_LEFT_PATTERN = r'<tr class="active">\s*<td>([\d ,]+) (KiB|MiB|GiB)</td>\s*<td>([^<]*)</td>\s*</tr>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          premium     = False          validuntil  = None          trafficleft = None @@ -30,7 +30,7 @@ class CzshareCom(Account):          try:              m = re.search(self.CREDIT_LEFT_PATTERN, html) -            trafficleft = self.parse_traffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2) +            trafficleft = self.parse_traffic(m.group(1), m.group(2)              validuntil  = time.mktime(time.strptime(m.group(3), '%d.%m.%y %H:%M'))          except Exception, e: @@ -44,11 +44,11 @@ class CzshareCom(Account):                  'trafficleft': trafficleft} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load('https://sdilej.cz/index.php',                           post={'Prihlasit'     : "Prihlasit",                                 "login-password": password,                                 "login-name"    : user})          if '<div class="login' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 9c0956668..50d849a98 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -9,9 +9,13 @@ from module.plugins.internal.Account import Account  class DebridItaliaCom(Account):      __name__    = "DebridItaliaCom"      __type__    = "account" -    __version__ = "0.15" +    __version__ = "0.17"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Debriditalia.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("stickell", "l.stickell@yahoo.it"), @@ -21,13 +25,17 @@ class DebridItaliaCom(Account):      WALID_UNTIL_PATTERN = r'Premium valid till: (.+?) \|' -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        return self.load("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') + + +    def grab_info(self, user, password, data):          info = {'premium': False, 'validuntil': None, 'trafficleft': None}          html = self.load("http://debriditalia.com/")          if 'Account premium not activated' not in html:              m = re.search(self.WALID_UNTIL_PATTERN, html) -            if m: +            if m is not None:                  validuntil = time.mktime(time.strptime(m.group(1), "%d/%m/%Y %H:%M"))                  info = {'premium': True, 'validuntil': validuntil, 'trafficleft': -1}              else: @@ -36,10 +44,10 @@ class DebridItaliaCom(Account):          return info -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://debriditalia.com/login.php",                           get={'u': user,                                'p': password})          if 'NO' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 848529bc3..35df3f939 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class DepositfilesCom(Account):      __name__    = "DepositfilesCom"      __type__    = "account" -    __version__ = "0.34" +    __version__ = "0.36"      __status__  = "testing"      __description__ = """Depositfiles.com account plugin""" @@ -19,7 +19,7 @@ class DepositfilesCom(Account):                         ("Walter Purcaro", "vuolter@gmail.com")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("https://dfiles.eu/de/gold/")          validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", html).group(1) @@ -28,11 +28,11 @@ class DepositfilesCom(Account):          return {'validuntil': validuntil, 'trafficleft': -1} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://dfiles.eu/de/login.php",                           get={'return': "/de/gold/payment.php"},                           post={'login'   : user,                                 'password': password})          if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index 5e1a4f962..9340f49e6 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -8,13 +8,23 @@ from module.plugins.internal.XFSAccount import XFSAccount  class EasybytezCom(XFSAccount):      __name__    = "EasybytezCom"      __type__    = "account" -    __version__ = "0.13" +    __version__ = "0.14"      __status__  = "testing" +    __config__ = [("mh_activated", "bool"               , "Use multihoster feature"      , True ), +                  ("mh_mode"     , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"     , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval" , "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """EasyBytez.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("zoidberg", "zoidberg@mujmail.cz"),                         ("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_DOMAIN = "easybytez.com" +    PLUGIN_DOMAIN = "easybytez.com" + + +    def grab_hosters(self, user, password, data): +        return re.search(r'</textarea>\s*Supported sites:(.*)', +                         self.load("http://www.easybytez.com")).group(1).split(',') diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index bc8618250..09f08dc01 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class EuroshareEu(Account):      __name__    = "EuroshareEu"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.06"      __status__  = "testing"      __description__ = """Euroshare.eu account plugin""" @@ -17,7 +17,7 @@ class EuroshareEu(Account):      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          self.relogin(user)          html = self.load("http://euroshare.eu/customer-zone/settings/") @@ -32,11 +32,11 @@ class EuroshareEu(Account):          return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load('http://euroshare.eu/customer-zone/login/',                           post={'trvale'  : "1",                                 'login'   : user,                                 'password': password})          if u">Nesprávne prihlasovacie meno alebo heslo" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/ExashareCom.py b/module/plugins/accounts/ExashareCom.py index 26594c702..6b352e40e 100644 --- a/module/plugins/accounts/ExashareCom.py +++ b/module/plugins/accounts/ExashareCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class ExashareCom(XFSAccount):      __name__    = "ExashareCom"      __type__    = "account" -    __version__ = "0.02" +    __version__ = "0.03"      __status__  = "testing"      __description__ = """Exashare.com account plugin""" @@ -14,4 +14,4 @@ class ExashareCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "exashare.com" +    PLUGIN_DOMAIN = "exashare.com" diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 13edbbb44..83a02d76b 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -7,18 +7,30 @@ from module.common.json_layer import json_loads  class FastixRu(Account):      __name__    = "FastixRu"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.08"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Fastix account plugin"""      __license__     = "GPLv3"      __authors__     = [("Massimo Rosamilia", "max@spiritix.eu")] -    def parse_info(self, user, password, data, req): -        data = self.get_data(user) +    def grab_hosters(self, user, password, data): +        html = self.load("http://fastix.ru/api_v2", +                      get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", +                           'sub'   : "allowed_sources"}) +        host_list = json_loads(html) +        host_list = host_list['allow'] +        return host_list + + +    def grab_info(self, user, password, data):          html = json_loads(self.load("http://fastix.ru/api_v2/", -                                    get={'apikey': data['api'], +                                    get={'apikey': data['apikey'],                                           'sub'   : "getaccountdetails"}))          points = html['points'] @@ -31,16 +43,14 @@ class FastixRu(Account):          return account_info -    def login(self, user, password, data, req): -        html = self.load("https://fastix.ru/api_v2/", -                         get={'sub'     : "get_apikey", -                              'email'   : user, -                              'password': password}) +    def signin(self, user, password, data): +        api = json_loads(self.load("https://fastix.ru/api_v2/", +                                   get={'sub'     : "get_apikey", +                                        'email'   : user, +                                        'password': password})) -        api = json_loads(html) -        api = api['apikey'] +        if 'error' in api: +            self.fail_login(api['error_txt']) -        data['api'] = api - -        if "error_code" in html: -            self.login_fail() +        else: +            data['apikey'] = api['apikey'] diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index 3a3769a1c..68c65bd3f 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.Plugin import set_cookie  class FastshareCz(Account):      __name__    = "FastshareCz"      __type__    = "account" -    __version__ = "0.09" +    __version__ = "0.11"      __status__  = "testing"      __description__ = """Fastshare.cz account plugin""" @@ -21,7 +21,7 @@ class FastshareCz(Account):      CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = -1          trafficleft = None          premium     = False @@ -29,7 +29,7 @@ class FastshareCz(Account):          html = self.load("http://www.fastshare.cz/user")          m = re.search(self.CREDIT_PATTERN, html) -        if m: +        if m is not None:              trafficleft = self.parse_traffic(m.group(1))          premium = bool(trafficleft) @@ -39,8 +39,8 @@ class FastshareCz(Account):                  'premium'    : premium} -    def login(self, user, password, data, req): -        set_cookie(req.cj, "fastshare.cz", "lang", "en") +    def signin(self, user, password, data): +        set_cookie(self.req.cj, "fastshare.cz", "lang", "en")          self.load('http://www.fastshare.cz/login')  #@NOTE: Do not remove or it will not login @@ -49,4 +49,4 @@ class FastshareCz(Account):                                 'heslo': password})          if ">Wrong username or password" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/File4SafeCom.py b/module/plugins/accounts/File4SafeCom.py index 54c3a2359..8e5f437b3 100644 --- a/module/plugins/accounts/File4SafeCom.py +++ b/module/plugins/accounts/File4SafeCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class File4SafeCom(XFSAccount):      __name__    = "File4SafeCom"      __type__    = "account" -    __version__ = "0.06" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """File4Safe.com account plugin""" @@ -14,6 +14,6 @@ class File4SafeCom(XFSAccount):      __authors__     = [("stickell", "l.stickell@yahoo.it")] -    HOSTER_DOMAIN = "file4safe.com" +    PLUGIN_DOMAIN = "file4safe.com"      LOGIN_FAIL_PATTERN = r'input_login' diff --git a/module/plugins/accounts/FileParadoxIn.py b/module/plugins/accounts/FileParadoxIn.py index 21f43be6e..86183f4d3 100644 --- a/module/plugins/accounts/FileParadoxIn.py +++ b/module/plugins/accounts/FileParadoxIn.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class FileParadoxIn(XFSAccount):      __name__    = "FileParadoxIn"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """FileParadox.in account plugin""" @@ -14,4 +14,4 @@ class FileParadoxIn(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "fileparadox.in" +    PLUGIN_DOMAIN = "fileparadox.in" diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index bdb13bd3d..d80a8b9d6 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -8,7 +8,7 @@ from module.plugins.internal.Plugin import set_cookie  class FilecloudIo(Account):      __name__    = "FilecloudIo"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.09"      __status__  = "testing"      __description__ = """FilecloudIo account plugin""" @@ -17,7 +17,7 @@ class FilecloudIo(Account):                         ("stickell", "l.stickell@yahoo.it")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          #: 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 = self.load("https://secure.filecloud.io/api-fetch_apikey.api", @@ -43,8 +43,8 @@ class FilecloudIo(Account):              return {'premium': False} -    def login(self, user, password, data, req): -        set_cookie(req.cj, "secure.filecloud.io", "lang", "en") +    def signin(self, user, password, data): +        set_cookie(self.req.cj, "secure.filecloud.io", "lang", "en")          html = self.load('https://secure.filecloud.io/user-login.html')          if not hasattr(self, "form_data"): @@ -57,4 +57,4 @@ class FilecloudIo(Account):                           post=self.form_data)          if "you have successfully logged in" not in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index e3d0c8491..0f8f709c6 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account  class FilefactoryCom(Account):      __name__    = "FilefactoryCom"      __type__    = "account" -    __version__ = "0.17" +    __version__ = "0.19"      __status__  = "testing"      __description__ = """Filefactory.com account plugin""" @@ -22,11 +22,11 @@ class FilefactoryCom(Account):      VALID_UNTIL_PATTERN = r'Premium valid until: <strong>(?P<D>\d{1,2})\w{1,2} (?P<M>\w{3}), (?P<Y>\d{4})</strong>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://www.filefactory.com/account/")          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              premium = True              validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<D> \g<M> \g<Y>', m.group(0))              validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y")) @@ -37,13 +37,13 @@ class FilefactoryCom(Account):          return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} -    def login(self, user, password, data, req): -        req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php") +    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",                           post={'loginEmail'   : user,                                 'loginPassword': password,                                 'Submit'       : "Sign In"}) -        if req.lastEffectiveURL != "http://www.filefactory.com/account/": -            self.login_fail() +        if self.req.lastEffectiveURL != "http://www.filefactory.com/account/": +            self.fail_login() diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index fb251ac5f..230aa9939 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account  class FilejungleCom(Account):      __name__    = "FilejungleCom"      __type__    = "account" -    __version__ = "0.14" +    __version__ = "0.16"      __status__  = "testing"      __description__ = """Filejungle.com account plugin""" @@ -25,10 +25,10 @@ class FilejungleCom(Account):      LOGIN_FAILED_PATTERN = r'<span htmlfor="loginUser(Name|Password)" generated="true" class="fail_info">' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load(self.URL + "dashboard.php")          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        if m: +        if m is not None:              premium = True              validuntil = time.mktime(time.strptime(m.group(1), "%d %b %Y"))          else: @@ -38,7 +38,7 @@ class FilejungleCom(Account):          return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load(urlparse.urljoin(self.URL, "login.php"),                           post={'loginUserName'              : user,                                 'loginUserPassword'          : password, @@ -48,4 +48,4 @@ class FilejungleCom(Account):                                 'recaptcha_shortencode_field': ""})          if re.search(self.LOGIN_FAILED_PATTERN, html): -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/FileomCom.py b/module/plugins/accounts/FileomCom.py index 957f4ef05..0bd0b60cf 100644 --- a/module/plugins/accounts/FileomCom.py +++ b/module/plugins/accounts/FileomCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class FileomCom(XFSAccount):      __name__    = "FileomCom"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Fileom.com account plugin""" @@ -14,4 +14,4 @@ class FileomCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "fileom.com" +    PLUGIN_DOMAIN = "fileom.com" diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 674c7a5dd..96bdebd81 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class FilerNet(Account):      __name__    = "FilerNet"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.09"      __status__  = "testing"      __description__ = """Filer.net account plugin""" @@ -23,7 +23,7 @@ class FilerNet(Account):      FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("https://filer.net/profile")          #: Free user @@ -43,7 +43,7 @@ class FilerNet(Account):              return {'premium': False, 'validuntil': None, 'trafficleft': None} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://filer.net/login")          token = re.search(self.TOKEN_PATTERN, html).group(1) @@ -56,4 +56,4 @@ class FilerNet(Account):                                 '_target_path': "https://filer.net/"})          if 'Logout' not in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/FilerioCom.py b/module/plugins/accounts/FilerioCom.py index 8a4750036..d843dd605 100644 --- a/module/plugins/accounts/FilerioCom.py +++ b/module/plugins/accounts/FilerioCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class FilerioCom(XFSAccount):      __name__    = "FilerioCom"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.05"      __status__  = "testing"      __description__ = """FileRio.in account plugin""" @@ -14,4 +14,4 @@ class FilerioCom(XFSAccount):      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_DOMAIN = "filerio.in" +    PLUGIN_DOMAIN = "filerio.in" diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 7ed09e731..551a7b8e5 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account  class FilesMailRu(Account):      __name__    = "FilesMailRu"      __type__    = "account" -    __version__ = "0.13" +    __version__ = "0.15"      __status__  = "testing"      __description__ = """Filesmail.ru account plugin""" @@ -14,11 +14,11 @@ class FilesMailRu(Account):      __authors__     = [("RaNaN", "RaNaN@pyload.org")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          return {'validuntil': None, 'trafficleft': None} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          user, domain = user.split("@")          html = self.load("https://swa.mail.ru/cgi-bin/auth", @@ -28,4 +28,4 @@ class FilesMailRu(Account):                                 'Page'    : "http://files.mail.ru/"})          if "ÐевеÑМПе ÐžÐŒÑ Ð¿ÐŸÐ»ÑзПваÑÐµÐ»Ñ ÐžÐ»Ðž паÑПлÑ" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index dabfc1932..bc56d4b96 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads  class FileserveCom(Account):      __name__    = "FileserveCom"      __type__    = "account" -    __version__ = "0.22" +    __version__ = "0.24"      __status__  = "testing"      __description__ = """Fileserve.com account plugin""" @@ -17,9 +17,7 @@ class FileserveCom(Account):      __authors__     = [("mkaay", "mkaay@mkaay.de")] -    def parse_info(self, user, password, data, req): -        data = self.get_data(user) - +    def grab_info(self, user, password, data):          html = self.load("http://app.fileserve.com/api/login/",                           post={'username': user,                                 'password': password, @@ -33,7 +31,7 @@ class FileserveCom(Account):              return {'premium': False, 'trafficleft': None, 'validuntil': None} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("http://app.fileserve.com/api/login/",                           post={'username': user,                                 'password': password, @@ -41,7 +39,7 @@ class FileserveCom(Account):          res = json_loads(html)          if not res['type']: -            self.login_fail() +            self.fail_login()          #: Login at fileserv html          self.load("http://www.fileserve.com/login.php", diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py index a7ec8e2c5..05e75f326 100644 --- a/module/plugins/accounts/FourSharedCom.py +++ b/module/plugins/accounts/FourSharedCom.py @@ -7,7 +7,7 @@ from module.plugins.internal.Plugin import set_cookie  class FourSharedCom(Account):      __name__    = "FourSharedCom"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.09"      __status__  = "testing"      __description__ = """FourShared.com account plugin""" @@ -16,13 +16,13 @@ class FourSharedCom(Account):                         ("stickell", "l.stickell@yahoo.it")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          #: Free mode only for now          return {'premium': False} -    def login(self, user, password, data, req): -        set_cookie(req.cj, "4shared.com", "4langcookie", "en") +    def signin(self, user, password, data): +        set_cookie(self.req.cj, "4shared.com", "4langcookie", "en")          res = self.load("https://www.4shared.com/web/login",                          post={'login'    : user, @@ -32,4 +32,4 @@ class FourSharedCom(Account):                                'returnTo' : "http://www.4shared.com/account/home.jsp"})          if 'Please log in to access your 4shared account' in res: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index a2f66f3b3..a319096db 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class FreakshareCom(Account):      __name__    = "FreakshareCom"      __type__    = "account" -    __version__ = "0.15" +    __version__ = "0.17"      __status__  = "testing"      __description__ = """Freakshare.com account plugin""" @@ -17,7 +17,7 @@ class FreakshareCom(Account):      __authors__     = [("RaNaN", "RaNaN@pyload.org")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          premium = False          validuntil  = None          trafficleft = None @@ -26,7 +26,7 @@ class FreakshareCom(Account):          try:              m = re.search(r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>', html, re.M) -            validuntil = time.mktime(time.strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) +            validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M"))          except Exception:              pass @@ -41,7 +41,7 @@ class FreakshareCom(Account):          return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          self.load("http://freakshare.com/index.php?language=EN")          html = self.load("https://freakshare.com/login.html", @@ -50,4 +50,4 @@ class FreakshareCom(Account):                                 'pass'  : password})          if ">Wrong Username or Password" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 0c315873f..5e214db35 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -7,22 +7,32 @@ from module.common.json_layer import json_loads  class FreeWayMe(Account):      __name__    = "FreeWayMe"      __type__    = "account" -    __version__ = "0.16" +    __version__ = "0.19"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """FreeWayMe account plugin"""      __license__     = "GPLv3"      __authors__     = [("Nicolas Giese", "james@free-way.me")] -    def parse_info(self, user, password, data, req): -        status = self.get_account_status(user, password, req) +    def grab_hosters(self, user, password, data): +        html = self.load("http://www.free-way.bz/ajax/jd.php", +                         get={'id'  : 3, 'user': user, 'pass': password})  #@TODO: Revert to `https` in 0.4.10 +        return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] + + +    def grab_info(self, user, password, data): +        status = self.get_account_status(user, password)          self.log_debug(status)          account_info = {'validuntil': -1, 'premium': False}          if status['premium'] == "Free": -            account_info['trafficleft'] = self.parse_traffic(status['guthaben'] + "MB") +            account_info['trafficleft'] = self.parse_traffic(status['guthaben'], "MB")          elif status['premium'] == "Spender":              account_info['trafficleft'] = -1          elif status['premium'] == "Flatrate": @@ -33,21 +43,21 @@ class FreeWayMe(Account):          return account_info -    def login(self, user, password, data, req): -        status = self.get_account_status(user, password, req) +    def signin(self, user, password, data): +        status = self.get_account_status(user, password)          #: Check if user and password are valid          if not status: -            self.login_fail() +            self.fail_login() -    def get_account_status(self, user, password, req): +    def get_account_status(self, user, password):          answer = self.load("http://www.free-way.bz/ajax/jd.php",  #@TODO: Revert to `https` in 0.4.10                            get={'id': 4, 'user': user, 'pass': password})          self.log_debug("Login: %s" % answer)          if answer == "Invalid login": -            self.login_fail() +            self.fail_login()          return json_loads(answer) diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index bc8ced5e2..e692394ef 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class FshareVn(Account):      __name__    = "FshareVn"      __type__    = "account" -    __version__ = "0.11" +    __version__ = "0.14"      __status__  = "testing"      __description__ = """Fshare.vn account plugin""" @@ -24,7 +24,7 @@ class FshareVn(Account):      DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>KÃch hoạt download trá»±c tiếp</dt>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://www.fshare.vn/account_info.php")          if re.search(self.LIFETIME_PATTERN, html): @@ -33,7 +33,7 @@ class FshareVn(Account):              return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': True}          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              premium = True              validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y'))              trafficleft = self.get_traffic_left() @@ -45,7 +45,7 @@ class FshareVn(Account):          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://www.fshare.vn/login.php",                           post={'LoginForm[email]'     : user,                                 'LoginForm[password]'  : password, @@ -53,9 +53,9 @@ class FshareVn(Account):                                 'yt0'                  : "Login"})          if not re.search(r'<img\s+alt="VIP"', html): -            self.login_fail() +            self.fail_login()      def get_traffic_left(self):          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        return self.parse_traffic(m.group(1) + m.group(2)) if m else 0 +        return self.parse_traffic(m.group(1), m.group(2)) if m else 0 diff --git a/module/plugins/accounts/Ftp.py b/module/plugins/accounts/Ftp.py index 2d35ab7bb..d73b557ef 100644 --- a/module/plugins/accounts/Ftp.py +++ b/module/plugins/accounts/Ftp.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account  class Ftp(Account):      __name__    = "Ftp"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Ftp dummy account plugin""" diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index 55daa8c2d..cdfa9937a 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class HellshareCz(Account):      __name__    = "HellshareCz"      __type__    = "account" -    __version__ = "0.18" +    __version__ = "0.21"      __status__  = "testing"      __description__ = """Hellshare.cz account plugin""" @@ -20,7 +20,7 @@ class HellshareCz(Account):      CREDIT_LEFT_PATTERN = r'<div class="credit-link">\s*<table>\s*<tr>\s*<th>(\d+|\d\d\.\d\d\.)</th>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          self.relogin(user)          html = self.load("http://www.hellshare.com/") @@ -42,8 +42,9 @@ class HellshareCz(Account):                      trafficleft = -1                  else:                      #: Traffic-based account -                    trafficleft = self.parse_traffic(credit + "MB") +                    trafficleft = self.parse_traffic(credit, "MB")                      validuntil = -1 +              except Exception, e:                  self.log_error(_("Unable to parse credit info"), e)                  validuntil = -1 @@ -52,13 +53,13 @@ class HellshareCz(Account):          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load('http://www.hellshare.com/') -        if req.lastEffectiveURL != 'http://www.hellshare.com/': +        if self.req.lastEffectiveURL != 'http://www.hellshare.com/':              #: Switch to English -            self.log_debug("Switch lang - URL: %s" % req.lastEffectiveURL) +            self.log_debug("Switch lang - URL: %s" % self.req.lastEffectiveURL) -            json = self.load("%s?do=locRouter-show" % req.lastEffectiveURL) +            json = self.load("%s?do=locRouter-show" % self.req.lastEffectiveURL)              hash = re.search(r"(\-\-[0-9a-f]+\-)", json).group(1)              self.log_debug("Switch lang - HASH: %s" % hash) @@ -77,4 +78,4 @@ class HellshareCz(Account):                                 'perm_login': "on"})          if "<p>You input a wrong user name or wrong password</p>" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/HighWayMe.py b/module/plugins/accounts/HighWayMe.py index ff90ec2d2..3b39b7da6 100644 --- a/module/plugins/accounts/HighWayMe.py +++ b/module/plugins/accounts/HighWayMe.py @@ -7,15 +7,25 @@ from module.plugins.internal.Account import Account  class HighWayMe(Account):      __name__    = "HighWayMe.py"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.06"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """High-Way.me account plugin"""      __license__     = "GPLv3"      __authors__     = [("EvolutionClip", "evolutionclip@live.de")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        json_data = json_loads(self.load("https://high-way.me/api.php", +                                           get={'hoster': 1})) +        return [element['name'] for element in json_data['hoster']] + + +    def grab_info(self, user, password, data):          premium     = False          validuntil  = -1          trafficleft = None @@ -40,11 +50,11 @@ class HighWayMe(Account):                  'trafficleft': trafficleft} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://high-way.me/api.php?login",                           post={'login': '1',                                 'user': user,                                 'pass': password})          if 'UserOrPassInvalid' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/Http.py b/module/plugins/accounts/Http.py index dcab156ee..261b3b240 100644 --- a/module/plugins/accounts/Http.py +++ b/module/plugins/accounts/Http.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account  class Http(Account):      __name__    = "Http"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Http dummy account plugin""" diff --git a/module/plugins/accounts/HugefilesNet.py b/module/plugins/accounts/HugefilesNet.py index fa64945a3..a5920f4a4 100644 --- a/module/plugins/accounts/HugefilesNet.py +++ b/module/plugins/accounts/HugefilesNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class HugefilesNet(XFSAccount):      __name__    = "HugefilesNet"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Hugefiles.net account plugin""" @@ -14,4 +14,4 @@ class HugefilesNet(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "hugefiles.net" +    PLUGIN_DOMAIN = "hugefiles.net" diff --git a/module/plugins/accounts/HundredEightyUploadCom.py b/module/plugins/accounts/HundredEightyUploadCom.py index a8527d62c..8b757de61 100644 --- a/module/plugins/accounts/HundredEightyUploadCom.py +++ b/module/plugins/accounts/HundredEightyUploadCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class HundredEightyUploadCom(XFSAccount):      __name__    = "HundredEightyUploadCom"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.05"      __status__  = "testing"      __description__ = """180upload.com account plugin""" @@ -14,4 +14,4 @@ class HundredEightyUploadCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "180upload.com" +    PLUGIN_DOMAIN = "180upload.com" diff --git a/module/plugins/accounts/JunkyvideoCom.py b/module/plugins/accounts/JunkyvideoCom.py index 5fcefda36..316332fd9 100644 --- a/module/plugins/accounts/JunkyvideoCom.py +++ b/module/plugins/accounts/JunkyvideoCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class JunkyvideoCom(XFSAccount):      __name__    = "JunkyvideoCom"      __type__    = "account" -    __version__ = "0.02" +    __version__ = "0.03"      __status__  = "testing"      __description__ = """Junkyvideo.com account plugin""" @@ -14,4 +14,4 @@ class JunkyvideoCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "junkyvideo.com" +    PLUGIN_DOMAIN = "junkyvideo.com" diff --git a/module/plugins/accounts/JunocloudMe.py b/module/plugins/accounts/JunocloudMe.py index 791835dfe..95bc57640 100644 --- a/module/plugins/accounts/JunocloudMe.py +++ b/module/plugins/accounts/JunocloudMe.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class JunocloudMe(XFSAccount):      __name__    = "JunocloudMe"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Junocloud.me account plugin""" @@ -14,4 +14,4 @@ class JunocloudMe(XFSAccount):      __authors__     = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_DOMAIN = "junocloud.me" +    PLUGIN_DOMAIN = "junocloud.me" diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 014d43a69..32bccc2e4 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -10,7 +10,7 @@ from module.plugins.internal.Plugin import set_cookie  class Keep2ShareCc(Account):      __name__    = "Keep2ShareCc"      __type__    = "account" -    __version__ = "0.08" +    __version__ = "0.10"      __status__  = "testing"      __description__ = """Keep2Share.cc account plugin""" @@ -25,7 +25,7 @@ class Keep2ShareCc(Account):      LOGIN_FAIL_PATTERN = r'Please fix the following input errors' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = -1          premium     = False @@ -33,7 +33,7 @@ class Keep2ShareCc(Account):          html = self.load("http://keep2share.cc/site/profile.html")          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              expiredate = m.group(1).strip()              self.log_debug("Expire date: " + expiredate) @@ -51,7 +51,7 @@ class Keep2ShareCc(Account):                      premium = True if validuntil > time.mktime(time.gmtime()) else False              m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -            if m: +            if m is not None:                  try:                      trafficleft = self.parse_traffic(m.group(1)) @@ -61,8 +61,8 @@ class Keep2ShareCc(Account):          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): -        set_cookie(req.cj, "keep2share.cc", "lang", "en") +    def signin(self, user, password, data): +        set_cookie(self.req.cj, "keep2share.cc", "lang", "en")          html = self.load("https://keep2share.cc/login.html",                           post={'LoginForm[username]'  : user, @@ -71,4 +71,4 @@ class Keep2ShareCc(Account):                                 'yt0'                  : ""})          if re.search(self.LOGIN_FAIL_PATTERN, html): -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index 1fc9b76ba..f7350e547 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -7,7 +7,7 @@ from module.plugins.internal.Account import Account  class LetitbitNet(Account):      __name__    = "LetitbitNet"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.06"      __status__  = "testing"      __description__ = """Letitbit.net account plugin""" @@ -15,7 +15,7 @@ class LetitbitNet(Account):      __authors__     = [("stickell", "l.stickell@yahoo.it")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          ## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ##          # json_data = [password, ['key/info']]          # api_rep   = self.load("http://api.letitbit.net/json", @@ -30,6 +30,6 @@ class LetitbitNet(Account):          return {'premium': True} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          #: API_KEY is the username and the PREMIUM_KEY is the password          self.log_info(_("You must use your API KEY as username and the PREMIUM KEY as password")) diff --git a/module/plugins/accounts/LinestorageCom.py b/module/plugins/accounts/LinestorageCom.py deleted file mode 100644 index 87dd2a1d3..000000000 --- a/module/plugins/accounts/LinestorageCom.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSAccount import XFSAccount - - -class LinestorageCom(XFSAccount): -    __name__    = "LinestorageCom" -    __type__    = "account" -    __version__ = "0.04" -    __status__  = "testing" - -    __description__ = """Linestorage.com account plugin""" -    __license__     = "GPLv3" -    __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] - - -    HOSTER_DOMAIN = "linestorage.com" -    HOSTER_URL    = "http://linestorage.com/" diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 00ae64b44..6953f311c 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -9,16 +9,26 @@ from module.common.json_layer import json_loads  class LinksnappyCom(Account):      __name__    = "LinksnappyCom"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.10"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Linksnappy.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("stickell", "l.stickell@yahoo.it")] -    def parse_info(self, user, password, data, req): -        data = self.get_data(user) +    def grab_hosters(self, user, password, data): +        json_data = self.load("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) +        json_data = json_loads(json_data) + +        return json_data['return'].keys() + + +    def grab_info(self, user, password, data):          r = self.load('http://gen.linksnappy.com/lseAPI.php',                        get={'act'     : 'USERDETAILS',                             'username': user, @@ -45,18 +55,18 @@ class LinksnappyCom(Account):          if 'trafficleft' not in j['return'] or isinstance(j['return']['trafficleft'], str):              trafficleft = -1          else: -            trafficleft = self.parse_traffic("%d MB" % j['return']['trafficleft']) +            trafficleft = self.parse_traffic(j['return']['trafficleft'], "MB")          return {'premium'    : True       ,                  'validuntil' : validuntil ,                  'trafficleft': trafficleft} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://gen.linksnappy.com/lseAPI.php",                           get={'act'     : 'USERDETAILS',                                'username': user,                                'password': hashlib.md5(password).hexdigest()})          if "Invalid Account Details" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index d7a04491d..46375716f 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -7,9 +7,13 @@ from module.common.json_layer import json_loads  class MegaDebridEu(Account):      __name__    = "MegaDebridEu"      __type__    = "account" -    __version__ = "0.22" +    __version__ = "0.24"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Mega-debrid.eu account plugin"""      __license__     = "GPLv3"      __authors__     = [("D.Ducatel", "dducatel@je-geek.fr")] @@ -19,8 +23,20 @@ class MegaDebridEu(Account):      API_URL = "https://www.mega-debrid.eu/api.php" -    def parse_info(self, user, password, data, req): -        data = self.get_data(user) +    def grab_hosters(self, user, password, data): +        reponse   = self.load("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) +        json_data = json_loads(reponse) + +        if json_data['response_code'] == "ok": +            host_list = [element[0] for element in json_data['hosters']] +        else: +            self.log_error(_("Unable to retrieve hoster list")) +            host_list = [] + +        return host_list + + +    def grab_info(self, user, password, data):          jsonResponse = self.load(self.API_URL,                                   get={'action'  : 'connectUser',                                        'login'   : user, @@ -34,11 +50,11 @@ class MegaDebridEu(Account):              return {'status': False, 'premium': False} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          jsonResponse = self.load(self.API_URL,                                   get={'action'  : 'connectUser',                                        'login'   : user,                                        'password': password})          res = json_loads(jsonResponse)          if res['response_code'] != "ok": -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index ce2d78994..050e3e4c6 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class MegaRapidCz(Account):      __name__    = "MegaRapidCz"      __type__    = "account" -    __version__ = "0.37" +    __version__ = "0.39"      __status__  = "testing"      __description__ = """MegaRapid.cz account plugin""" @@ -25,28 +25,27 @@ class MegaRapidCz(Account):      TRAFFIC_LEFT_PATTERN = r'<tr><td>Kredit</td><td>(.*?) GiB' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          htmll = self.load("http://megarapid.cz/mujucet/")          m = re.search(self.LIMITDL_PATTERN, htmll) -        if m: -            data = self.get_data(user) +        if m is not None:              data['options']['limitDL'] = [int(m.group(1))]          m = re.search(self.VALID_UNTIL_PATTERN, htmll) -        if m: +        if m is not None:              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) -        if m: +        if m is not None:              trafficleft = float(m.group(1)) * (1 << 20)              return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1}          return {'premium': False, 'trafficleft': None, 'validuntil': None} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("http://megarapid.cz/prihlaseni/")          if "Heslo:" in html: diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py index 08cf1f535..d8291e0e2 100644 --- a/module/plugins/accounts/MegaRapidoNet.py +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -9,9 +9,13 @@ from module.plugins.internal.Account import Account  class MegaRapidoNet(Account):      __name__    = "MegaRapidoNet"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.06"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """MegaRapido.net account plugin"""      __license__     = "GPLv3"      __authors__     = [("Kagenoshin", "kagenoshin@gmx.ch")] @@ -21,7 +25,68 @@ class MegaRapidoNet(Account):      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 parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        hosters = {'1fichier'    : [],  # leave it there are so many possible addresses? +                   '1st-files'   : ['1st-files.com'], +                   '2shared'     : ['2shared.com'], +                   '4shared'     : ['4shared.com', '4shared-china.com'], +                   'asfile'      : ['http://asfile.com/'], +                   'bitshare'    : ['bitshare.com'], +                   'brupload'    : ['brupload.net'], +                   'crocko'      : ['crocko.com', 'easy-share.com'], +                   'dailymotion' : ['dailymotion.com'], +                   'depfile'     : ['depfile.com'], +                   'depositfiles': ['depositfiles.com', 'dfiles.eu'], +                   'dizzcloud'   : ['dizzcloud.com'], +                   'dl.dropbox'  : [], +                   'extabit'     : ['extabit.com'], +                   'extmatrix'   : ['extmatrix.com'], +                   'facebook'    : [], +                   'file4go'     : ['file4go.com'], +                   'filecloud'   : ['filecloud.io', 'ifile.it', 'mihd.net'], +                   'filefactory' : ['filefactory.com'], +                   'fileom'      : ['fileom.com'], +                   'fileparadox' : ['fileparadox.in'], +                   'filepost'    : ['filepost.com', 'fp.io'], +                   'filerio'     : ['filerio.in', 'filerio.com', 'filekeen.com'], +                   'filesflash'  : ['filesflash.com'], +                   'firedrive'   : ['firedrive.com', 'putlocker.com'], +                   'flashx'      : [], +                   'freakshare'  : ['freakshare.net', 'freakshare.com'], +                   'gigasize'    : ['gigasize.com'], +                   'hipfile'     : ['hipfile.com'], +                   'junocloud'   : ['junocloud.me'], +                   'letitbit'    : ['letitbit.net', 'shareflare.net'], +                   'mediafire'   : ['mediafire.com'], +                   'mega'        : ['mega.co.nz'], +                   'megashares'  : ['megashares.com'], +                   'metacafe'    : ['metacafe.com'], +                   'netload'     : ['netload.in'], +                   'oboom'       : ['oboom.com'], +                   'rapidgator'  : ['rapidgator.net'], +                   'rapidshare'  : ['rapidshare.com'], +                   'rarefile'    : ['rarefile.net'], +                   'ryushare'    : ['ryushare.com'], +                   'sendspace'   : ['sendspace.com'], +                   'turbobit'    : ['turbobit.net', 'unextfiles.com'], +                   'uploadable'  : ['uploadable.ch'], +                   'uploadbaz'   : ['uploadbaz.com'], +                   'uploaded'    : ['uploaded.to', 'uploaded.net', 'ul.to'], +                   'uploadhero'  : ['uploadhero.com'], +                   'uploading'   : ['uploading.com'], +                   'uptobox'     : ['uptobox.com'], +                   'xvideos'     : ['xvideos.com'], +                   'youtube'     : ['youtube.com']} + +        hoster_list = [] + +        for item in hosters.values(): +            hoster_list.extend(item) + +        return hoster_list + + +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = None          premium     = False @@ -40,7 +105,7 @@ class MegaRapidoNet(Account):                  'premium'    : premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          self.load("http://megarapido.net/login")          self.load("http://megarapido.net/painel_user/ajax/logar.php",                    post={'login': user, @@ -49,10 +114,10 @@ class MegaRapidoNet(Account):          html = self.load("http://megarapido.net/gerador")          if "sair" not in html.lower(): -            self.login_fail() +            self.fail_login()          else:              m = re.search(self.USER_ID_PATTERN, html) -            if m: +            if m is not None:                  data['uid'] = m.group(1)              else: -                self.login_fail("Couldn't find the user ID") +                self.fail_login("Couldn't find the user ID") diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index ec43b7fc0..6967a7502 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class MegasharesCom(Account):      __name__    = "MegasharesCom"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """Megashares.com account plugin""" @@ -20,7 +20,7 @@ class MegasharesCom(Account):      VALID_UNTIL_PATTERN = r'<p class="premium_info_box">Period Ends: (\w{3} \d{1,2}, \d{4})</p>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          # self.relogin(user)          html = self.load("http://d01.megashares.com/myms.php") @@ -31,13 +31,14 @@ class MegasharesCom(Account):              timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1)              self.log_debug(timestr)              validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y")) +          except Exception, e:              self.log_error(e)          return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load('http://d01.megashares.com/myms_login.php',                           post={'httpref'       : "",                                 'myms_login'    : "Login", @@ -45,4 +46,4 @@ class MegasharesCom(Account):                                 'mymspassword'  : password})          if not '<span class="b ml">%s</span>' % user in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py index 090950bf2..1594a2b6a 100644 --- a/module/plugins/accounts/MovReelCom.py +++ b/module/plugins/accounts/MovReelCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class MovReelCom(XFSAccount):      __name__    = "MovReelCom"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.05"      __status__  = "testing"      __description__ = """Movreel.com account plugin""" @@ -17,4 +17,4 @@ class MovReelCom(XFSAccount):      login_timeout = 60      info_threshold = 30 -    HOSTER_DOMAIN = "movreel.com" +    PLUGIN_DOMAIN = "movreel.com" diff --git a/module/plugins/accounts/MultihostersCom.py b/module/plugins/accounts/MultihostersCom.py index ed04ad3c2..1ede88574 100644 --- a/module/plugins/accounts/MultihostersCom.py +++ b/module/plugins/accounts/MultihostersCom.py @@ -6,7 +6,7 @@ from module.plugins.accounts.ZeveraCom import ZeveraCom  class MultihostersCom(ZeveraCom):      __name__    = "MultihostersCom"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.05"      __status__  = "testing"      __description__ = """Multihosters.com account plugin""" @@ -14,4 +14,4 @@ class MultihostersCom(ZeveraCom):      __authors__     = [("tjeh", "tjeh@gmx.net")] -    HOSTER_DOMAIN = "multihosters.com" +    PLUGIN_DOMAIN = "multihosters.com" diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index c9e30a93f..77facb308 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -8,9 +8,13 @@ from module.plugins.internal.Account import Account  class MultishareCz(Account):      __name__    = "MultishareCz"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.10"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Multishare.cz account plugin"""      __license__     = "GPLv3"      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] @@ -19,13 +23,20 @@ class MultishareCz(Account):      TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[\d.,]+) (?P<U>[\w^_]+)</strong>'      ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name=".+?" value="(.+?)">' +    PLUGIN_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="(.+?)"></td>\s*<td class="stav">[^>]*?alt="OK"' + + +    def grab_hosters(self, user, password, data): +        html = self.load("http://www.multishare.cz/monitoring/") +        return re.findall(self.PLUGIN_PATTERN, html) + -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          # self.relogin(user)          html = self.load("http://www.multishare.cz/profil/")          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        trafficleft = self.parse_traffic(m.group('S') + m.group('U')) if m else 0 +        trafficleft = self.parse_traffic(m.group('S'), m.group('U')) if m else 0          self.premium = True if trafficleft else False          html = self.load("http://www.multishare.cz/") @@ -34,11 +45,11 @@ class MultishareCz(Account):          return dict(mms_info, **{'validuntil': -1, 'trafficleft': trafficleft}) -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load('https://www.multishare.cz/html/prihlaseni_process.php',                           post={'akce' : "PÅihlásit",                                 'heslo': password,                                 'jmeno': user})          if '<div class="akce-chyba akce">' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 008b62cc6..eff112a2f 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -9,15 +9,26 @@ from module.plugins.internal.Account import Account  class MyfastfileCom(Account):      __name__    = "MyfastfileCom"      __type__    = "account" -    __version__ = "0.06" +    __version__ = "0.08"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Myfastfile.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("stickell", "l.stickell@yahoo.it")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        json_data = self.load("http://myfastfile.com/api.php", get={'hosts': ""}) +        self.log_debug("JSON data", json_data) +        json_data = json_loads(json_data) + +        return json_data['hosts'] + +    def grab_info(self, user, password, data):          if 'days_left' in self.json_data:              validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60              return {'premium': True, 'validuntil': validuntil, 'trafficleft': -1} @@ -25,7 +36,7 @@ class MyfastfileCom(Account):              self.log_error(_("Unable to get account information")) -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          #: Password to use is the API-Password written in http://myfastfile.com/myaccount          html = self.load("https://myfastfile.com/api.php",                           get={'user': user, @@ -35,5 +46,4 @@ class MyfastfileCom(Account):          self.json_data = json_loads(html)          if self.json_data['status'] != 'ok': -            self.log_error(_('Invalid login. The password to use is the API-Password you find in your "My Account" page')) -            self.login_fail() +            self.fail_login(_("Invalid username or password")) diff --git a/module/plugins/accounts/NitroflareCom.py b/module/plugins/accounts/NitroflareCom.py index b7edcca32..af71b1321 100644 --- a/module/plugins/accounts/NitroflareCom.py +++ b/module/plugins/accounts/NitroflareCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class NitroflareCom(Account):      __name__    = "NitroflareCom"      __type__    = "account" -    __version__ = "0.06" +    __version__ = "0.09"      __status__  = "testing"      __description__ = """Nitroflare.com account plugin""" @@ -24,7 +24,7 @@ class NitroflareCom(Account):      TOKEN_PATTERN = r'name="token" value="(.+?)"' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil   = -1          trafficleft  = None          premium      = False @@ -33,13 +33,14 @@ class NitroflareCom(Account):                           get={'s': "premium"})          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              expiredate = m.group(1).strip()              self.log_debug("Time Left: " + expiredate)              try:                  validuntil = sum(int(v) * {'day': 24 * 3600, 'hour': 3600, 'minute': 60}[u.lower()] for v, u in                                   re.findall(r'(\d+)\s*(day|hour|minute)', expiredate, re.I)) +              except Exception, e:                  self.log_error(e) @@ -53,9 +54,9 @@ class NitroflareCom(Account):                      validuntil = -1          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        if m: +        if m is not None:              try: -                trafficleft = self.parse_traffic(str(max(0, 50 - float(m.group(1)))) + " GB") +                trafficleft = self.parse_traffic(str(max(0, 50 - float(m.group(1)))),  "GB")              except Exception, e:                  self.log_error(e) @@ -67,7 +68,7 @@ class NitroflareCom(Account):                  'premium'    : premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://nitroflare.com/login")          token = re.search(self.TOKEN_PATTERN, html).group(1) @@ -79,4 +80,4 @@ class NitroflareCom(Account):                                 'token'   : token})          if re.search(self.LOGIN_FAIL_PATTERN, html): -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index e9dad7647..f8236c978 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -6,14 +6,19 @@ import time  from module.common.json_layer import json_loads  from module.plugins.internal.Account import Account +# from module.plugins.internal.MultiAccount import MultiAccount  class NoPremiumPl(Account):      __name__    = "NoPremiumPl"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.06"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = "NoPremium.pl account plugin"      __license__     = "GPLv3"      __authors__     = [("goddie", "dev@nopremium.pl")] @@ -27,15 +32,19 @@ class NoPremiumPl(Account):                   'loc'     : "1"        ,                   'info'    : "1"        } -    _req = None -    _usr = None -    _pwd = None +    def grab_hosters(self, user, password, data): +        hostings         = json_loads(self.load("https://www.nopremium.pl/clipboard.php?json=3").strip()) +        hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"] + +        self.log_debug(hostings_domains) + +        return hostings_domains -    def parse_info(self, name, req): -        self._req = req +    def grab_info(self, user, password, data):          try:              result = json_loads(self.run_auth_query()) +          except Exception:              #@TODO: return or let it be thrown?              return @@ -54,27 +63,24 @@ class NoPremiumPl(Account):                  'premium'    : premium     } -    def login(self, user, password, data, req): -        self._usr = user -        self._pwd = hashlib.sha1(hashlib.md5(password).hexdigest()).hexdigest() -        self._req = req +    def signin(self, user, password, data): +        data['usr'] = user +        data['pwd'] = hashlib.sha1(hashlib.md5(password).hexdigest()).hexdigest()          try:              response = json_loads(self.run_auth_query()) +          except Exception: -            self.login_fail() +            self.fail_login()          if "errno" in response.keys(): -            self.login_fail() - -        data['usr'] = self._usr -        data['pwd'] = self._pwd +            self.fail_login()      def create_auth_query(self):          query = self.API_QUERY -        query['username'] = self._usr -        query['password'] = self._pwd +        query['username'] = self.info['data']['usr'] +        query['password'] = self.info['data']['pwd']          return query diff --git a/module/plugins/accounts/NosuploadCom.py b/module/plugins/accounts/NosuploadCom.py index 5febc8d66..65ac8d4fc 100644 --- a/module/plugins/accounts/NosuploadCom.py +++ b/module/plugins/accounts/NosuploadCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class NosuploadCom(XFSAccount):      __name__    = "NosuploadCom"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Nosupload.com account plugin""" @@ -14,4 +14,4 @@ class NosuploadCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "nosupload.com" +    PLUGIN_DOMAIN = "nosupload.com" diff --git a/module/plugins/accounts/NovafileCom.py b/module/plugins/accounts/NovafileCom.py index 524c01087..1506ec315 100644 --- a/module/plugins/accounts/NovafileCom.py +++ b/module/plugins/accounts/NovafileCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class NovafileCom(XFSAccount):      __name__    = "NovafileCom"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Novafile.com account plugin""" @@ -14,4 +14,4 @@ class NovafileCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "novafile.com" +    PLUGIN_DOMAIN = "novafile.com" diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 73bb383be..36d26930a 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class NowVideoSx(Account):      __name__    = "NowVideoSx"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """NowVideo.at account plugin""" @@ -20,7 +20,7 @@ class NowVideoSx(Account):      VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = -1          premium     = None @@ -28,7 +28,7 @@ class NowVideoSx(Account):          html = self.load("http://www.nowvideo.sx/premium.php")          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              expiredate = m.group(1).strip()              self.log_debug("Expire date: " + expiredate) @@ -48,10 +48,10 @@ class NowVideoSx(Account):          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("http://www.nowvideo.sx/login.php",                           post={'user': user,                                 'pass': password})          if re.search(r'>Log In<', html): -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 380368b70..c19396854 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -23,7 +23,7 @@ from module.plugins.internal.Account import Account  class OboomCom(Account):      __name__    = "OboomCom"      __type__    = "account" -    __version__ = "0.27" +    __version__ = "0.29"      __status__  = "testing"      __description__ = """Oboom.com account plugin""" @@ -31,31 +31,27 @@ class OboomCom(Account):      __authors__     = [("stanley", "stanley.foerster@gmail.com")] -    def load_account_data(self, user, req): -        passwd = self.get_info(user)['login']['password'] -        salt   = passwd[::-1] -        pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) +    def load_account_data(self, user, password): +        salt   = password[::-1] +        pbkdf2 = PBKDF2(password, salt, 1000).hexread(16)          result = json_loads(self.load("http://www.oboom.com/1/login",  #@TODO: Revert to `https` in 0.4.10                                        get={'auth': user,                                             'pass': pbkdf2})) -        if not result[0] == 200: +        if result[0] != 200:              self.log_warning(_("Failed to log in: %s") % result[1]) -            self.login_fail() +            self.fail_login()          return result[1] -    def parse_info(self, name, req): -        account_data = self.load_account_data(name, req) +    def grab_info(self, user, password, data): +        account_data = self.load_account_data(user, password)          userData = account_data['user'] -        if userData['premium'] == "null": -            premium = False -        else: -            premium = True +        premium = userData['premium'] != "null"          if userData['premium_unix'] == "null":              validUntil = -1 @@ -65,7 +61,7 @@ class OboomCom(Account):          traffic = userData['traffic']          trafficLeft = traffic['current'] / 1024  #@TODO: Remove `/ 1024` in 0.4.10 -        maxTraffic = traffic['max'] / 1024  #@TODO: Remove `/ 1024` in 0.4.10 +        maxTraffic  = traffic['max'] / 1024  #@TODO: Remove `/ 1024` in 0.4.10          session = account_data['session'] @@ -76,5 +72,5 @@ class OboomCom(Account):                  'session'    : session} -    def login(self, user, password, data, req): -        self.load_account_data(user, req) +    def signin(self, user, password, data): +        self.load_account_data(user, password) diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 3a0131a3f..0249f2b93 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account  class OneFichierCom(Account):      __name__    = "OneFichierCom"      __type__    = "account" -    __version__ = "0.14" +    __version__ = "0.17"      __status__  = "testing"      __description__ = """1fichier.com account plugin""" @@ -19,10 +19,10 @@ class OneFichierCom(Account):                         ("Walter Purcaro", "vuolter@gmail.com")] -    VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' +    VALID_UNTIL_PATTERN = r'Your subscription will end the (\d+-\d+-\d+)' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil = None          trafficleft = -1          premium = None @@ -30,12 +30,13 @@ class OneFichierCom(Account):          html = self.load("https://1fichier.com/console/abo.pl")          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              expiredate = m.group(1)              self.log_debug("Expire date: " + expiredate)              try: -                validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) +                validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d")) +              except Exception, e:                  self.log_error(e)              else: @@ -44,8 +45,8 @@ class OneFichierCom(Account):          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} -    def login(self, user, password, data, req): -        req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") +    def signin(self, user, password, data): +        self.req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en")          html = self.load("https://1fichier.com/login.pl?lg=en",                           post={'mail'   : user, @@ -55,4 +56,4 @@ class OneFichierCom(Account):                                 'valider': "Send"})          if '>Invalid email address' in html or '>Invalid password' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index 6741b674f..02d0d2649 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -7,16 +7,25 @@ from module.common.json_layer import json_loads  class OverLoadMe(Account):      __name__    = "OverLoadMe"      __type__    = "account" -    __version__ = "0.06" +    __version__ = "0.08"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Over-Load.me account plugin"""      __license__     = "GPLv3"      __authors__     = [("marley", "marley@over-load.me")] -    def parse_info(self, user, password, data, req): -        data  = self.get_data(user) +    def grab_hosters(self, user, password, data): +        html = self.load("https://api.over-load.me/hoster.php", +                         get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}) +        return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] + + +    def grab_info(self, user, password, data):          html  = self.load("https://api.over-load.me/account.php",                            get={'user': user,                                 'auth': password}).strip() @@ -31,7 +40,7 @@ class OverLoadMe(Account):              return {'premium': True, 'validuntil': data['expirationunix'], 'trafficleft': -1} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          jsondata = self.load("https://api.over-load.me/account.php",                               get={'user': user,                                    'auth': password}).strip() @@ -39,4 +48,4 @@ class OverLoadMe(Account):          data = json_loads(jsondata)          if data['err'] == 1: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index ba8f24c6d..74859d8a5 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -6,9 +6,13 @@ from module.plugins.internal.Account import Account  class PremiumTo(Account):      __name__    = "PremiumTo"      __type__    = "account" -    __version__ = "0.11" +    __version__ = "0.13"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Premium.to account plugin"""      __license__     = "GPLv3"      __authors__     = [("RaNaN", "RaNaN@pyload.org"), @@ -16,10 +20,16 @@ class PremiumTo(Account):                         ("stickell", "l.stickell@yahoo.it")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        html = self.load("http://premium.to/api/hosters.php", +                         get={'username': user, 'password': password}) +        return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] + + +    def grab_info(self, user, password, data):          traffic = self.load("http://premium.to/api/straffic.php",  #@TODO: Revert to `https` in 0.4.10 -                            get={'username': self.username, -                                 'password': self.password}) +                            get={'username': user, +                                 'password': password})          if "wrong username" not in traffic:              trafficleft = sum(map(float, traffic.split(';'))) / 1024  #@TODO: Remove `/ 1024` in 0.4.10 @@ -28,12 +38,10 @@ class PremiumTo(Account):              return {'premium': False, 'trafficleft': None, 'validuntil': None} -    def login(self, user, password, data, req): -        self.username = user -        self.password = password +    def signin(self, user, password, data):          authcode = self.load("http://premium.to/api/getauthcode.php",  #@TODO: Revert to `https` in 0.4.10                               get={'username': user, -                                  'password': self.password}) +                                  'password': password})          if "wrong username" in authcode: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index df3b5db51..2dc9b8a71 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -7,15 +7,36 @@ from module.plugins.internal.Account import Account  class PremiumizeMe(Account):      __name__    = "PremiumizeMe"      __type__    = "account" -    __version__ = "0.19" +    __version__ = "0.21"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Premiumize.me account plugin"""      __license__     = "GPLv3"      __authors__     = [("Florian Franzen", "FlorianFranzen@gmail.com")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        #: Get supported hosters list from premiumize.me using the +        #: json API v1 (see https://secure.premiumize.me/?show=api) +        answer = self.load("http://api.premiumize.me/pm-api/v1.php",  #@TODO: Revert to `https` in 0.4.10 +                           get={'method'       : "hosterlist", +                                'params[login]': user, +                                'params[pass]' : password}) +        data = json_loads(answer) + +        #: If account is not valid thera are no hosters available +        if data['status'] != 200: +            return [] + +        #: Extract hosters from json file +        return data['result']['hosterlist'] + + +    def grab_info(self, user, password, data):          #: Get user data from premiumize.me          status = self.get_account_status(user, password)          self.log_debug(status) @@ -30,13 +51,13 @@ class PremiumizeMe(Account):          return account_info -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          #: Get user data from premiumize.me          status = self.get_account_status(user, password)          #: Check if user and password are valid          if status['status'] != 200: -            self.login_fail() +            self.fail_login()      def get_account_status(self, user, password): diff --git a/module/plugins/accounts/PutdriveCom.py b/module/plugins/accounts/PutdriveCom.py index 5356c4d1a..4da71f41b 100644 --- a/module/plugins/accounts/PutdriveCom.py +++ b/module/plugins/accounts/PutdriveCom.py @@ -6,7 +6,7 @@ from module.plugins.accounts.ZeveraCom import ZeveraCom  class PutdriveCom(ZeveraCom):      __name__    = "PutdriveCom"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Putdrive.com account plugin""" @@ -14,4 +14,4 @@ class PutdriveCom(ZeveraCom):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "putdrive.com" +    PLUGIN_DOMAIN = "putdrive.com" diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index 42022ec82..19cde51c4 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -8,7 +8,7 @@ from module.plugins.internal.Account import Account  class QuickshareCz(Account):      __name__    = "QuickshareCz"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """Quickshare.cz account plugin""" @@ -19,11 +19,11 @@ class QuickshareCz(Account):      TRAFFIC_LEFT_PATTERN = r'Stav kreditu: <strong>(.+?)</strong>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://www.quickshare.cz/premium")          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        if m: +        if m is not None:              trafficleft = self.parse_traffic(m.group(1))              premium = True if trafficleft else False          else: @@ -33,11 +33,11 @@ class QuickshareCz(Account):          return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load('http://www.quickshare.cz/html/prihlaseni_process.php',                           post={'akce' : u'PÅihlásit',                                 'heslo': password,                                 'jmeno': user})          if u'>TakovÜ uÅŸivatel neexistuje.<' in html or u'>Å patné heslo.<' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index d713cedca..3b814debc 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,17 +7,36 @@ from module.common.json_layer import json_loads  class RPNetBiz(Account):      __name__    = "RPNetBiz"      __type__    = "account" -    __version__ = "0.15" +    __version__ = "0.17"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """RPNet.biz account plugin"""      __license__     = "GPLv3"      __authors__     = [("Dman", "dmanugm@gmail.com")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        res = self.load("https://premium.rpnet.biz/client_api.php", +                        get={'username': user, +                             'password': password, +                             'action'  : "showHosterList"}) +        hoster_list = json_loads(res) + +        #: If account is not valid thera are no hosters available +        if 'error' in hoster_list: +            return [] + +        #: Extract hosters from json file +        return hoster_list['hosters'] + + +    def grab_info(self, user, password, data):          #: Get account information from rpnet.biz -        res = self.get_account_status(user, password, req) +        res = self.get_account_status(user, password)          try:              if res['accountInfo']['isPremium']:                  #: Parse account info. Change the trafficleft later to support per host info. @@ -33,16 +52,16 @@ class RPNetBiz(Account):          return account_info -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          #: Get account information from rpnet.biz -        res = self.get_account_status(user, password, req) +        res = self.get_account_status(user, password)          #: If we have an error in the res, we have wrong login information          if 'error' in res: -            self.login_fail() +            self.fail_login() -    def get_account_status(self, user, password, req): +    def get_account_status(self, user, password):          #: Using the rpnet API, check if valid premium account          res = self.load("https://premium.rpnet.biz/client_api.php",                              get={'username': user, 'password': password, diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 42d084bdb..fc17622b0 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -6,14 +6,19 @@ import time  from module.common.json_layer import json_loads  from module.plugins.internal.Account import Account +# from module.plugins.internal.MultiAccount import MultiAccount  class RapideoPl(Account):      __name__    = "RapideoPl"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.06"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = "Rapideo.pl account plugin"      __license__     = "GPLv3"      __authors__     = [("goddie", "dev@rapideo.pl")] @@ -27,15 +32,19 @@ class RapideoPl(Account):                   'loc'     : "1"    ,                   'info'    : "1"    } -    _req = None -    _usr = None -    _pwd = None +    def grab_hosters(self, user, password, data): +        hostings         = json_loads(self.load("https://www.rapideo.pl/clipboard.php?json=3").strip()) +        hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"] + +        self.log_debug(hostings_domains) + +        return hostings_domains -    def parse_info(self, name, req): -        self._req = req +    def grab_info(self, user, password, data):          try:              result = json_loads(self.run_auth_query()) +          except Exception:              #@TODO: return or let it be thrown?              return @@ -54,27 +63,24 @@ class RapideoPl(Account):                  'premium'    : premium     } -    def login(self, user, password, data, req): -        self._usr = user -        self._pwd = hashlib.md5(password).hexdigest() -        self._req = req +    def signin(self, user, password, data): +        data['usr'] = user +        data['pwd'] = hashlib.md5(password).hexdigest()          try:              response = json_loads(self.run_auth_query()) +          except Exception: -            self.login_fail() +            self.fail_login()          if "errno" in response.keys(): -            self.login_fail() - -        data['usr'] = self._usr -        data['pwd'] = self._pwd +            self.fail_login()      def create_auth_query(self):          query = self.API_QUERY -        query['username'] = self._usr -        query['password'] = self._pwd +        query['username'] = self.info['data']['usr'] +        query['password'] = self.info['data']['pwd']          return query diff --git a/module/plugins/accounts/RapidfileshareNet.py b/module/plugins/accounts/RapidfileshareNet.py index 069b30900..a28c61b36 100644 --- a/module/plugins/accounts/RapidfileshareNet.py +++ b/module/plugins/accounts/RapidfileshareNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class RapidfileshareNet(XFSAccount):      __name__    = "RapidfileshareNet"      __type__    = "account" -    __version__ = "0.06" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """Rapidfileshare.net account plugin""" @@ -14,6 +14,6 @@ class RapidfileshareNet(XFSAccount):      __authors__     = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_DOMAIN = "rapidfileshare.net" +    PLUGIN_DOMAIN = "rapidfileshare.net"      TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><label for="name">\s*(?P<S>[\d.,]+)\s*(?:(?P<U>[\w^_]+))?' diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 5ce51a1ec..f1177530f 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads  class RapidgatorNet(Account):      __name__    = "RapidgatorNet"      __type__    = "account" -    __version__ = "0.11" +    __version__ = "0.15"      __status__  = "testing"      __description__ = """Rapidgator.net account plugin""" @@ -17,17 +17,17 @@ class RapidgatorNet(Account):      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] -    API_URL = "http://rapidgator.net/api/user" +    API_URL = "http://rapidgator.net/api/user/" -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = None          premium     = False          sid         = None          try: -            sid = self.get_data(user).get('sid', None) +            sid = data.get('sid', None)              assert sid              html = self.load(urlparse.urljoin(self.API_URL, "info"), @@ -39,7 +39,7 @@ class RapidgatorNet(Account):              if json['response_status'] == 200:                  if "reset_in" in json['response']: -                    self.schedule_refresh(user, json['response']['reset_in']) +                    self._schedule_refresh(user, json['response']['reset_in'])                  validuntil  = json['response']['expire_date']                  trafficleft = float(json['response']['traffic_left']) / 1024  #@TODO: Remove `/ 1024` in 0.4.10 @@ -56,7 +56,7 @@ class RapidgatorNet(Account):                  'sid'        : sid} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          try:              html = self.load(urlparse.urljoin(self.API_URL, "login"),                               post={'username': user, @@ -75,4 +75,4 @@ class RapidgatorNet(Account):          except Exception, e:              self.log_error(e) -        self.login_fail() +        self.fail_login() diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 1ec29bd77..c11eb9214 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -10,7 +10,7 @@ from module.common.json_layer import json_loads  class RapiduNet(Account):      __name__    = "RapiduNet"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.09"      __status__  = "testing"      __description__ = """Rapidu.net account plugin""" @@ -26,7 +26,7 @@ class RapiduNet(Account):      TRAFFIC_LEFT_PATTERN = r'class="tipsyS"><b>(.+?)<' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = -1          premium     = False @@ -37,17 +37,17 @@ class RapiduNet(Account):              premium = True          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              validuntil = time.time() + (86400 * int(m.group(1)))          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        if m: +        if m is not None:              trafficleft = self.parse_traffic(m.group(1))          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          self.load("https://rapidu.net/ajax.php",                    get={'a': "getChangeLang"},                    post={'_go' : "", @@ -62,5 +62,5 @@ class RapiduNet(Account):          self.log_debug(json) -        if not json['message'] == "success": -            self.login_fail() +        if json['message'] != "success": +            self.fail_login() diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index 5f52ba147..0004c0f79 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class RarefileNet(XFSAccount):      __name__    = "RarefileNet"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.06"      __status__  = "testing"      __description__ = """RareFile.net account plugin""" @@ -14,4 +14,4 @@ class RarefileNet(XFSAccount):      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_DOMAIN = "rarefile.net" +    PLUGIN_DOMAIN = "rarefile.net" diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 718850c1a..63ef62da0 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -8,15 +8,24 @@ from module.plugins.internal.Account import Account  class RealdebridCom(Account):      __name__    = "RealdebridCom"      __type__    = "account" -    __version__ = "0.48" +    __version__ = "0.50"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Real-Debrid.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("Devirex Hazzard", "naibaf_11@yahoo.de")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        html = self.load("https://real-debrid.com/api/hosters.php") +        return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] + + +    def grab_info(self, user, password, data):          if self.pin_code:              return @@ -30,7 +39,7 @@ class RealdebridCom(Account):                  'premium'    : True      } -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          self.pin_code = False          html = self.load("https://real-debrid.com/ajax/login.php", @@ -38,7 +47,7 @@ class RealdebridCom(Account):                                'pass': password})          if "Your login informations are incorrect" in html: -            self.login_fail() +            self.fail_login()          elif "PIN Code required" in html:              self.log_warning(_("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")) diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 36e5e33eb..4ff3f15a8 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,15 +6,26 @@ from module.plugins.internal.Account import Account  class RehostTo(Account):      __name__    = "RehostTo"      __type__    = "account" -    __version__ = "0.18" +    __version__ = "0.21"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Rehost.to account plugin"""      __license__     = "GPLv3"      __authors__     = [("RaNaN", "RaNaN@pyload.org")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        html = self.load("http://rehost.to/api.php", +                         get={'cmd'     : "get_supported_och_dl", +                              'long_ses': data['session']}) +        return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] + + +    def grab_info(self, user, password, data):          premium     = False          trafficleft = None          validuntil  = -1 @@ -37,7 +48,7 @@ class RehostTo(Account):                  traffic, valid = html.split(",")                  premium     = True -                trafficleft = self.parse_traffic(traffic + "MB") +                trafficleft = self.parse_traffic(traffic, "MB")                  validuntil  = float(valid)          finally: @@ -47,7 +58,7 @@ class RehostTo(Account):                      'session'    : session} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://rehost.to/api.php",                           get={'cmd': "login",                                'user': user, @@ -55,4 +66,4 @@ class RehostTo(Account):          if "ERROR" in html:              self.log_debug(html) -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py index 3ab907a76..84b786bac 100644 --- a/module/plugins/accounts/RyushareCom.py +++ b/module/plugins/accounts/RyushareCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class RyushareCom(XFSAccount):      __name__    = "RyushareCom"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.08"      __status__  = "testing"      __description__ = """Ryushare.com account plugin""" @@ -14,4 +14,4 @@ class RyushareCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "ryushare.com" +    PLUGIN_DOMAIN = "ryushare.com" diff --git a/module/plugins/accounts/SafesharingEu.py b/module/plugins/accounts/SafesharingEu.py index eb84d502f..632b2bff8 100644 --- a/module/plugins/accounts/SafesharingEu.py +++ b/module/plugins/accounts/SafesharingEu.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class SafesharingEu(XFSAccount):      __name__    = "SafesharingEu"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Safesharing.eu account plugin""" @@ -14,4 +14,4 @@ class SafesharingEu(XFSAccount):      __authors__     = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_DOMAIN = "safesharing.eu" +    PLUGIN_DOMAIN = "safesharing.eu" diff --git a/module/plugins/accounts/SecureUploadEu.py b/module/plugins/accounts/SecureUploadEu.py index a81030b67..e3f2dbc4f 100644 --- a/module/plugins/accounts/SecureUploadEu.py +++ b/module/plugins/accounts/SecureUploadEu.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class SecureUploadEu(XFSAccount):      __name__    = "SecureUploadEu"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """SecureUpload.eu account plugin""" @@ -14,4 +14,4 @@ class SecureUploadEu(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "secureupload.eu" +    PLUGIN_DOMAIN = "secureupload.eu" diff --git a/module/plugins/accounts/SendmywayCom.py b/module/plugins/accounts/SendmywayCom.py index 2875e0d46..a1675b654 100644 --- a/module/plugins/accounts/SendmywayCom.py +++ b/module/plugins/accounts/SendmywayCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class SendmywayCom(XFSAccount):      __name__    = "SendmywayCom"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Sendmyway.com account plugin""" @@ -14,4 +14,4 @@ class SendmywayCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "sendmyway.com" +    PLUGIN_DOMAIN = "sendmyway.com" diff --git a/module/plugins/accounts/SharebeastCom.py b/module/plugins/accounts/SharebeastCom.py index a104a4a46..b8ddbe34d 100644 --- a/module/plugins/accounts/SharebeastCom.py +++ b/module/plugins/accounts/SharebeastCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class SharebeastCom(XFSAccount):      __name__    = "SharebeastCom"      __type__    = "account" -    __version__ = "0.02" +    __version__ = "0.03"      __status__  = "testing"      __description__ = """Sharebeast.com account plugin""" @@ -14,4 +14,4 @@ class SharebeastCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "sharebeast.com" +    PLUGIN_DOMAIN = "sharebeast.com" diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 87bbc4632..f5d213ecd 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -9,7 +9,7 @@ from module.plugins.internal.Plugin import set_cookie  class ShareonlineBiz(Account):      __name__    = "ShareonlineBiz"      __type__    = "account" -    __version__ = "0.39" +    __version__ = "0.41"      __status__  = "testing"      __description__ = """Share-online.biz account plugin""" @@ -17,7 +17,7 @@ class ShareonlineBiz(Account):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    def api_response(self, user, password, req): +    def api_response(self, user, password):          res = self.load("https://api.share-online.biz/cgi-bin",                          get={'q'       : "userdetails",                               'aux'     : "traffic", @@ -30,21 +30,21 @@ class ShareonlineBiz(Account):          api = dict(line.split("=") for line in res.splitlines() if "=" in line)          if not 'a' in api: -            self.login_fail(res.strip('*').strip()) +            self.fail_login(res.strip('*'))          if api['a'].lower() == "not_available": -            self.login_fail(_("No info available")) +            self.fail_login(_("No info available"))          return api -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          premium     = False          validuntil  = None          trafficleft = -1          maxtraffic  = 100 * 1024 * 1024 * 1024  #: 100 GB -        api = self.api_response(user, password, req) +        api = self.api_response(user, password)          premium    = api['group'] in ("PrePaid", "Premium", "Penalty-Premium")          validuntil = float(api['expire_date']) @@ -64,6 +64,6 @@ class ShareonlineBiz(Account):                  'maxtraffic' : maxtraffic} -    def login(self, user, password, data, req): -        api = self.api_response(user, password, req) -        set_cookie(req.cj, "share-online.biz", 'a', api['a']) +    def signin(self, user, password, data): +        api = self.api_response(user, password) +        set_cookie(self.req.cj, "share-online.biz", 'a', api['a']) diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index a5c69f51c..2be8782ce 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -8,15 +8,28 @@ from module.plugins.internal.Plugin import set_cookie  class SimplyPremiumCom(Account):      __name__    = "SimplyPremiumCom"      __type__    = "account" -    __version__ = "0.08" +    __version__ = "0.10"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Simply-Premium.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("EvolutionClip", "evolutionclip@live.de")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        json_data = self.load("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) +        json_data = json_loads(json_data) + +        host_list = [element['regex'] for element in json_data['result']] + +        return host_list + + +    def grab_info(self, user, password, data):          premium     = False          validuntil  = -1          trafficleft = None @@ -39,11 +52,11 @@ class SimplyPremiumCom(Account):          return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft} -    def login(self, user, password, data, req): -        set_cookie(req.cj, "simply-premium.com", "lang", "EN") +    def signin(self, user, password, data): +        set_cookie(self.req.cj, "simply-premium.com", "lang", "EN")          html = self.load("https://www.simply-premium.com/login.php",                           post={'key': user} if not password else {'login_name': user, 'login_pass': password})          if 'logout' not in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 84c38227e..bd56dd5ec 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -8,15 +8,24 @@ from module.plugins.internal.Account import Account  class SimplydebridCom(Account):      __name__    = "SimplydebridCom"      __type__    = "account" -    __version__ = "0.13" +    __version__ = "0.15"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Simply-Debrid.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("Kagenoshin", "kagenoshin@gmx.ch")] -    def parse_info(self, user, password, data, req): +    def grab_hosters(self, user, password, data): +        html = self.load("http://simply-debrid.com/api.php", get={'list': 1}) +        return [x for x in map(str.strip, html.rstrip(';').replace("\"", "").split(";")) if x] + + +    def grab_info(self, user, password, data):          res = self.load("http://simply-debrid.com/api.php",                          get={'login': 2,                               'u'    : user, @@ -28,10 +37,10 @@ class SimplydebridCom(Account):              return {'trafficleft': -1, 'validuntil': time.mktime(time.strptime(str(data[2]), "%d/%m/%Y"))} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          res = self.load("https://simply-debrid.com/api.php",                          get={'login': 1,                               'u'    : user,                               'p'    : password})          if res != "02: loggin success": -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 9c2451794..1c3da5269 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -26,16 +26,24 @@ from module.plugins.internal.Account import Account  class SmoozedCom(Account):      __name__    = "SmoozedCom"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.09"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Smoozed.com account plugin"""      __license__     = "GPLv3" -    __authors__     = [("", "")] +    __authors__     = [(None, None)] + + +    def grab_hosters(self, user, password, data): +        return self.get_data('hosters') -    def parse_info(self, user, password, data, req): -        status = self.get_account_status(user, password, req) +    def grab_info(self, user, password, data): +        status = self.get_account_status(user, password)          self.log_debug(status) @@ -61,16 +69,16 @@ class SmoozedCom(Account):          return info -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          #: Get user data from premiumize.me -        status = self.get_account_status(user, password, req) +        status = self.get_account_status(user, password)          #: Check if user and password are valid          if status['state'] != 'ok': -            self.login_fail() +            self.fail_login() -    def get_account_status(self, user, password, req): +    def get_account_status(self, user, password):          password  = password          salt      = hashlib.sha256(password).hexdigest()          encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) diff --git a/module/plugins/accounts/StreamcloudEu.py b/module/plugins/accounts/StreamcloudEu.py index 9549896cc..54dd8e2fe 100644 --- a/module/plugins/accounts/StreamcloudEu.py +++ b/module/plugins/accounts/StreamcloudEu.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class StreamcloudEu(XFSAccount):      __name__    = "StreamcloudEu"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Streamcloud.eu account plugin""" @@ -14,4 +14,4 @@ class StreamcloudEu(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "streamcloud.eu" +    PLUGIN_DOMAIN = "streamcloud.eu" diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index 206e7874f..c3edd0c09 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -10,7 +10,7 @@ from module.plugins.internal.Plugin import set_cookie  class TurbobitNet(Account):      __name__    = "TurbobitNet"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """TurbobitNet account plugin""" @@ -18,11 +18,11 @@ class TurbobitNet(Account):      __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://turbobit.net")          m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html) -        if m: +        if m is not None:              premium = True              validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y"))          else: @@ -32,8 +32,8 @@ class TurbobitNet(Account):          return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} -    def login(self, user, password, data, req): -        set_cookie(req.cj, "turbobit.net", "user_lang", "en") +    def signin(self, user, password, data): +        set_cookie(self.req.cj, "turbobit.net", "user_lang", "en")          html = self.load("http://turbobit.net/user/login",                           post={"user[login]" : user, @@ -41,4 +41,4 @@ class TurbobitNet(Account):                                 "user[submit]": "Login"})          if not '<div class="menu-item user-name">' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py index c549bbaf7..d826e5a3d 100644 --- a/module/plugins/accounts/TusfilesNet.py +++ b/module/plugins/accounts/TusfilesNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class TusfilesNet(XFSAccount):      __name__    = "TusfilesNet"      __type__    = "account" -    __version__ = "0.07" +    __version__ = "0.08"      __status__  = "testing"      __description__ = """Tusfile.net account plugin""" @@ -17,7 +17,7 @@ class TusfilesNet(XFSAccount):      __authors__     = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_DOMAIN = "tusfiles.net" +    PLUGIN_DOMAIN = "tusfiles.net"      VALID_UNTIL_PATTERN = r'<span class="label label-default">([^<]+)</span>'      TRAFFIC_LEFT_PATTERN = r'<td><img src="//www\.tusfiles\.net/i/icon/meter\.png" alt=""/></td>\n<td> (?P<S>[\d.,]+)' diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 00e125dbc..8380099e1 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class UlozTo(Account):      __name__    = "UlozTo"      __type__    = "account" -    __version__ = "0.12" +    __version__ = "0.14"      __status__  = "testing"      __description__ = """Uloz.to account plugin""" @@ -21,7 +21,7 @@ class UlozTo(Account):      TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title=".+?GB = ([\d.]+) MB"' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://www.ulozto.net/")          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) @@ -32,7 +32,7 @@ class UlozTo(Account):          return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          login_page = self.load('http://www.ulozto.net/?do=web-login')          action     = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&')          token      = re.search('_token_" value="(.+?)"', login_page).group(1) @@ -46,4 +46,4 @@ class UlozTo(Account):                                 'remember': "on"})          if '<div class="flash error">' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py index 9c2649e51..eefa1f3a0 100644 --- a/module/plugins/accounts/UploadableCh.py +++ b/module/plugins/accounts/UploadableCh.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account  class UploadableCh(Account):      __name__    = "UploadableCh"      __type__    = "account" -    __version__ = "0.05" +    __version__ = "0.07"      __status__  = "testing"      __description__ = """Uploadable.ch account plugin""" @@ -14,7 +14,7 @@ class UploadableCh(Account):      __authors__     = [("Sasch", "gsasch@gmail.com")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("http://www.uploadable.ch/login.php")          premium     = '<a href="/logout.php"' in html @@ -23,7 +23,7 @@ class UploadableCh(Account):          return {'validuntil': None, 'trafficleft': trafficleft, 'premium': premium}  #@TODO: validuntil -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("http://www.uploadable.ch/login.php",                           post={'userName'     : user,                                 'userPassword' : password, @@ -31,4 +31,4 @@ class UploadableCh(Account):                                 'action__login': "normalLogin"})          if "Login failed" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/UploadcCom.py b/module/plugins/accounts/UploadcCom.py index 5b834ac3b..dbad01858 100644 --- a/module/plugins/accounts/UploadcCom.py +++ b/module/plugins/accounts/UploadcCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class UploadcCom(XFSAccount):      __name__    = "UploadcCom"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """Uploadc.com account plugin""" @@ -14,4 +14,4 @@ class UploadcCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "uploadc.com" +    PLUGIN_DOMAIN = "uploadc.com" diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 59d3fcff9..9c3369bd8 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account  class UploadedTo(Account):      __name__    = "UploadedTo"      __type__    = "account" -    __version__ = "0.35" +    __version__ = "0.37"      __status__  = "testing"      __description__ = """Uploaded.to account plugin""" @@ -24,7 +24,7 @@ class UploadedTo(Account):      TRAFFIC_LEFT_PATTERN = r'<b class="cB">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = None          premium     = None @@ -34,20 +34,20 @@ class UploadedTo(Account):          premium = True if re.search(self.PREMIUM_PATTERN, html) else False          m = re.search(self.VALID_UNTIL_PATTERN, html, re.M) -        if m: +        if m is not None:              expiredate = m.group(1).lower().strip()              if expiredate == "unlimited":                  validuntil = -1              else:                  m = re.findall(r'(\d+) (week|day|hour)', expiredate) -                if m: +                if m is not None:                      validuntil = time.time()                      for n, u in m:                          validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u]          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        if m: +        if m is not None:              traffic = m.groupdict()              size    = traffic['S'].replace('.', '')              unit    = traffic['U'].lower() @@ -56,14 +56,14 @@ class UploadedTo(Account):                  trafficleft = float(size.replace(',', '.')) / 1024                  trafficleft *= 1 << 40              else: -                trafficleft = self.parse_traffic(size + unit) +                trafficleft = self.parse_traffic(size, unit)          return {'validuntil' : validuntil,                  'trafficleft': trafficleft,                  'premium'    : premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          self.load("http://uploaded.net/language/en")          html = self.load("http://uploaded.net/io/login", @@ -72,4 +72,4 @@ class UploadedTo(Account):          m = re.search(r'"err":"(.+?)"', html)          if m is not None: -            self.login_fail(m.group(1)) +            self.fail_login(m.group(1)) diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index f31b01d03..c5e684033 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account  class UploadheroCom(Account):      __name__    = "UploadheroCom"      __type__    = "account" -    __version__ = "0.23" +    __version__ = "0.25"      __status__  = "testing"      __description__ = """Uploadhero.co account plugin""" @@ -18,10 +18,9 @@ class UploadheroCom(Account):      __authors__     = [("mcmyst", "mcmyst@hotmail.fr")] -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          premium_pattern = re.compile('Il vous reste <span class="bleu">(\d+)</span> jours premium') -        data = self.get_data(user)          html = self.load("http://uploadhero.co/my-account")          if premium_pattern.search(html): @@ -34,10 +33,10 @@ class UploadheroCom(Account):          return account_info -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("http://uploadhero.co/lib/connexion.php",                           post={'pseudo_login': user,                                 'password_login': password})          if "mot de passe invalide" in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index d269abde7..c038d1ebc 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Plugin import set_cookies  class UploadingCom(Account):      __name__    = "UploadingCom"      __type__    = "account" -    __version__ = "0.14" +    __version__ = "0.16"      __status__  = "testing"      __description__ = """Uploading.com account plugin""" @@ -22,7 +22,7 @@ class UploadingCom(Account):      VALID_UNTIL_PATTERN = r'Valid Until:(.+?)<' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = None          premium     = None @@ -32,7 +32,7 @@ class UploadingCom(Account):          premium = False if re.search(self.PREMIUM_PATTERN, html) else True          m = re.search(self.VALID_UNTIL_PATTERN, html) -        if m: +        if m is not None:              expiredate = m.group(1).strip()              self.log_debug("Expire date: " + expiredate) @@ -54,8 +54,8 @@ class UploadingCom(Account):                  'premium'    : premium} -    def login(self, user, password, data, req): -        set_cookies(req.cj, +    def signin(self, user, password, data): +        set_cookies(self.req.cj,                      [("uploading.com", "lang"    , "1" ),                       ("uploading.com", "language", "1" ),                       ("uploading.com", "setlang" , "en"), diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py index 68aaecc47..8df558e2a 100644 --- a/module/plugins/accounts/UptoboxCom.py +++ b/module/plugins/accounts/UptoboxCom.py @@ -6,14 +6,14 @@ from module.plugins.internal.XFSAccount import XFSAccount  class UptoboxCom(XFSAccount):      __name__    = "UptoboxCom"      __type__    = "account" -    __version__ = "0.09" +    __version__ = "0.13"      __status__  = "testing" -    __description__ = """DDLStorage.com account plugin""" +    __description__ = """Uptobox.com account plugin"""      __license__     = "GPLv3" -    __authors__     = [("zoidberg", "zoidberg@mujmail.cz")] +    __authors__     = [("benbox69", "dev@tollet.me")] -    HOSTER_DOMAIN = "uptobox.com" -    HOSTER_URL    = "https://uptobox.com/" -    LOGIN_URL     = "https://login.uptobox.com/" +    PLUGIN_DOMAIN = "uptobox.com" +    PLUGIN_URL    = "https://uptobox.com/" +    LOGIN_URL     = "https://login.uptobox.com/logarithme/" diff --git a/module/plugins/accounts/VidPlayNet.py b/module/plugins/accounts/VidPlayNet.py index d543c5671..e54515faf 100644 --- a/module/plugins/accounts/VidPlayNet.py +++ b/module/plugins/accounts/VidPlayNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class VidPlayNet(XFSAccount):      __name__    = "VidPlayNet"      __type__    = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __status__  = "testing"      __description__ = """VidPlay.net account plugin""" @@ -14,4 +14,4 @@ class VidPlayNet(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "vidplay.net" +    PLUGIN_DOMAIN = "vidplay.net" diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py index bbfb90a92..484ea06ce 100644 --- a/module/plugins/accounts/WebshareCz.py +++ b/module/plugins/accounts/WebshareCz.py @@ -12,7 +12,7 @@ from module.plugins.internal.Account import Account  class WebshareCz(Account):      __name__    = "WebshareCz"      __type__    = "account" -    __version__ = "0.10" +    __version__ = "0.12"      __status__  = "testing"      __description__ = """Webshare.cz account plugin""" @@ -25,9 +25,9 @@ class WebshareCz(Account):      TRAFFIC_LEFT_PATTERN = r'<bytes>(.+)</bytes>' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          html = self.load("https://webshare.cz/api/user_data/", -                        post={'wst': self.get_data(user).get('wst', None)}) +                        post={'wst': data.get('wst', None)})          self.log_debug("Response: " + html) @@ -41,13 +41,13 @@ class WebshareCz(Account):          return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          salt = self.load("https://webshare.cz/api/salt/",                           post={'username_or_email': user,                                 'wst'              : ""})          if "<status>OK</status>" not in salt: -            self.login_fail() +            self.fail_login()          salt     = re.search('<salt>(.+)</salt>', salt).group(1)          password = hashlib.sha1(md5_crypt.encrypt(password, salt=salt)).hexdigest() @@ -61,6 +61,6 @@ class WebshareCz(Account):                                  'wst'              : ""})          if "<status>OK</status>" not in login: -            self.login_fail() +            self.fail_login()          data['wst'] = re.search('<token>(.+)</token>', login).group(1) diff --git a/module/plugins/accounts/WorldbytezCom.py b/module/plugins/accounts/WorldbytezCom.py index ea409fd58..6987bc0cc 100644 --- a/module/plugins/accounts/WorldbytezCom.py +++ b/module/plugins/accounts/WorldbytezCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class WorldbytezCom(XFSAccount):      __name__    = "WorldbytezCom"      __type__    = "account" -    __version__ = "0.02" +    __version__ = "0.03"      __status__  = "testing"      __description__ = """Worldbytez.com account plugin""" @@ -14,4 +14,4 @@ class WorldbytezCom(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "worldbytez.com" +    PLUGIN_DOMAIN = "worldbytez.com" diff --git a/module/plugins/accounts/XFileSharingPro.py b/module/plugins/accounts/XFileSharingPro.py index f21247cf4..68797b7f0 100644 --- a/module/plugins/accounts/XFileSharingPro.py +++ b/module/plugins/accounts/XFileSharingPro.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount  class XFileSharingPro(XFSAccount):      __name__    = "XFileSharingPro"      __type__    = "account" -    __version__ = "0.09" +    __version__ = "0.10"      __status__  = "testing"      __description__ = """XFileSharingPro multi-purpose account plugin""" @@ -14,13 +14,13 @@ class XFileSharingPro(XFSAccount):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = None +    PLUGIN_DOMAIN = None -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          try: -            return super(XFileSharingPro, self).login(user, data, req) +            return super(XFileSharingPro, self).signin(user, password, data)          except Fail: -            self.HOSTER_URL = self.HOSTER_URL.replace("www.", "") -            return super(XFileSharingPro, self).login(user, data, req) +            self.PLUGIN_URL = self.PLUGIN_URL.replace("www.", "") +            return super(XFileSharingPro, self).signin(user, password, data) diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index c5dda0921..ba7454183 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.Account import Account  class YibaishiwuCom(Account):      __name__    = "YibaishiwuCom"      __type__    = "account" -    __version__ = "0.04" +    __version__ = "0.06"      __status__  = "testing"      __description__ = """115.com account plugin""" @@ -19,7 +19,7 @@ class YibaishiwuCom(Account):      ACCOUNT_INFO_PATTERN = r'var USER_PERMISSION = {(.*?)}' -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          # self.relogin(user)          html = self.load("http://115.com/") @@ -29,7 +29,7 @@ class YibaishiwuCom(Account):          return dict({'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}) -    def login(self, user, password, data, req): +    def signin(self, user, password, data):          html = self.load("https://passport.115.com/?ac=login",                           post={'back'          : "http://www.115.com/",                                 'goto'          : "http://115.com/", @@ -37,4 +37,4 @@ class YibaishiwuCom(Account):                                 "login[passwd]" : password})          if not 'var USER_PERMISSION = {' in html: -            self.login_fail() +            self.fail_login() diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index 4138ba3cc..c94ad6db7 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -8,16 +8,25 @@ from module.plugins.internal.Account import Account  class ZeveraCom(Account):      __name__    = "ZeveraCom"      __type__    = "account" -    __version__ = "0.28" +    __version__ = "0.30"      __status__  = "testing" +    __config__ = [("mh_mode"    , "all;listed;unlisted", "Filter hosters to use"        , "all"), +                  ("mh_list"    , "str"                , "Hoster list (comma separated)", ""   ), +                  ("mh_interval", "int"                , "Reload interval in minutes"   , 60   )] +      __description__ = """Zevera.com account plugin"""      __license__     = "GPLv3"      __authors__     = [("zoidberg", "zoidberg@mujmail.cz"),                         ("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_DOMAIN = "zevera.com" +    PLUGIN_DOMAIN = "zevera.com" + + +    def grab_hosters(self, user, password, data): +        html = self.api_response(user, password, cmd="gethosters") +        return [x.strip() for x in html.split(",")]      def __init__(self, manager, accounts):  #@TODO: remove in 0.4.10 @@ -26,19 +35,19 @@ class ZeveraCom(Account):      def init(self): -        if not self.HOSTER_DOMAIN: -            self.log_error(_("Missing HOSTER_DOMAIN")) +        if not self.PLUGIN_DOMAIN: +            self.log_error(_("Missing PLUGIN_DOMAIN"))          if not hasattr(self, "API_URL"): -            self.API_URL = "http://api.%s/jDownloader.ashx" % (self.HOSTER_DOMAIN or "") +            self.API_URL = "http://api.%s/jDownloader.ashx" % (self.PLUGIN_DOMAIN or "") -    def parse_info(self, user, password, data, req): +    def grab_info(self, user, password, data):          validuntil  = None          trafficleft = None          premium     = False -        api = self.api_response(req) +        api = self.api_response(user, password)          if "No trafic" not in api and api['endsubscriptiondate'] != "Expired!":              validuntil  = time.mktime(time.strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) @@ -48,18 +57,15 @@ class ZeveraCom(Account):          return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -    def login(self, user, password, data, req): -        self.user     = user -        self.password = password - -        if self.api_response(req) == "No trafic": -            self.login_fail() +    def signin(self, user, password, data): +        if self.api_response(user, password) == "No trafic": +            self.fail_login() -    def api_response(self, req, just_header=False, **kwargs): +    def api_response(self, user, password=None, just_header=False, **kwargs):          get_data = {'cmd'  : "accountinfo", -                    'login': self.user, -                    'pass' : self.password} +                    'login': user, +                    'pass' : password}          get_data.update(kwargs) | 
