diff options
| author | 2015-01-10 15:55:06 +0100 | |
|---|---|---|
| committer | 2015-01-10 15:55:06 +0100 | |
| commit | b617325d793a55d25f4812b1c6a7b9e656b9c73f (patch) | |
| tree | ced8bd24e16dca66703b9370a847860de3aecbe2 /module/plugins | |
| parent | [MegaCoNz] Fix https://github.com/pyload/pyload/issues/1017 (thx valadrem) (diff) | |
| download | pyload-b617325d793a55d25f4812b1c6a7b9e656b9c73f.tar.xz | |
[RehostTo] Fix https://github.com/pyload/pyload/issues/1009
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/accounts/RehostTo.py | 18 | ||||
| -rw-r--r-- | module/plugins/hooks/RehostTo.py | 15 | ||||
| -rw-r--r-- | module/plugins/hoster/RehostTo.py | 6 | 
3 files changed, 12 insertions, 27 deletions
diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 660bef07e..4baefdc96 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account  class RehostTo(Account):      __name__    = "RehostTo"      __type__    = "account" -    __version__ = "0.12" +    __version__ = "0.13"      __description__ = """Rehost.to account plugin"""      __license__     = "GPLv3" @@ -18,25 +18,19 @@ class RehostTo(Account):          html = req.load("http://rehost.to/api.php",                          get={'cmd': "login", 'user': user, 'pass': data['password']}) -        data = [x.split("=") for x in html.split(",")] - -        ses      = data[0][1] -        long_ses = data[1][1] +        session = [x.split("=") for x in html.split(",")][1][1]          html = req.load("http://rehost.to/api.php", -                        get={'cmd': "get_premium_credits", 'long_ses': long_ses}) +                        get={'cmd': "get_premium_credits", 'long_ses': session})          traffic, valid = html.split(",")          trafficleft = self.parseTraffic(traffic + "MB")          validuntil  = float(valid) -        account_info = {"trafficleft": trafficleft, -                        "validuntil" : validuntil, -                        "long_ses"   : long_ses, -                        "ses"        : ses} - -        return account_info +        return = {'trafficleft': trafficleft, +                  'validuntil' : validuntil, +                  'session'    : session}      def login(self, user, data, req): diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 81cb26f2f..d2383cf98 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook  class RehostTo(MultiHook):      __name__    = "RehostTo"      __type__    = "hook" -    __version__ = "0.47" +    __version__ = "0.48"      __config__ = [("pluginmode"    , "all;listed;unlisted", "Use for plugins"                     , "all"),                    ("pluginlist"    , "str"                , "Plugin list (comma separated)"       , ""   ), @@ -22,15 +22,8 @@ class RehostTo(MultiHook):      def getHosters(self): +        user, data = self.account.selectAccount()          page = self.getURL("http://rehost.to/api.php", -                      get={'cmd': "get_supported_och_dl", 'long_ses': self.long_ses}) +                           get={'cmd'     : "get_supported_och_dl", +                                'long_ses': self.getAccountData(user)['session']})          return [x.strip() for x in page.replace("\"", "").split(",")] - - -    def coreReady(self): -        super(RehostTo, self).coreReady() - -        user, data = self.account.selectAccount() - -        self.ses      = data['ses'] -        self.long_ses = data['long_ses'] diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index f87c7f3ff..e706fa6c6 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo  class RehostTo(MultiHoster):      __name__    = "RehostTo"      __type__    = "hoster" -    __version__ = "0.19" +    __version__ = "0.20"      __pattern__ = r'https?://.*rehost\.to\..+' @@ -18,11 +18,9 @@ class RehostTo(MultiHoster):      def handlePremium(self, pyfile): -        data = self.account.getAccountData(self.user) -          self.download("http://rehost.to/process_download.php",                        get={'user': "cookie", -                           'pass': data['long_ses'], +                           'pass': self.account.getAccountData(self.user)['session'],                             'dl'  : pyfile.url},                        disposition=True)  | 
