summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ShragleCom.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2011-06-10 13:09:33 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2011-06-10 13:09:33 +0200
commita40cf88920e94490d5c851fb273b8d2f48aef6fb (patch)
tree8de448bbf50535901a35a26c2a145403ed166107 /module/plugins/hoster/ShragleCom.py
parenternieb's rapidshare patch (diff)
downloadpyload-a40cf88920e94490d5c851fb273b8d2f48aef6fb.tar.xz
ernieb's hoster patches
Diffstat (limited to 'module/plugins/hoster/ShragleCom.py')
-rw-r--r--module/plugins/hoster/ShragleCom.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py
index c1cef9f3e..9ebf4917b 100644
--- a/module/plugins/hoster/ShragleCom.py
+++ b/module/plugins/hoster/ShragleCom.py
@@ -35,8 +35,12 @@ class ShragleCom(Hoster):
def get_waiting_time(self):
if self.html is None:
self.download_html()
-
- return int(re.search('Please wait (\d+) seconds', self.html).group(1))
+
+ timestring = re.search('\s*var\sdownloadWait\s=\s(\d*);', self.html)
+ if timestring:
+ return int(timestring.group(1))
+ else:
+ return 10
def download_html(self):
self.html = self.load(self.pyfile.url)
@@ -58,8 +62,13 @@ class ShragleCom(Hoster):
if self.html is None:
self.download_html()
- file_name_pattern = r'You want to download \xc2\xbb<strong>(.*?)</strong>\xc2\xab'
- return re.search(file_name_pattern, self.html).group(1)
+ #file_name_pattern = r'You want to download \xc2\xbb<strong>(.*?)</strong>\xc2\xab'
+ file_name_pattern = r'<h2 class="colorgrey center" style="overflow:hidden;width:1000px;"> (.*)<br /><span style="font-size:12px;font-weight:normal; width:100px;"> ([\d\.]*) MB</span></h2>'
+ res = re.search(file_name_pattern, self.html)
+ if res:
+ return res.group(1)
+ else:
+ self.fail("filename cant be extracted")
def file_exists(self):
""" returns True or False