diff options
author | Paul King <devnull@localhost> | 2011-06-01 20:38:41 +0200 |
---|---|---|
committer | Paul King <devnull@localhost> | 2011-06-01 20:38:41 +0200 |
commit | 48766816ee45476d69b28e44819af9a1ae86e97b (patch) | |
tree | 511b4c872fc9de086fbc5fe5cbde05ada9fd23e2 | |
parent | fixed last commit (diff) | |
download | pyload-48766816ee45476d69b28e44819af9a1ae86e97b.tar.xz |
tidy up wait code
-rw-r--r-- | module/plugins/hoster/FilesonicCom.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py index 9fb41dee9..cbe3aa9d8 100644 --- a/module/plugins/hoster/FilesonicCom.py +++ b/module/plugins/hoster/FilesonicCom.py @@ -133,8 +133,7 @@ class FilesonicCom(Hoster): if not finalUrl:
self.doWait(url)
- self.doWait(url) #TODO: why 2 wait? please investigate/fix
-
+
chall = re.search(self.CAPTCHA_TYPE1_PATTERN, self.html)
chall2 = re.search(self.CAPTCHA_TYPE2_PATTERN, self.html)
if chall or chall2:
@@ -174,8 +173,13 @@ class FilesonicCom(Hoster): def doWait(self, url):
# If the current page requires us to wait then wait and move to the next page as required
+
+ # There maybe more than one wait period. The extended wait if download limits have been exceeded (in which case we try reconnect)
+ # and the short wait before every download. Visually these are the same, the difference is that one includes a code to allow
+ # progress to the next page
+
waitSearch = re.search(self.WAIT_TIME_PATTERN, self.html)
- if waitSearch:
+ while waitSearch:
wait = int(waitSearch.group("wait"))
if wait > 300:
self.wantReconnect = True
@@ -192,9 +196,11 @@ class FilesonicCom(Hoster): tm_hash = tm_hash.group(1)
self.html = self.load(url, post={"tm":tm,"tm_hash":tm_hash})
self.handleErrors()
+ break
else:
self.html = self.load(url)
self.handleErrors()
+ waitSearch = re.search(self.WAIT_TIME_PATTERN, self.html)
def handleErrors(self):
if "This file is available for premium users only." in self.html:
|