diff options
Diffstat (limited to 'pyload/plugins/hoster/OboomCom.py')
-rw-r--r-- | pyload/plugins/hoster/OboomCom.py | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/pyload/plugins/hoster/OboomCom.py b/pyload/plugins/hoster/OboomCom.py index 8c0d9d760..1571e8bd6 100644 --- a/pyload/plugins/hoster/OboomCom.py +++ b/pyload/plugins/hoster/OboomCom.py @@ -21,17 +21,39 @@ class OboomCom(Hoster): __author_name__ = "stanley" __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) @@ -47,8 +69,10 @@ class OboomCom(Hoster): else: self.fail("Could not retrieve token for guest session. Error code %s" % result[0]) + def solveCaptcha(self): recaptcha = ReCaptcha(self) + for _ in xrange(5): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) apiUrl = "https://www.oboom.com/1.0/download/ticket" @@ -83,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} @@ -98,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} @@ -113,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}) |