summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/BitshareCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-03 09:06:05 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-03 09:09:53 +0200
commit23ae563604dca1dae262fbc598154b99b2f1eae8 (patch)
tree1540b988d133c052bf0d6e7f26f02324db6f944a /module/plugins/hoster/BitshareCom.py
parent[MovReelCom] Fixed LINK_PATTERN (diff)
downloadpyload-23ae563604dca1dae262fbc598154b99b2f1eae8.tar.xz
Update plugins after CaptchaService and XFileSharingPro changes
Diffstat (limited to 'module/plugins/hoster/BitshareCom.py')
-rw-r--r--module/plugins/hoster/BitshareCom.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index 3c84ce5da..d7143952b 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -23,7 +23,6 @@ class BitshareCom(SimpleHoster):
OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)'
FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";'
- CAPTCHA_KEY_PATTERN = r'http://api\.recaptcha\.net/challenge\?k=(.*?) '
TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!'
@@ -108,12 +107,15 @@ class BitshareCom(SimpleHoster):
# Resolve captcha
if captcha == 1:
self.logDebug("File is captcha protected")
- id = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1)
+ recaptcha = ReCaptcha(self)
+ captcha_key = recaptcha.detect_key()
+ if captcha_key is None:
+ self.parseError("ReCaptcha captcha key not found")
+
# Try up to 3 times
for i in xrange(3):
- self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i + 1))
- recaptcha = ReCaptcha(self)
- challenge, code = recaptcha.challenge(id)
+ self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (captcha_key, i + 1))
+ challenge, code = recaptcha.challenge(captcha_key)
response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html",
post={"request": "validateCaptcha", "ajaxid": self.ajaxid,
"recaptcha_challenge_field": challenge, "recaptcha_response_field": code})