summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/LetitbitNet.py
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-02-27 22:56:22 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-02-27 22:56:22 +0100
commit4d25665bb3e8cf7c22a9efc6a3bbf29f29856642 (patch)
tree43311c5f380582bd22c46d3d9a1b6fba83266845 /module/plugins/hoster/LetitbitNet.py
parentSingle "if" check instead of two. (diff)
downloadpyload-4d25665bb3e8cf7c22a9efc6a3bbf29f29856642.tar.xz
fixed #532, #543, letitbit, extabit, linkdecrypter; allow rs+nl.in free account
Diffstat (limited to 'module/plugins/hoster/LetitbitNet.py')
-rw-r--r--module/plugins/hoster/LetitbitNet.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 475f0931b..aed35e71b 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -19,12 +19,13 @@
import re
from random import random
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.common.json_layer import json_loads
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*letitbit.net/download/.*"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """letitbit.net"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -61,21 +62,36 @@ class LetitbitNet(SimpleHoster):
self.parseError("page 3 / js")
response = self.load(ajax_check_url, post = inputs, cookies = True)
- if response != '1': self.fail('Unknown response (ajax_check_url)')
+ if response != '1': self.parseError('Unknown response - ajax_check_url')
for i in range(5):
captcha = self.decryptCaptcha('%s/captcha_new.php?rand=%d' % (captcha_url, random() * 100000), cookies = True)
response = self.load(captcha_url + '/ajax/check_captcha.php', post = {"code": captcha}, cookies = True)
self.logDebug(response)
- if response.startswith('http://'):
- download_url = response
- self.correctCaptcha()
+ if not response:
+ self.invalidCaptcha()
+ elif response.startswith('['):
+ urls = json_loads(response)
+ break
+ elif response.startswith('http://'):
+ urls = [response]
break
else:
- self.invalidCaptcha()
+ self.parseError("Unknown response - captcha check")
+
else:
self.fail("No valid captcha solution received")
- self.download(download_url)
+ self.correctCaptcha()
+
+ for download_url in urls:
+ try:
+ self.logDebug("Download URL", download_url)
+ self.download(download_url)
+ break
+ except Exception, e:
+ self.logError(e)
+ else:
+ self.fail("Download did not finish correctly")
getInfo = create_getInfo(LetitbitNet) \ No newline at end of file