summaryrefslogtreecommitdiffstats
path: root/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins')
-rw-r--r--Plugins/GigasizeCom.py31
-rw-r--r--Plugins/RapidshareCom.py1
-rw-r--r--Plugins/ZshareNet.py1
3 files changed, 22 insertions, 11 deletions
diff --git a/Plugins/GigasizeCom.py b/Plugins/GigasizeCom.py
index ef39cc3cc..bf8b3d97e 100644
--- a/Plugins/GigasizeCom.py
+++ b/Plugins/GigasizeCom.py
@@ -4,6 +4,7 @@
import os
import re
import tempfile
+from time import time
from Plugin import Plugin
@@ -30,14 +31,19 @@ class GigasizeCom(Plugin):
url = self.parent.url
self.html[0] = self.req.load(url, cookies=True)
- captcha_image = tempfile.NamedTemporaryFile().name + ".jpg"
- self.req.download("http://www.gigasize.com/randomImage.php", captcha_image, cookies=True)
- captcha = self.ocr.get_captcha(captcha_image)
+ captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name
+
+ for i in range(0,5):
+ self.req.download("http://www.gigasize.com/randomImage.php", captcha_image, cookies=True)
+ captcha = self.ocr.get_captcha(captcha_image)
+ self.html[1] = self.req.load("http://www.gigasize.com/formdownload.php", None, {"txtNumber": captcha}, cookies=True)
+
+ if re.search(r"Package features", self.html[1]) != None:
+ if re.search(r"YOU HAVE REACHED YOUR HOURLY LIMIT", self.html[1]) != None:
+ self.time_plus_wait = time() + 3600 #one hour
+ break
os.remove(captcha_image)
- print captcha
-
- self.html[1] = self.req.load(file_server_url, None, {"txtNumber": captcha}, cookies=True)
def get_file_url(self):
""" returns the absolute downloadable filepath
@@ -45,8 +51,13 @@ class GigasizeCom(Plugin):
if self.html[0] == None:
self.download_html()
if not self.want_reconnect:
- file_url_pattern = r"<form action=\"(/getcgi.php\?t=.*)\" method=\"post\" id=\"formDownload\">"
- return "http://gigazise.com" + re.search(file_url_pattern, self.html[1]).group(1)
+ file_url_pattern = '<form action="(/getcgi.php\?t=.*)" method="post" id="formDownload">'
+ search = re.search(file_url_pattern, self.html[1])
+ print search
+ if search:
+ return "http://gigazise.com" + search.group(1)
+ return ""
+
else:
return False
@@ -64,11 +75,11 @@ class GigasizeCom(Plugin):
"""
if self.html[0] == None:
self.download_html()
- if re.search(r"HTTP Status 404", self.html) != None:
+ if re.search(r"The file has been deleted", self.html[0]) != None:
return False
else:
return True
def proceed(self, url, location):
- self.req.download(url, location, cookies=True) \ No newline at end of file
+ self.req.download(url, location, cookies=True)
diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py
index 84f03b651..894deb4f7 100644
--- a/Plugins/RapidshareCom.py
+++ b/Plugins/RapidshareCom.py
@@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
import re
-import time
from time import time
from Plugin import Plugin
diff --git a/Plugins/ZshareNet.py b/Plugins/ZshareNet.py
index 33667605f..e81988454 100644
--- a/Plugins/ZshareNet.py
+++ b/Plugins/ZshareNet.py
@@ -34,6 +34,7 @@ class ZshareNet(Plugin):
url = url.replace("/audio/", "/download/")
elif "/image/" in url:
url = url.replace("/image/", "/download/")
+ print url
self.html[1] = self.req.load(url, None, {"download": "1"})
def get_file_url(self):