From 2fc9c89c9e8d6ba7631a206b0d3c798157e7c94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Tue, 15 Jan 2013 11:26:05 +0100 Subject: [PATCH] Increase dowloaded size when no length is given --- tools/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/web.py b/tools/web.py index 5dd2fba..22419f5 100644 --- a/tools/web.py +++ b/tools/web.py @@ -110,10 +110,10 @@ def getURLContent(url, timeout=15): try: res = conn.getresponse() - size = int(res.getheader("Content-Length", 5000)) + size = int(res.getheader("Content-Length", 200000)) cntype = res.getheader("Content-Type") - if size > 10000 or cntype[:4] != "text": + if size > 200000 or (cntype[:4] != "text" and cntype[:4] != "appl"): return None data = res.read(size)