summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FilepostCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/FilepostCom.py')
-rw-r--r--module/plugins/hoster/FilepostCom.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py
index b2891a9e8..30ea6a869 100644
--- a/module/plugins/hoster/FilepostCom.py
+++ b/module/plugins/hoster/FilepostCom.py
@@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilepostCom(SimpleHoster):
__name__ = "FilepostCom"
__type__ = "hoster"
- __version__ = "0.34"
+ __version__ = "0.35"
__pattern__ = r'https?://(?:www\.)?(?:filepost\.com/files|fp\.io)/(?P<ID>[^/]+)'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -29,7 +29,7 @@ class FilepostCom(SimpleHoster):
FLP_TOKEN_PATTERN = r'set_store_options\({token: \'(.+?)\''
- def handleFree(self, pyfile):
+ def handle_free(self, pyfile):
m = re.search(self.FLP_TOKEN_PATTERN, self.html)
if m is None:
self.error(_("Token"))
@@ -43,7 +43,7 @@ class FilepostCom(SimpleHoster):
#: Get wait time
get_dict = {'SID': self.req.cj.getCookie('SID'), 'JsHttpRequest': str(int(time.time() * 10000)) + '-xml'}
post_dict = {'action': 'set_download', 'token': flp_token, 'code': self.info['pattern']['ID']}
- wait_time = int(self.getJsonResponse(get_dict, post_dict, 'wait_time'))
+ wait_time = int(self.get_json_response(get_dict, post_dict, 'wait_time'))
if wait_time > 0:
self.wait(wait_time)
@@ -52,15 +52,15 @@ class FilepostCom(SimpleHoster):
if 'var is_pass_exists = true;' in self.html:
#: Solve password
- password = self.getPassword()
+ password = self.get_password()
if password:
- self.logInfo(_("Password protected link, trying ") + file_pass)
+ self.log_info(_("Password protected link, trying ") + file_pass)
get_dict['JsHttpRequest'] = str(int(time.time() * 10000)) + '-xml'
post_dict['file_pass'] = file_pass
- self.link = self.getJsonResponse(get_dict, post_dict, 'link')
+ self.link = self.get_json_response(get_dict, post_dict, 'link')
if not self.link:
self.fail(_("Incorrect password"))
@@ -76,19 +76,19 @@ class FilepostCom(SimpleHoster):
if i:
post_dict['recaptcha_response_field'], post_dict['recaptcha_challenge_field'] = recaptcha.challenge(
captcha_key)
- self.logDebug(u"RECAPTCHA: %s : %s : %s" % (
+ self.log_debug(u"RECAPTCHA: %s : %s : %s" % (
captcha_key, post_dict['recaptcha_challenge_field'], post_dict['recaptcha_response_field']))
- self.link = self.getJsonResponse(get_dict, post_dict, 'link')
+ self.link = self.get_json_response(get_dict, post_dict, 'link')
else:
self.fail(_("Invalid captcha"))
- def getJsonResponse(self, get_dict, post_dict, field):
+ def get_json_response(self, get_dict, post_dict, field):
res = json_loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict))
- self.logDebug(res)
+ self.log_debug(res)
if not 'js' in res:
self.error(_("JSON %s 1") % field)
@@ -109,7 +109,7 @@ class FilepostCom(SimpleHoster):
return None
elif 'CAPTCHA' in res['js']['error']:
- self.logDebug("Error response is unknown, but mentions CAPTCHA")
+ self.log_debug("Error response is unknown, but mentions CAPTCHA")
return None
else: