summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-17 00:20:38 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-17 00:20:38 +0200
commit746f877329bd8d62f58a3dbb2bdc5f2cd34c3d6a (patch)
treed549575edc2d9edcdb6b599ba44f3087d1eb2b6a
parentFreakshareNet, HotfileCom, StorageTo (diff)
downloadpyload-746f877329bd8d62f58a3dbb2bdc5f2cd34c3d6a.tar.xz
hotfile improvements
-rw-r--r--module/plugins/Plugin.py2
-rw-r--r--module/plugins/hoster/HotfileCom.py29
2 files changed, 26 insertions, 5 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index f64a5defb..dfdfbe4f6 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -204,7 +204,6 @@ class Plugin(object):
Ocr = self.core.pluginManager.getCaptchaPlugin(self.__name__)
if Ocr and not forceUser:
sleep(randint(3000, 5000) / 1000.0)
-
if self.pyfile.abort: raise Abort
ocr = Ocr()
@@ -220,6 +219,7 @@ class Plugin(object):
task.removeTask()
#temp.unlink(temp.name)
self.fail(_("No Client connected for captcha decrypting."))
+ if self.pyfile.abort: raise Abort
sleep(1)
result = task.getResult()
task.removeTask()
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py
index 5f1a5901e..691b2b8c0 100644
--- a/module/plugins/hoster/HotfileCom.py
+++ b/module/plugins/hoster/HotfileCom.py
@@ -4,6 +4,7 @@
import re
from time import time
from module.plugins.Hoster import Hoster
+from module.plugins.ReCaptcha import ReCaptcha
class HotfileCom(Hoster):
__name__ = "HotfileCom"
@@ -28,7 +29,7 @@ class HotfileCom(Hoster):
def process(self, pyfile):
self.pyfile = pyfile
self.prepare()
- self.download( self.get_file_url() )
+ self.get_file_url()
def prepare(self):
@@ -54,7 +55,7 @@ class HotfileCom(Hoster):
def download_html(self):
# if self.config['premium']:
# self.req.add_auth(self.config['username'], self.config['password'])
- self.html[0] = self.load(self.parent.url, get={"lang":"en"}, cookies=True)
+ self.html[0] = self.load(self.pyfile.url, get={"lang":"en"}, cookies=True)
def get_file_url(self):
# if self.config['premium']:
@@ -65,10 +66,30 @@ class HotfileCom(Hoster):
form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0)
form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content)
- self.html[1] = self.load(self.parent.url, post=form_posts, cookies=True)
+ self.html[1] = self.load(self.pyfile.url, post=form_posts, cookies=True)
+
+ re_captcha = ReCaptcha(self)
+
+ challenge = re.search(r"http://api.recaptcha.net/challenge\?k=([0-9A-Za-z]+)", self.html[1])
+
+ if challenge:
+ challenge, result = re_captcha.challenge(challenge.group(1))
+
+ url = re.search(r'<form action="(/dl/[^"]+)', self.html[1] )
+
+ self.html[1] = self.load("http://hotfile.com"+url.group(1), post={"action": "checkcaptcha",
+ "recaptcha_challenge_field" : result,
+ "recaptcha_response_field": "manual_challenge"})
+
+ if "Wrong Code. Please try again." in self.html[1]:
+ self.get_file_url()
+ return
+
+
file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.html[1]).group(1)
- return file_url
+ self.download(file_url)
+
def get_file_name(self):
file_name = re.search(r':</strong> (.+?) <span>\|</span>', self.html[0]).group(1)