summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-06-04 23:31:45 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-06-04 23:31:45 +0200
commita6e9a846137688bd7e5b1dea61e41831324ba3a7 (patch)
treec0942954b31a70edced99a036a09e8f0ec074dd2 /module
parentadded buggy Zippyshare.com Download Plugin, fixed gettext bug (diff)
downloadpyload-a6e9a846137688bd7e5b1dea61e41831324ba3a7.tar.xz
request fix
Diffstat (limited to 'module')
-rwxr-xr-xmodule/network/Request.py5
-rw-r--r--module/thread_list.py1
2 files changed, 5 insertions, 1 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index 8725d0607..1bf8c8255 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -102,7 +102,10 @@ class Request:
file = open(filename, 'wb')
req = urllib2.Request(url)
conn = self.downloader.open(req, post)
- self.dl_size = int(conn.headers["content-length"])
+ if conn.headers.has_key("content-length"):
+ self.dl_size = int(conn.headers["content-length"])
+ else:
+ self.dl_size = 0
self.dl_arrived = 0
self.dl_time = time.time()
for chunk in conn:
diff --git a/module/thread_list.py b/module/thread_list.py
index 8ae78b089..dc77c6730 100644
--- a/module/thread_list.py
+++ b/module/thread_list.py
@@ -18,6 +18,7 @@
#
###
#python
+from __future__ import with_statement
import re
import subprocess
import time