diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-18 09:48:07 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-18 09:48:07 +0200 |
commit | 41faf73af4deb8dcd73e0c2e55073f1ef7656a7f (patch) | |
tree | 08fa67128d9ba0451b9397ea0fcc192d2501c431 | |
parent | [XFSAccount] Fix https://github.com/pyload/pyload/issues/1420 (diff) | |
download | pyload-41faf73af4deb8dcd73e0c2e55073f1ef7656a7f.tar.xz |
[XFSHoster] Fix https://github.com/pyload/pyload/issues/1296
-rw-r--r-- | module/plugins/hooks/UserAgentSwitcher.py | 8 | ||||
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 16 |
2 files changed, 9 insertions, 15 deletions
diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 912c2ef09..0b36e38ec 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -15,10 +15,10 @@ class UserAgentSwitcher(Hook): __type__ = "hook" __version__ = "0.04" - __config__ = [("activated", "bool", "Activated" , True ), - ("uaf" , "file", "Random user-agents file" , "" ), - ("uar" , "bool", "Random user-agent" , False ), - ("uas" , "str" , "Custom user-agent string", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0")] + __config__ = [("activated", "bool", "Activated" , True ), + ("uaf" , "file", "Random user-agent by file" , "" ), + ("uar" , "bool", "Random user-agent" , False ), + ("uas" , "str" , "Custom user-agent string" , "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0")] __description__ = """Custom user-agent""" __license__ = "GPLv3" diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index e8b79c8cd..57357c06e 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -13,7 +13,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.49" + __version__ = "0.50" __pattern__ = r'^unmatchable$' @@ -78,8 +78,6 @@ class XFSHoster(SimpleHoster): pattern = r'(https?://(?:www\.)?([^/]*?%s|\d+\.\d+\.\d+\.\d+)(\:\d+)?(/d/|(/files)?/\d+/\w+/).+?)["\'<]' self.LINK_PATTERN = pattern % self.HOSTER_DOMAIN.replace('.', '\.') - self.captcha = None - super(XFSHoster, self).prepare() if self.DIRECT_LINK is None: @@ -204,8 +202,7 @@ class XFSHoster(SimpleHoster): wait_time = int(m.group(1)) self.setWait(wait_time, False) - self.captcha = self.handleCaptcha(inputs) - + self.handleCaptcha(inputs) self.wait() else: inputs['referer'] = self.pyfile.url @@ -225,7 +222,7 @@ class XFSHoster(SimpleHoster): if m: captcha_url = m.group(1) inputs['code'] = self.decryptCaptcha(captcha_url) - return 1 + return m = re.search(self.CAPTCHA_BLOCK_PATTERN, self.html, re.S) if m: @@ -237,7 +234,7 @@ class XFSHoster(SimpleHoster): inputs['code'] = "".join(a[1] for a in sorted(numerals, key=lambda num: int(num[0]))) self.logDebug("Captcha code: %s" % inputs['code'], numerals) - return 2 + return recaptcha = ReCaptcha(self) try: @@ -251,7 +248,7 @@ class XFSHoster(SimpleHoster): if captcha_key: inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge(captcha_key) - return 3 + return solvemedia = SolveMedia(self) try: @@ -265,6 +262,3 @@ class XFSHoster(SimpleHoster): if captcha_key: inputs['adcopy_response'], inputs['adcopy_challenge'] = solvemedia.challenge(captcha_key) - return 4 - - return 0 |