From 525fcb6f3ea22dcae94743c1267a689be5c91bb2 Mon Sep 17 00:00:00 2001 From: Jeix Date: Wed, 13 Oct 2010 23:26:28 +0200 Subject: no poem today, but FileserveCom fix --- module/plugins/hoster/FileserveCom.py | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index c2deb3751..b882ba7ea 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -84,7 +84,7 @@ class FileserveCom(Hoster): wait_time = int( m.group(1) ) self.wantReconnect = True - if r'Your download link has expired.' in html: + if r'Your download link has expired' in html: self.retry() self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait_time)) @@ -93,22 +93,14 @@ class FileserveCom(Hoster): self.load(self.pyfile.url, post={"downloadLink":"show"}) - self.load(self.pyfile.url, post={"download":"normal"}, just_header=True) - dl = self.download(self.pyfile.url, post={"download":"normal"}) - - size = stat(dl) - size = size.st_size - - if size < 40000: - f = open(dl, "rb") - content = f.read() - m = re.search(r'', content) - if m is not None: - self.setWait(720) - self.wantReconnect = True - self.wait() - self.handleFree() - return - - - #TODO: validate download it could be html file with errors + html = self.load(self.pyfile.url, post={"download":"normal"}) + m = re.search(r'You need to wait (\d+) seconds to start another download', html) + if m: + wait_time = int(m.group(1)) + self.setWait(wait_time) + self.log.debug("%s: You need to wait %d seconds for another download." % (self.__name__, wait_time)) + self.wantReconnect = True + self.wait() + self.retry() + + self.download(self.pyfile.url, post={"download":"normal"}) -- cgit v1.2.3