diff options
author | Jeix <devnull@localhost> | 2010-10-13 23:26:28 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-10-13 23:26:28 +0200 |
commit | 525fcb6f3ea22dcae94743c1267a689be5c91bb2 (patch) | |
tree | 3f58e30fc11cf52b0ecbfcaa4b1e49aac7d36c28 | |
parent | Work sometimes can be a bore, and really we want to just yawn and snore, Stor... (diff) | |
download | pyload-525fcb6f3ea22dcae94743c1267a689be5c91bb2.tar.xz |
no poem today, but FileserveCom fix
-rw-r--r-- | module/plugins/hoster/FileserveCom.py | 32 |
1 files changed, 12 insertions, 20 deletions
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'<html>', 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"})
|