summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-22 17:09:17 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-22 17:09:17 +0100
commit561357c1e1fdb86a4ad89f146f8a1d1241d21a3b (patch)
tree09395311d73246bdb1a3ef3cf7bd2fbcc235c303
parent[XFSAccount][XFSHoster] Tiny pattern improvement (diff)
downloadpyload-561357c1e1fdb86a4ad89f146f8a1d1241d21a3b.tar.xz
[XFSHoster] Improve ERROR_PATTERN + revert direct link detection in getDownloadLink
-rw-r--r--module/plugins/internal/XFSHoster.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index a6a3f3260..d5bbf5c63 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -16,7 +16,7 @@ from module.utils import html_unescape
class XFSHoster(SimpleHoster):
__name__ = "XFSHoster"
__type__ = "hoster"
- __version__ = "0.21"
+ __version__ = "0.22"
__pattern__ = r'^unmatchable$'
@@ -46,7 +46,7 @@ class XFSHoster(SimpleHoster):
WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>|id="countdown" value=".*?(\d+).*?"'
PREMIUM_ONLY_PATTERN = r'>This file is available for Premium Users only'
- ERROR_PATTERN = r'(?:class=["\']err["\'].*?>|<[Cc]enter><b>|>Error</td></tr>\s*<tr><td align=center>\s*(?:<.+?>)?)(.+?)(?:["\']|</)|>\(ERROR:(.+?)\)'
+ ERROR_PATTERN = r'(?:class=["\']err["\'].*?>|<[Cc]enter><b>|>Error</td>|>\(ERROR:)(?:\s*<.+?>\s*)*(.+?)(?:["\']|<|\))'
OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
LINK_PATTERN = None #: final download url pattern
@@ -126,11 +126,8 @@ class XFSHoster(SimpleHoster):
self.req.http.c.setopt(FOLLOWLOCATION, 1)
m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
- if m:
- if 'down_direct' in data and data['down_direct']:
- break
- else:
- self.error(_("Direct download link detected but not found"))
+ if m and not "op=" in m.group(1):
+ break
m = re.search(self.LINK_PATTERN, self.html, re.S)
if m:
@@ -212,7 +209,7 @@ class XFSHoster(SimpleHoster):
if m is None:
self.errmsg = None
else:
- self.errmsg = m.group(1)
+ self.errmsg = m.group(1).strip()
self.logWarning(re.sub(r"<.*?>", " ", self.errmsg))