summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-19 06:48:27 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-19 06:48:27 +0200
commitf23c2ed39b842c115751937ebc3d1b1138a9ad88 (patch)
treebd0c2dcfd1c083a658907571de037391e372ff91 /module/plugins/internal
parentMerge pull request #1826 from benbox69/stable (diff)
downloadpyload-f23c2ed39b842c115751937ebc3d1b1138a9ad88.tar.xz
[XFSAccount] Update
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/Container.py2
-rw-r--r--module/plugins/internal/Hoster.py2
-rw-r--r--module/plugins/internal/Plugin.py2
-rw-r--r--module/plugins/internal/XFSAccount.py15
4 files changed, 15 insertions, 6 deletions
diff --git a/module/plugins/internal/Container.py b/module/plugins/internal/Container.py
index 729592a0d..66e1ad904 100644
--- a/module/plugins/internal/Container.py
+++ b/module/plugins/internal/Container.py
@@ -63,7 +63,7 @@ class Container(Crypter):
f.write(content)
except IOError, e:
- self.fail(str(e)) #@TODO: Remove `str` in 0.4.10
+ self.fail(e)
else:
self.pyfile.name = os.path.basename(self.pyfile.url)
diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py
index e6bd14329..ac42182c4 100644
--- a/module/plugins/internal/Hoster.py
+++ b/module/plugins/internal/Hoster.py
@@ -368,7 +368,7 @@ class Hoster(Plugin):
url = self.fixurl(url)
if not url or not isinstance(url, basestring):
- self.fail(_("No url given"))
+ self.fail(_("No given url"))
if self.pyload.debug:
self.log_debug("DOWNLOAD URL " + url,
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py
index fd8712b44..fc05e2a5b 100644
--- a/module/plugins/internal/Plugin.py
+++ b/module/plugins/internal/Plugin.py
@@ -354,7 +354,7 @@ class Plugin(object):
url = fixurl(url)
if not url or not isinstance(url, basestring):
- self.fail(_("No url given"))
+ self.fail(_("No given url"))
if self.pyload.debug:
self.log_debug("LOAD URL " + url,
diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py
index 5a4cc35fb..3f2158a0b 100644
--- a/module/plugins/internal/XFSAccount.py
+++ b/module/plugins/internal/XFSAccount.py
@@ -4,6 +4,7 @@ import re
import time
import urlparse
+from module.common.json_layer import json_loads
from module.plugins.internal.Account import Account
from module.plugins.internal.Plugin import parse_html_form, set_cookie
@@ -11,7 +12,7 @@ from module.plugins.internal.Plugin import parse_html_form, set_cookie
class XFSAccount(Account):
__name__ = "XFSAccount"
__type__ = "account"
- __version__ = "0.43"
+ __version__ = "0.44"
__status__ = "testing"
__description__ = """XFileSharing account plugin"""
@@ -174,5 +175,13 @@ class XFSAccount(Account):
html = self.load(url, post=inputs, cookies=self.COOKIES)
- if re.search(self.LOGIN_FAIL_PATTERN, html):
- self.login_fail()
+ try:
+ json = json_loads(html)
+
+ except ValueError:
+ if re.search(self.LOGIN_FAIL_PATTERN, html):
+ self.login_fail()
+
+ else:
+ if not 'success' in json or not json['success']:
+ self.login_fail()