summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/DailymotionCom.py4
-rw-r--r--module/plugins/hoster/FilefactoryCom.py4
-rw-r--r--module/plugins/hoster/FilerNet.py20
-rw-r--r--module/plugins/hoster/GigapetaCom.py22
-rw-r--r--module/plugins/hoster/QuickshareCz.py13
-rw-r--r--module/plugins/hoster/StreamCz.py2
-rw-r--r--module/plugins/hoster/UnibytesCom.py10
-rw-r--r--module/plugins/hoster/UploadedTo.py2
8 files changed, 31 insertions, 46 deletions
diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py
index 63003dc06..73e119c8c 100644
--- a/module/plugins/hoster/DailymotionCom.py
+++ b/module/plugins/hoster/DailymotionCom.py
@@ -23,12 +23,16 @@ def get_info(urls):
if "error" in info or info['access_error']:
status = "offline"
+
else:
status = info['status']
+
if status in ("ready", "published"):
status = "online"
+
elif status in ("waiting", "processing"):
status = "temp. offline"
+
else:
status = "offline"
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 637f3b2e0..b134abf30 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -10,9 +10,11 @@ def get_info(urls):
for url in urls:
h = get_url(url, just_header=True)
m = re.search(r'Location: (.+)\r\n', h)
+
if m and not re.match(m.group(1), FilefactoryCom.__pattern__): #: It's a direct link! Skipping
yield (url, 0, 3, url)
- else: #: It's a standard html page
+ else:
+ #: It's a standard html page
yield parse_fileInfo(FilefactoryCom, url, get_url(url))
diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py
index 37c88dec7..db998f06d 100644
--- a/module/plugins/hoster/FilerNet.py
+++ b/module/plugins/hoster/FilerNet.py
@@ -48,19 +48,13 @@ class FilerNet(SimpleHoster):
recaptcha = ReCaptcha(self)
response, challenge = recaptcha.challenge()
- #@NOTE: Work-around for v0.4.9 just_header issue
- #@TODO: Check for v0.4.10
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
- self.load(pyfile.url, post={'recaptcha_challenge_field': challenge,
- 'recaptcha_response_field' : response,
- 'hash' : inputs['hash']})
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
-
- if 'location' in self.req.http.header.lower():
- self.captcha.correct()
- self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1)
- else:
- self.retry_captcha()
+ header = self.load(pyfile.url,
+ post={'recaptcha_challenge_field': challenge,
+ 'recaptcha_response_field' : response,
+ 'hash' : inputs['hash']},
+ just_header=True)
+
+ self.link = header.get('location')
getInfo = create_getInfo(FilerNet)
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index 85e5e4843..da2f82f8f 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -34,26 +34,16 @@ class GigapetaCom(SimpleHoster):
captcha_key = str(random.randint(1, 100000000))
captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
-
self.check_errors()
captcha = self.captcha.decrypt(captcha_url)
- self.html = self.load(pyfile.url, post={
- 'captcha_key': captcha_key,
- 'captcha': captcha,
- 'download': "Download"})
-
- m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
- if m is not None:
- self.captcha.correct()
- self.link = m.group(1)
-
- elif "Entered figures don`t coincide with the picture" in self.html:
- self.retry_captcha()
-
+ header = self.load(pyfile.url,
+ post={'captcha_key': captcha_key,
+ 'captcha' : captcha,
+ 'download' : "Download"},
+ just_header=True)
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
+ self.link = header.get('location')
getInfo = create_getInfo(GigapetaCom)
diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py
index 62240667c..1bbc05d87 100644
--- a/module/plugins/hoster/QuickshareCz.py
+++ b/module/plugins/hoster/QuickshareCz.py
@@ -60,14 +60,11 @@ class QuickshareCz(SimpleHoster):
data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID3", "ID4"))
self.log_debug("FREE URL1:" + download_url, data)
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
- self.load(download_url, post=data)
- self.header = self.req.http.header
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
-
- m = re.search(r'Location\s*:\s*(.+)', self.header, re.I)
- if m is None:
- self.fail(_("File not found"))
+ header = self.load(download_url, post=data, just_header=True)
+
+ self.link = header.get('location')
+ if not self.link:
+ elf.fail(_("File not found"))
self.link = m.group(1)
self.log_debug("FREE URL2:" + self.link)
diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py
index a5578fd96..632a2933e 100644
--- a/module/plugins/hoster/StreamCz.py
+++ b/module/plugins/hoster/StreamCz.py
@@ -10,13 +10,13 @@ def get_info(urls):
result = []
for url in urls:
-
html = get_url(url)
if re.search(StreamCz.OFFLINE_PATTERN, html):
#: File offline
result.append((url, 0, 1, url))
else:
result.append((url, 0, 2, url))
+
yield result
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index c0bb6a13b..f06bd4421 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -30,14 +30,14 @@ class UnibytesCom(SimpleHoster):
def handle_free(self, pyfile):
- domain = "http://www.%s/" % self.PLUGIN_DOMAIN
+ domain = "http://www.%s/" % self.PLUGIN_DOMAIN
action, post_data = self.parse_html_form('id="startForm"')
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
-
for _i in xrange(3):
self.log_debug(action, post_data)
- self.html = self.load(urlparse.urljoin(domain, action), post=post_data)
+ self.html = self.load(urlparse.urljoin(domain, action),
+ post=post_data,
+ redirect=False)
m = re.search(r'location:\s*(\S+)', self.req.http.header, re.I)
if m is not None:
@@ -67,7 +67,5 @@ class UnibytesCom(SimpleHoster):
elif last_step in ("captcha", "last"):
post_data['captcha'] = self.captcha.decrypt(urlparse.urljoin(domain, "captcha.jpg"))
- self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
-
getInfo = create_getInfo(UnibytesCom)
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index a3b9fbc2f..265fefe8a 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -46,7 +46,7 @@ class UploadedTo(SimpleHoster):
for _i in xrange(5):
html = get_url("http://uploaded.net/api/filemultiple",
get={'apikey': cls.API_KEY,
- 'id_0': re.match(cls.__pattern__, url).group('ID')})
+ 'id_0' : re.match(cls.__pattern__, url).group('ID')})
if html != "can't find request":
api = html.split(",", 4)