diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 09:25:04 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 09:25:04 +0200 |
commit | e339621f96e548e0710493dbdae4da807a54ebe8 (patch) | |
tree | 9387c55e1d7dd73bdaf55d206728e24b994d544a /module/plugins | |
parent | Update plugins after CaptchaService and XFileSharingPro changes (diff) | |
download | pyload-e339621f96e548e0710493dbdae4da807a54ebe8.tar.xz |
[OboomCom] Revert captcha changes
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/OboomCom.py | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 637735fd9..378e4c219 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -22,14 +22,38 @@ class OboomCom(Hoster): __author_mail__ = "stanley.foerster@gmail.com" + RECAPTCHA_KEY = "6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX" + + + def setup(self): + self.chunkLimit = 1 + self.multiDL = self.premium + + + def process(self, pyfile): + self.pyfile.url.replace(".com/#id=", ".com/#") + self.pyfile.url.replace(".com/#/", ".com/#") + self.getFileId(self.pyfile.url) + self.getSessionToken() + self.getFileInfo(self.sessionToken, self.fileId) + self.pyfile.name = self.fileName + self.pyfile.size = self.fileSize + if not self.premium: + self.solveCaptcha() + self.getDownloadTicket() + self.download("https://%s/1.0/dlh" % self.downloadDomain, get={"ticket": self.downloadTicket, "http_errors": 0}) + + def loadUrl(self, url, get=None): if get is None: get = dict() return json_loads(self.load(url, get, decode=True)) + def getFileId(self, url): self.fileId = re.match(OboomCom.__pattern__, url).group('ID') + def getSessionToken(self): if self.premium: accountInfo = self.account.getAccountInfo(self.user, True) @@ -45,15 +69,12 @@ class OboomCom(Hoster): else: self.fail("Could not retrieve token for guest session. Error code %s" % result[0]) + def solveCaptcha(self): recaptcha = ReCaptcha(self) - captcha_key = recaptcha.detect_key() - if captcha_key is None: - self.parseError("ReCaptcha key not found") - for _ in xrange(5): - challenge, response = recaptcha.challenge(captcha_key) + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) apiUrl = "https://www.oboom.com/1.0/download/ticket" params = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response, @@ -86,6 +107,7 @@ class OboomCom(Hoster): self.invalidCaptcha() self.fail("Received invalid captcha 5 times") + def getFileInfo(self, token, fileId): apiUrl = "https://api.oboom.com/1.0/info" params = {"token": token, "items": fileId, "http_errors": 0} @@ -101,6 +123,7 @@ class OboomCom(Hoster): else: self.fail("Could not retrieve file info. Error code %s: %s" % (result[0], result[1])) + def getDownloadTicket(self): apiUrl = "https://api.oboom.com/1.0/dl" params = {"item": self.fileId, "http_errors": 0} @@ -116,20 +139,3 @@ class OboomCom(Hoster): self.downloadTicket = result[2] else: self.fail("Could not retrieve download ticket. Error code %s" % result[0]) - - def setup(self): - self.chunkLimit = 1 - self.multiDL = self.premium - - def process(self, pyfile): - self.pyfile.url.replace(".com/#id=", ".com/#") - self.pyfile.url.replace(".com/#/", ".com/#") - self.getFileId(self.pyfile.url) - self.getSessionToken() - self.getFileInfo(self.sessionToken, self.fileId) - self.pyfile.name = self.fileName - self.pyfile.size = self.fileSize - if not self.premium: - self.solveCaptcha() - self.getDownloadTicket() - self.download("https://%s/1.0/dlh" % self.downloadDomain, get={"ticket": self.downloadTicket, "http_errors": 0}) |