diff options
Diffstat (limited to 'pyload/plugins')
-rw-r--r-- | pyload/plugins/accounts/Premium4Me.py | 11 | ||||
-rw-r--r-- | pyload/plugins/addons/MultiHoster.py | 5 | ||||
-rw-r--r-- | pyload/plugins/hoster/Premium4Me.py | 5 |
3 files changed, 13 insertions, 8 deletions
diff --git a/pyload/plugins/accounts/Premium4Me.py b/pyload/plugins/accounts/Premium4Me.py index fbca3ce84..3b0d24488 100644 --- a/pyload/plugins/accounts/Premium4Me.py +++ b/pyload/plugins/accounts/Premium4Me.py @@ -1,6 +1,7 @@ -from module.plugins.Account import Account -class Premium4Me(Account): +from pyload.plugins.MultiHoster import MultiHoster + +class Premium4Me(MultiHoster): __name__ = "Premium4Me" __version__ = "0.03" __type__ = "account" @@ -20,4 +21,8 @@ class Premium4Me(Account): self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (user, data["password"])).strip() if "wrong username" in self.authcode: - self.wrongPassword()
\ No newline at end of file + self.wrongPassword() + + def loadHosterList(self, req): + page = req.load("http://premium.to/api/hosters.php?authcode=%s" % self.authcode) + return [x.strip() for x in page.replace("\"", "").split(";")]
\ No newline at end of file diff --git a/pyload/plugins/addons/MultiHoster.py b/pyload/plugins/addons/MultiHoster.py index b7873a3a2..7ff6b834e 100644 --- a/pyload/plugins/addons/MultiHoster.py +++ b/pyload/plugins/addons/MultiHoster.py @@ -26,7 +26,7 @@ class MultiHoster(Addon): def addHoster(self, account): - self.logInfo(_("Added MultiHoster %s") % account.__name__) + self.logInfo(_("Activated MultiHoster %s") % account.__name__) pluginMap = {} for name in self.core.pluginManager.getPlugins("hoster").keys(): @@ -62,12 +62,13 @@ class MultiHoster(Addon): # recreate plugin tuple for new regexp hoster = self.core.pluginManager.getPlugins("hoster") p = hoster[account.__name__] - new = PluginTuple(p.version, re.compile(regexp), p.deps, p.user, p.path) + new = PluginTuple(p.version, re.compile(regexp), p.deps, p.category, p.user, p.path) hoster[account.__name__] = new @AddEventListener("account:deleted") def refreshAccounts(self, plugin=None, user=None): + self.logDebug("Re-checking accounts") self.plugins = {} for name, account in self.core.accountManager.iterAccounts(): diff --git a/pyload/plugins/hoster/Premium4Me.py b/pyload/plugins/hoster/Premium4Me.py index 502e9ff12..582e3fc3a 100644 --- a/pyload/plugins/hoster/Premium4Me.py +++ b/pyload/plugins/hoster/Premium4Me.py @@ -5,9 +5,8 @@ from urllib import quote from os.path import exists from os import remove -from module.plugins.Hoster import Hoster -from module.utils import fs_encode - +from pyload.plugins.Hoster import Hoster +from pyload.utils.fs import fs_encode class Premium4Me(Hoster): __name__ = "Premium4Me" |