summaryrefslogtreecommitdiffstats
path: root/Plugins/GigasizeCom.py
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-06-18 15:05:25 +0200
committerGravatar spoob <spoob@gmx.de> 2009-06-18 15:05:25 +0200
commitb82662e8c9ac9ff0047f75a04f350dc880eb330f (patch)
tree037c5d1784a0321da92e75c3cfd3ee4f2957ea60 /Plugins/GigasizeCom.py
parentplugin for gigasize (diff)
downloadpyload-b82662e8c9ac9ff0047f75a04f350dc880eb330f.tar.xz
worked on gigasize.com Plugin
Diffstat (limited to 'Plugins/GigasizeCom.py')
-rw-r--r--Plugins/GigasizeCom.py31
1 files changed, 21 insertions, 10 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)