summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/CatShareNet.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-24 17:16:34 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-24 17:16:34 +0100
commit3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a (patch)
treeb01e2c881aaf744aaab0af613a7a26e7129f2028 /module/plugins/hoster/CatShareNet.py
parententer captchas on webui (diff)
parentRapidgator: fixed bug #47 (diff)
downloadpyload-3ae2fbb170ad0f2bfe1ebf7f59e76d3645861f0a.tar.xz
Merge remote-tracking branch 'origin/stable'
Conflicts: module/plugins/accounts/FilesonicCom.py module/plugins/accounts/OronCom.py module/plugins/accounts/ShareonlineBiz.py module/plugins/addons/UpdateManager.py module/plugins/crypter/FilesonicComFolder.py module/plugins/hoster/BezvadataCz.py module/plugins/hoster/EuroshareEu.py module/plugins/hoster/FilesonicCom.py module/plugins/hoster/MegauploadCom.py module/plugins/hoster/Premium4Me.py module/plugins/hoster/YoutubeCom.py module/plugins/internal/MultiHoster.py module/utils.py
Diffstat (limited to 'module/plugins/hoster/CatShareNet.py')
-rw-r--r--module/plugins/hoster/CatShareNet.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py
new file mode 100644
index 000000000..47063096e
--- /dev/null
+++ b/module/plugins/hoster/CatShareNet.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import re
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.plugins.ReCaptcha import ReCaptcha
+
+
+class CatShareNet(SimpleHoster):
+ __name__ = "CatShareNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?catshare.net/\w{16}.*"
+ __version__ = "0.01"
+ __description__ = """CatShare.net Download Hoster"""
+ __author_name__ = ("z00nx")
+ __author_mail__ = ("z00nx0@gmail.com")
+
+ FILE_INFO_PATTERN = r'<h3 class="pull-left"[^>]+>(?P<N>.*)</h3>\s+<h3 class="pull-right"[^>]+>(?P<S>.*)</h3>'
+ FILE_OFFLINE_PATTERN = r'Podany plik zosta'
+ SECONDS_PATTERN = 'var\s+count\s+=\s+(\d+);'
+ RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy"
+
+ def handleFree(self):
+ found = re.search(self.SECONDS_PATTERN, self.html)
+ seconds = int(found.group(1))
+ self.logDebug("Seconds found", seconds)
+ self.setWait(seconds + 1)
+ self.wait()
+ recaptcha = ReCaptcha(self)
+ challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY)
+ post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code}
+ self.download(self.pyfile.url, post=post_data)
+ check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")})
+ if check == "html":
+ self.logDebug("Wrong captcha entered")
+ self.invalidCaptcha()
+ self.retry()
+
+getInfo = create_getInfo(CatShareNet)