summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/BitshareCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/BitshareCom.py')
-rw-r--r--module/plugins/hoster/BitshareCom.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index b975a8ab0..e426de092 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class BitshareCom(SimpleHoster):
__name__ = "BitshareCom"
__type__ = "hoster"
- __version__ = "0.55"
+ __version__ = "0.56"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?bitshare\.com/(files/)?(?(1)|\?f=)(?P<ID>\w+)(?(1)/(?P<NAME>.+?)\.html)'
@@ -39,7 +39,7 @@ class BitshareCom(SimpleHoster):
def process(self, pyfile):
if self.premium:
- self.account.relogin(self.user)
+ self.account.relogin()
#: File id
m = re.match(self.__pattern__, pyfile.url)
@@ -75,7 +75,7 @@ class BitshareCom(SimpleHoster):
#: This may either download our file or forward us to an error page
self.link = self.get_download_url()
- if self.check_download({'error': ">Error occured<"}):
+ if self.check_file({'error': ">Error occured<"}):
self.retry(5, 5 * 60, "Bitshare host : Error occured")
@@ -114,16 +114,14 @@ class BitshareCom(SimpleHoster):
self.log_debug("File is captcha protected")
recaptcha = ReCaptcha(self)
- #: Try up to 3 times
- for i in xrange(3):
- response, challenge = recaptcha.challenge()
- res = 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' : response})
- if self.handle_captcha_errors(res):
- break
+ response, challenge = recaptcha.challenge()
+ res = 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' : response})
+
+ self.handle_captcha_errors(res)
#: Get download URL
self.log_debug("Getting download url")
@@ -141,6 +139,7 @@ class BitshareCom(SimpleHoster):
self.log_debug("Checking response [%s]" % res)
if "ERROR:Session timed out" in res:
self.retry()
+
elif "ERROR" in res:
msg = res.split(separator)[-1]
self.fail(msg)
@@ -150,11 +149,12 @@ class BitshareCom(SimpleHoster):
self.log_debug("Result of captcha resolving [%s]" % res)
if "SUCCESS" in res:
self.captcha.correct()
- return True
+
elif "ERROR:SESSION ERROR" in res:
self.retry()
- self.captcha.invalid()
+ else:
+ self.retry_captcha()
getInfo = create_getInfo(BitshareCom)