summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SpeedLoadOrg.py
diff options
context:
space:
mode:
authorGravatar z00nx <z00nx0@gmail.com> 2013-01-20 02:34:11 +0100
committerGravatar z00nx <z00nx0@gmail.com> 2013-01-20 02:34:11 +0100
commit1da646a91a394b60761ef7f9aea8bf7ceb710836 (patch)
tree689ff92491e9c7e6cc05242e227e35cda78b9452 /module/plugins/hoster/SpeedLoadOrg.py
parentMerged in z00nx0/pyload/CloudzerNet (pull request #50: Fixes the issue with d... (diff)
downloadpyload-1da646a91a394b60761ef7f9aea8bf7ceb710836.tar.xz
Added SpeedLoadOrg plugin
Diffstat (limited to 'module/plugins/hoster/SpeedLoadOrg.py')
-rw-r--r--module/plugins/hoster/SpeedLoadOrg.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py
new file mode 100644
index 000000000..d5e89b93f
--- /dev/null
+++ b/module/plugins/hoster/SpeedLoadOrg.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
+from module.network.RequestFactory import getURL
+from module.plugins.ReCaptcha import ReCaptcha
+import re
+
+
+def getInfo(urls):
+ for url in urls:
+ header = getURL(url, just_header=True)
+ if 'Location: http://speedload.org/index.php' in header:
+ file_info = (url, 0, 1, url)
+ else:
+ file_info = parseFileInfo(SpeedLoadOrg, url, getURL(url, decode=True))
+ yield file_info
+
+
+class SpeedLoadOrg(SimpleHoster):
+ __name__ = "SpeedLoadOrg"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?speedload\.org/(?P<ID>\w+).*"
+ __version__ = "0.01"
+ __description__ = """Speedload.org hoster plugin"""
+ __author_name__ = ("z00nx")
+ __author_mail__ = ("z00nx0@gmail.com")
+
+ FILE_NAME_PATTERN = '<div class="d_file[^>]+>\s+<div>\s+<div[^>]+>(?P<N>[^<]+)</div>'
+ FILE_SIZE_PATTERN = 'File Size:&nbsp;</span>(?P<S>[^<]+)</span>'
+ RECAPTCHA_KEY = '6LenSdkSAAAAAJyoP5jFZl4NNell2r4rzfXRZXGW'
+
+ def handleFree(self):
+ recaptcha = ReCaptcha(self)
+ self.load
+ challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
+ post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'submit': 'continue', 'submitted': '1', 'd': '1'}
+ 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()