From f7b87385de7bb559422c5da1f9ef2ef768a6355b Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Wed, 22 Oct 2014 10:11:51 +0200 Subject: LoadTo.py] Improve checkDownload Sometimes, files are not downloaded properly. You receive a html-page instead of the desired file. It happens mostly on small files, but it isn't reproducable. Restarting the link solves the issue. --- module/plugins/hoster/LoadTo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 6f1fdb575..a28428b73 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -13,7 +13,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LoadTo(SimpleHoster): __name__ = "LoadTo" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'http://(?:www\.)?load\.to/\w+' @@ -60,11 +60,14 @@ class LoadTo(SimpleHoster): else: captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) - check = self.checkDownload({"404": re.compile("\A

404 Not Found

")}) + check = self.checkDownload({'404': re.compile("\A

404 Not Found

"), 'html': re.compile("html")}) if check == "404": self.logWarning("The captcha you entered was incorrect. Please try again.") self.invalidCaptcha() self.retry() + elif check == "html": + self.logWarning("Downloaded file is an html page, will retry") + self.retry() getInfo = create_getInfo(LoadTo) -- cgit v1.2.3