summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-02 22:46:15 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-02 22:46:15 +0100
commita372550e6eaf0d0235e68f2d20535123410e121f (patch)
treea4e3362865206e7ab585b190c6737f94254958cc /module/plugins
parent[XFileSharingPro] Fix hoster and crypter plugins (diff)
downloadpyload-a372550e6eaf0d0235e68f2d20535123410e121f.tar.xz
[LetitbitNet][Share4webCom][UnibytesCom] https support + use urljoin + update PATTERNs
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hoster/LetitbitNet.py16
-rw-r--r--module/plugins/hoster/Share4webCom.py6
-rw-r--r--module/plugins/hoster/UnibytesCom.py17
3 files changed, 20 insertions, 19 deletions
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index b370544ee..aacd74f7a 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -9,6 +9,7 @@
import re
from urllib import urlencode, urlopen
+from urlparse import urljoin
from module.common.json_layer import json_loads, json_dumps
from module.plugins.hoster.UnrestrictLi import secondsToMidnight
@@ -36,9 +37,9 @@ def getInfo(urls):
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
- __version__ = "0.25"
+ __version__ = "0.26"
- __pattern__ = r'http://(?:www\.)?(letitbit|shareflare)\.net/download/.*'
+ __pattern__ = r'https?://(?:www\.)?(letitbit|shareflare)\.net/download/.*'
__description__ = """Letitbit.net hoster plugin"""
__license__ = "GPLv3"
@@ -46,9 +47,7 @@ class LetitbitNet(SimpleHoster):
("z00nx", "z00nx0@gmail.com")]
- FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")]
-
- HOSTER_NAME = "letitbit.net"
+ URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")]
SECONDS_PATTERN = r'seconds\s*=\s*(\d+);'
CAPTCHA_CONTROL_FIELD = r'recaptcha_control_field\s=\s\'(?P<value>.+?)\''
@@ -73,12 +72,11 @@ class LetitbitNet(SimpleHoster):
if not action:
self.error(_("ifree_form"))
- domain = "http://www." + self.HOSTER_NAME
self.pyfile.size = float(inputs['sssize'])
self.logDebug(action, inputs)
inputs['desc'] = ""
- self.html = self.load(domain + action, post=inputs, cookies=True)
+ self.html = self.load(urljoin("http://letitbit.net/", action), post=inputs, cookies=True)
m = re.search(self.SECONDS_PATTERN, self.html)
seconds = int(m.group(1)) if m else 60
@@ -88,7 +86,7 @@ class LetitbitNet(SimpleHoster):
self.logDebug("ReCaptcha control field found", recaptcha_control_field)
self.wait(seconds)
- response = self.load("%s/ajax/download3.php" % domain, post=" ", cookies=True)
+ response = self.load("http://letitbit.net/ajax/download3.php", post=" ", cookies=True)
if response != '1':
self.error(_("Unknown response - ajax_check_url"))
self.logDebug(response)
@@ -99,7 +97,7 @@ class LetitbitNet(SimpleHoster):
post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response,
"recaptcha_control_field": recaptcha_control_field}
self.logDebug("Post data to send", post_data)
- response = self.load('%s/ajax/check_recaptcha.php' % domain, post=post_data, cookies=True)
+ response = self.load("http://letitbit.net/ajax/check_recaptcha.php", post=post_data, cookies=True)
self.logDebug(response)
if not response:
self.invalidCaptcha()
diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py
index c2ede1d19..4634917ad 100644
--- a/module/plugins/hoster/Share4webCom.py
+++ b/module/plugins/hoster/Share4webCom.py
@@ -7,16 +7,16 @@ from module.plugins.internal.SimpleHoster import create_getInfo
class Share4webCom(UnibytesCom):
__name__ = "Share4webCom"
__type__ = "hoster"
- __version__ = "0.1"
+ __version__ = "0.11"
- __pattern__ = r'http://(?:www\.)?share4web\.com/get/\w+'
+ __pattern__ = r'https?://(?:www\.)?share4web\.com/get/\w+'
__description__ = """Share4web.com hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- HOSTER_NAME = "share4web.com"
+ HOSTER_DOMAIN = "share4web.com"
getInfo = create_getInfo(UnibytesCom)
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index abad66579..8c39cce82 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -2,6 +2,8 @@
import re
+from urlparse import urljoin
+
from pycurl import FOLLOWLOCATION
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -10,30 +12,31 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UnibytesCom(SimpleHoster):
__name__ = "UnibytesCom"
__type__ = "hoster"
- __version__ = "0.1"
+ __version__ = "0.11"
- __pattern__ = r'http://(?:www\.)?unibytes\.com/[\w .-]{11}B'
+ __pattern__ = r'https?://(?:www\.)?unibytes\.com/[\w .-]{11}B'
__description__ = """UniBytes.com hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- FILE_INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)'
+ HOSTER_DOMAIN = "unibytes.com"
+
+ INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)'
- HOSTER_NAME = "unibytes.com"
WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec'
LINK_PATTERN = r'<a href="([^"]+)">Download</a>'
def handleFree(self):
- domain = "http://www." + self.HOSTER_NAME
+ domain = "http://www.%s/" % self.HOSTER_DOMAIN
action, post_data = self.parseHtmlForm('id="startForm"')
self.req.http.c.setopt(FOLLOWLOCATION, 0)
for _i in xrange(8):
self.logDebug(action, post_data)
- self.html = self.load(domain + action, post=post_data)
+ self.html = self.load(urljoin(domain, action), post=post_data)
m = re.search(r'location:\s*(\S+)', self.req.http.header, re.I)
if m:
@@ -60,7 +63,7 @@ class UnibytesCom(SimpleHoster):
m = re.search(self.WAIT_PATTERN, self.html)
self.wait(int(m.group(1)) if m else 60, False)
elif last_step in ("captcha", "last"):
- post_data['captcha'] = self.decryptCaptcha(domain + '/captcha.jpg')
+ post_data['captcha'] = self.decryptCaptcha(urljoin(domain, "/captcha.jpg"))
else:
self.fail(_("No valid captcha code entered"))