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.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py
index abd5c4d23..c47684522 100644
--- a/module/plugins/hoster/FilepostCom.py
+++ b/module/plugins/hoster/FilepostCom.py
@@ -3,15 +3,15 @@
import re
import time
-from module.plugins.internal.utils import json
+from module.plugins.internal.misc import json
from module.plugins.captcha.ReCaptcha import ReCaptcha
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.internal.SimpleHoster import SimpleHoster
class FilepostCom(SimpleHoster):
__name__ = "FilepostCom"
__type__ = "hoster"
- __version__ = "0.38"
+ __version__ = "0.39"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:filepost\.com/files|fp\.io)/(?P<ID>[^/]+)'
@@ -77,14 +77,15 @@ class FilepostCom(SimpleHoster):
self.link = self.get_json_response(get_dict, post_dict, 'link')
if not self.link:
- #: Solve recaptcha
- recaptcha = ReCaptcha(self)
- post_dict['recaptcha_response_field'], post_dict['recaptcha_challenge_field'] = recaptcha.challenge(captcha_key)
+ #: Solve ReCaptcha
+ self.captcha = ReCaptcha(pyfile)
+ post_dict['recaptcha_response_field'], post_dict['recaptcha_challenge_field'] = self.captcha.challenge(captcha_key)
self.link = self.get_json_response(get_dict, post_dict, 'link')
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))
+ html = self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict)
+ res = json.loads(html)
self.log_debug(res)
@@ -117,6 +118,3 @@ class FilepostCom(SimpleHoster):
self.error(_("JSON %s 2") % field)
return res['js']['answer'][field]
-
-
-getInfo = create_getInfo(FilepostCom)