summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BitshareCom.py8
-rw-r--r--module/plugins/hoster/CatShareNet.py4
-rw-r--r--module/plugins/hoster/DlFreeFr.py8
-rw-r--r--module/plugins/hoster/FilecloudIo.py6
-rw-r--r--module/plugins/hoster/FilepostCom.py37
-rw-r--r--module/plugins/hoster/FileserveCom.py6
-rw-r--r--module/plugins/hoster/IfileIt.py27
-rw-r--r--module/plugins/hoster/KingfilesNet.py30
-rw-r--r--module/plugins/hoster/LoadTo.py7
-rw-r--r--module/plugins/hoster/MediafireCom.py8
-rw-r--r--module/plugins/hoster/RapidgatorNet.py10
-rw-r--r--module/plugins/hoster/RapiduNet.py12
-rw-r--r--module/plugins/hoster/UploadableCh.py4
-rw-r--r--module/plugins/hoster/UploadedTo.py4
-rw-r--r--module/plugins/hoster/UpstoreNet.py6
15 files changed, 94 insertions, 83 deletions
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index 1483e5d1e..17d29680e 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -115,10 +115,12 @@ class BitshareCom(SimpleHoster):
# Try up to 3 times
for i in xrange(3):
- challenge, code = recaptcha.challenge()
+ challenge, response = 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": code})
+ post={"request" : "validateCaptcha",
+ "ajaxid" : self.ajaxid,
+ "recaptcha_challenge_field": challenge,
+ "recaptcha_response_field" : response})
if self.handleCaptchaErrors(res):
break
diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py
index 0caac5913..949a021dd 100644
--- a/module/plugins/hoster/CatShareNet.py
+++ b/module/plugins/hoster/CatShareNet.py
@@ -50,10 +50,10 @@ class CatShareNet(SimpleHoster):
recaptcha = ReCaptcha(self)
- challenge, code = recaptcha.challenge()
+ challenge, response = recaptcha.challenge()
self.html = self.load(self.pyfile.url,
post={'recaptcha_challenge_field': challenge,
- 'recaptcha_response_field': code})
+ 'recaptcha_response_field' : response})
m = re.search(self.LINK_PATTERN, self.html)
if m is None:
diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py
index f07d46768..14b74c779 100644
--- a/module/plugins/hoster/DlFreeFr.py
+++ b/module/plugins/hoster/DlFreeFr.py
@@ -103,11 +103,11 @@ class AdYouLike:
if not response:
self.plugin.fail("AdYouLike result failed")
- return {"_ayl_captcha_engine": self.engine,
- "_ayl_env": ayl['all']['env'],
- "_ayl_tid": challenge['tid'],
+ return {"_ayl_captcha_engine" : self.engine,
+ "_ayl_env" : ayl['all']['env'],
+ "_ayl_tid" : challenge['tid'],
"_ayl_token_challenge": challenge['token'],
- "_ayl_response": response}
+ "_ayl_response" : response}
class DlFreeFr(SimpleHoster):
diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py
index 495f2268d..cb9782f23 100644
--- a/module/plugins/hoster/FilecloudIo.py
+++ b/module/plugins/hoster/FilecloudIo.py
@@ -58,9 +58,9 @@ class FilecloudIo(SimpleHoster):
if not self.account:
self.fail(_("User not logged in"))
elif not self.account.logged_in:
- captcha_challenge, captcha_response = recaptcha.challenge(captcha_key)
- self.account.form_data = {"recaptcha_challenge_field": captcha_challenge,
- "recaptcha_response_field": captcha_response}
+ challenge, response = recaptcha.challenge(captcha_key)
+ self.account.form_data = {"recaptcha_challenge_field": challenge,
+ "recaptcha_response_field" : response}
self.account.relogin(self.user)
self.retry(2)
diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py
index db5ea20d3..b94892ef4 100644
--- a/module/plugins/hoster/FilepostCom.py
+++ b/module/plugins/hoster/FilepostCom.py
@@ -92,36 +92,39 @@ class FilepostCom(SimpleHoster):
def getJsonResponse(self, get_dict, post_dict, field):
- json_response = json_loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict))
- self.logDebug(json_response)
+ res = json_loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict))
- if not 'js' in json_response:
+ self.logDebug(res)
+
+ if not 'js' in res:
self.error(_("JSON %s 1") % field)
- # i changed js_answer to json_response['js'] since js_answer is nowhere set.
+ # i changed js_answer to res['js'] since js_answer is nowhere set.
# i don't know the JSON-HTTP specs in detail, but the previous author
- # accessed json_response['js']['error'] as well as js_answer['error'].
+ # accessed res['js']['error'] as well as js_answer['error'].
# see the two lines commented out with "# ~?".
- if 'error' in json_response['js']:
- if json_response['js']['error'] == 'download_delay':
- self.retry(wait_time=json_response['js']['params']['next_download'])
+ if 'error' in res['js']:
+
+ if res['js']['error'] == 'download_delay':
+ self.retry(wait_time=res['js']['params']['next_download'])
# ~? self.retry(wait_time=js_answer['params']['next_download'])
- elif 'Wrong file password' in json_response['js']['error']:
- return None
- elif 'You entered a wrong CAPTCHA code' in json_response['js']['error']:
- return None
- elif 'CAPTCHA Code nicht korrekt' in json_response['js']['error']:
+
+ elif ('Wrong file password' in res['js']['error']
+ or 'You entered a wrong CAPTCHA code' in res['js']['error']
+ or 'CAPTCHA Code nicht korrekt' in res['js']['error']):
return None
- elif 'CAPTCHA' in json_response['js']['error']:
+
+ elif 'CAPTCHA' in res['js']['error']:
self.logDebug("Error response is unknown, but mentions CAPTCHA")
return None
+
else:
- self.fail(json_response['js']['error'])
+ self.fail(res['js']['error'])
- if not 'answer' in json_response['js'] or not field in json_response['js']['answer']:
+ if not 'answer' in res['js'] or not field in res['js']['answer']:
self.error(_("JSON %s 2") % field)
- return json_response['js']['answer'][field]
+ return res['js']['answer'][field]
getInfo = create_getInfo(FilepostCom)
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py
index 82d40fba6..871a3dd26 100644
--- a/module/plugins/hoster/FileserveCom.py
+++ b/module/plugins/hoster/FileserveCom.py
@@ -159,10 +159,10 @@ class FileserveCom(Hoster):
recaptcha = ReCaptcha(self)
for _i in xrange(5):
- challenge, code = recaptcha.challenge(captcha_key)
+ challenge, response = recaptcha.challenge(captcha_key)
res = json_loads(self.load(self.URLS[2],
- post={'recaptcha_challenge_field': challenge,
- 'recaptcha_response_field': code,
+ post={'recaptcha_challenge_field' : challenge,
+ 'recaptcha_response_field' : response,
'recaptcha_shortencode_field': self.file_id}))
if not res['success']:
self.invalidCaptcha()
diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py
index b7e37457d..2dae4cd80 100644
--- a/module/plugins/hoster/IfileIt.py
+++ b/module/plugins/hoster/IfileIt.py
@@ -27,27 +27,30 @@ class IfileIt(SimpleHoster):
def handleFree(self):
- ukey = re.match(self.__pattern__, self.pyfile.url).group(1)
- json_url = 'http://ifile.it/new_download-request.json'
+ ukey = re.match(self.__pattern__, self.pyfile.url).group(1)
+ json_url = 'http://ifile.it/new_download-request.json'
post_data = {"ukey": ukey, "ab": "0"}
+ res = json_loads(self.load(json_url, post=post_data))
- json_response = json_loads(self.load(json_url, post=post_data))
- self.logDebug(json_response)
- if json_response['status'] == 3:
+ self.logDebug(res)
+
+ if res['status'] == 3:
self.offline()
- if json_response['captcha']:
+ if res['captcha']:
captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1)
recaptcha = ReCaptcha(self)
post_data['ctype'] = "recaptcha"
for _i in xrange(5):
- post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key)
- json_response = json_loads(self.load(json_url, post=post_data))
- self.logDebug(json_response)
+ challenge, response = recaptcha.challenge(captcha_key)
+ post_data.update({'recaptcha_challenge': challenge,
+ 'recaptcha_response' : response})
+ res = json_loads(self.load(json_url, post=post_data))
+ self.logDebug(res)
- if json_response['retry']:
+ if res['retry']:
self.invalidCaptcha()
else:
self.correctCaptcha()
@@ -55,10 +58,10 @@ class IfileIt(SimpleHoster):
else:
self.fail(_("Incorrect captcha"))
- if not "ticket_url" in json_response:
+ if not "ticket_url" in res:
self.error(_("No download URL"))
- self.download(json_response['ticket_url'])
+ self.download(res['ticket_url'])
getInfo = create_getInfo(IfileIt)
diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py
index c84e3bb0f..13cbf4781 100644
--- a/module/plugins/hoster/KingfilesNet.py
+++ b/module/plugins/hoster/KingfilesNet.py
@@ -36,17 +36,17 @@ class KingfilesNet(SimpleHoster):
def handleFree(self):
# Click the free user button
- post_data = {'op': "download1",
- 'usr_login': "",
- 'id': self.info['pattern']['ID'],
- 'fname': self.pyfile.name,
- 'referer': "",
+ post_data = {'op' : "download1",
+ 'usr_login' : "",
+ 'id' : self.info['pattern']['ID'],
+ 'fname' : self.pyfile.name,
+ 'referer' : "",
'method_free': "+"}
self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True)
solvemedia = SolveMedia(self)
- captcha_challenge, captcha_response = solvemedia.challenge()
+ challenge, response = solvemedia.challenge()
# Make the downloadlink appear and load the file
m = re.search(self.RAND_ID_PATTERN, self.html)
@@ -56,15 +56,15 @@ class KingfilesNet(SimpleHoster):
rand = m.group(1)
self.logDebug("rand = ", rand)
- post_data = {'op': "download2",
- 'id': self.info['pattern']['ID'],
- 'rand': rand,
- 'referer': self.pyfile.url,
- 'method_free': "+",
- 'method_premium': "",
- 'adcopy_response': captcha_response,
- 'adcopy_challenge': captcha_challenge,
- 'down_direct': "1"}
+ post_data = {'op' : "download2",
+ 'id' : self.info['pattern']['ID'],
+ 'rand' : rand,
+ 'referer' : self.pyfile.url,
+ 'method_free' : "+",
+ 'method_premium' : "",
+ 'adcopy_response' : response,
+ 'adcopy_challenge': challenge,
+ 'down_direct' : "1"}
self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True)
diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py
index 4e55496c6..0a5b26410 100644
--- a/module/plugins/hoster/LoadTo.py
+++ b/module/plugins/hoster/LoadTo.py
@@ -58,9 +58,12 @@ class LoadTo(SimpleHoster):
if captcha_key is None:
self.download(download_url)
else:
- captcha_challenge, captcha_response = solvemedia.challenge(captcha_key)
- self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response})
+ challenge, response = solvemedia.challenge(captcha_key)
+
+ self.download(download_url, post={"adcopy_challenge": challenge, "adcopy_response": response})
+
check = self.checkDownload({'404': re.compile("\A<h1>404 Not Found</h1>"), 'html': re.compile("html")})
+
if check == "404":
self.invalidCaptcha()
self.retry()
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index 3ed1199f6..cdfa410a9 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -117,6 +117,8 @@ class MediafireCom(SimpleHoster):
def checkCaptcha(self):
solvemedia = SolveMedia(self)
- captcha_challenge, captcha_response = solvemedia.challenge()
- self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge,
- "adcopy_response": captcha_response}, decode=True)
+ challenge, response = solvemedia.challenge()
+ self.html = self.load(self.url,
+ post={'adcopy_challenge': challenge,
+ 'adcopy_response' : response},
+ decode=True)
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index 7788616a8..cc11fa7c7 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -129,13 +129,11 @@ class RapidgatorNet(SimpleHoster):
break
else:
captcha, captcha_key = self.getCaptcha()
- captcha_challenge, captcha_response = captcha.challenge(captcha_key)
+ challenge, response = captcha.challenge(captcha_key)
- self.html = self.load(url, post={
- "DownloadCaptchaForm[captcha]": "",
- "adcopy_challenge": captcha_challenge,
- "adcopy_response": captcha_response
- })
+ self.html = self.load(url, post={'DownloadCaptchaForm[captcha]': "",
+ 'adcopy_challenge' : challenge,
+ 'adcopy_response' : response})
if "The verification code is incorrect" in self.html:
self.invalidCaptcha()
diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py
index e14b18a4f..a3b2cffcd 100644
--- a/module/plugins/hoster/RapiduNet.py
+++ b/module/plugins/hoster/RapiduNet.py
@@ -57,12 +57,12 @@ class RapiduNet(SimpleHoster):
recaptcha = ReCaptcha(self)
for _i in xrange(10):
- challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY)
+ challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
jsvars = self.getJsonResponse("https://rapidu.net/ajax.php?a=getCheckCaptcha",
{'_go' : None,
'captcha1': challenge,
- 'captcha2': code,
+ 'captcha2': response,
'fileId' : self.info['ID']})
if jsvars['message'] == 'success':
self.download(jsvars['url'])
@@ -70,13 +70,13 @@ class RapiduNet(SimpleHoster):
def getJsonResponse(self, url, post_data):
- response = self.load(url, post=post_data, decode=True)
- if not response.startswith('{'):
+ res = self.load(url, post=post_data, decode=True)
+ if not res.startswith('{'):
self.retry()
- self.logDebug(url, response)
+ self.logDebug(url, res)
- return json_loads(response)
+ return json_loads(res)
getInfo = create_getInfo(RapiduNet)
diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py
index 77b3d7d8a..3dd796900 100644
--- a/module/plugins/hoster/UploadableCh.py
+++ b/module/plugins/hoster/UploadableCh.py
@@ -53,13 +53,13 @@ class UploadableCh(SimpleHoster):
recaptcha = ReCaptcha(self)
- challenge, captcha = recaptcha.challenge(self.RECAPTCHA_KEY)
+ challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
# Submit the captcha solution
self.load("http://www.uploadable.ch/checkReCaptcha.php",
cookies=True,
post={'recaptcha_challenge_field' : challenge,
- 'recaptcha_response_field' : captcha,
+ 'recaptcha_response_field' : response,
'recaptcha_shortencode_field': self.info['ID']},
decode=True)
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 7af6501eb..833468a80 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -206,8 +206,8 @@ class UploadedTo(Hoster):
recaptcha = ReCaptcha(self)
for _i in xrange(5):
- challenge, result = recaptcha.challenge()
- options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result}
+ challenge, response = recaptcha.challenge()
+ options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response}
self.wait()
result = self.load(url, post=options)
diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py
index 239cc92f5..25c424f1f 100644
--- a/module/plugins/hoster/UpstoreNet.py
+++ b/module/plugins/hoster/UpstoreNet.py
@@ -52,9 +52,9 @@ class UpstoreNet(SimpleHoster):
self.wait(wait_time)
# then, handle the captcha
- challenge, code = recaptcha.challenge()
- post_data['recaptcha_challenge_field'] = challenge
- post_data['recaptcha_response_field'] = code
+ challenge, response = recaptcha.challenge()
+ post_data.update({'recaptcha_challenge_field': challenge,
+ 'recaptcha_response_field' : response})
self.html = self.load(self.pyfile.url, post=post_data, decode=True)