summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/CatShareNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hoster/CatShareNet.py')
-rw-r--r--pyload/plugins/hoster/CatShareNet.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/pyload/plugins/hoster/CatShareNet.py b/pyload/plugins/hoster/CatShareNet.py
index 36f2ea441..051ce2e99 100644
--- a/pyload/plugins/hoster/CatShareNet.py
+++ b/pyload/plugins/hoster/CatShareNet.py
@@ -9,7 +9,7 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class CatShareNet(SimpleHoster):
__name__ = "CatShareNet"
__type__ = "hoster"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}'
@@ -18,18 +18,24 @@ class CatShareNet(SimpleHoster):
__author_mail__ = ("z00nx0@gmail.com", None, "vuolter@gmail.com")
+ TEXT_ENCODING = True
+
FILE_INFO_PATTERN = r'<title>(?P<N>.+) \((?P<S>[\d.]+) (?P<U>\w+)\)<'
OFFLINE_PATTERN = r'Podany plik został usunięty\s*</div>'
IP_BLOCKED_PATTERN = r'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<'
- SECONDS_PATTERN = 'var count = (\d+);'
- RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy"
+ SECONDS_PATTERN = 'var\scount\s=\s(\d+);'
LINK_PATTERN = r'<form action="(.+?)" method="GET">'
+ def setup(self):
+ self.multiDL = self.premium
+ self.resumeDownload = True
+
+
def getFileInfo(self):
m = re.search(self.IP_BLOCKED_PATTERN, self.html)
- if m is None:
+ if m:
self.fail("Only connections from Polish IP address are allowed")
return super(CatShareNet, self).getFileInfo()
@@ -41,7 +47,12 @@ class CatShareNet(SimpleHoster):
self.wait(wait_time, True)
recaptcha = ReCaptcha(self)
- challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY)
+
+ captcha_key = recaptcha.detect_key()
+ if captcha_key is None:
+ self.parseError("ReCaptcha key not found")
+
+ challenge, code = recaptcha.challenge(captcha_key)
self.html = self.load(self.pyfile.url,
post={'recaptcha_challenge_field': challenge,
'recaptcha_response_field': code})
@@ -52,7 +63,7 @@ class CatShareNet(SimpleHoster):
self.retry(reason="Wrong captcha entered")
dl_link = m.group(1)
- self.download(dl_link)
+ self.download(dl_link, disposition=True)
getInfo = create_getInfo(CatShareNet)