summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-12-23 12:22:15 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-12-23 12:22:15 +0100
commit023cd7cb92a79e84c038869bdafee3f2ee003159 (patch)
tree24b13bc08c01ead22188813213eceaee97d7d227
parentfixed eta and progress, ready for first test (diff)
downloadpyload-023cd7cb92a79e84c038869bdafee3f2ee003159.tar.xz
fixed setting download size
-rw-r--r--module/PluginThread.py6
-rw-r--r--module/ThreadManager.py1
-rw-r--r--module/plugins/Plugin.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py
index d997fcde5..f008475c5 100644
--- a/module/PluginThread.py
+++ b/module/PluginThread.py
@@ -29,11 +29,12 @@ from sys import exc_info, exc_clear
from types import MethodType
from os.path import join, exists
+from urllib2 import URLError
+
from module.plugins.Plugin import Abort
from module.plugins.Plugin import Fail
from module.plugins.Plugin import Reconnect
from module.plugins.Plugin import Retry
-from pycurl import error
from module.FileDatabase import PyFile
########################################################################
@@ -212,7 +213,8 @@ class DownloadThread(PluginThread):
self.clean(pyfile)
continue
- except error, e:
+ except URLError, e:
+ #@TODO determine correct error codes
try:
code, msg = e.args
except:
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index e975f52a1..bb693d695 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -25,7 +25,6 @@ from threading import Event
from time import sleep
from traceback import print_exc
from random import choice
-#import pycurl
import PluginThread
from module.network.Request import getURL
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 0406923c0..6a7ec5b14 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -337,7 +337,7 @@ class Plugin(object):
self.pyfile.download = None
newname = basename(filename)
- self.pyfile.size = self.req.dl_size
+ self.pyfile.size = d.size
if newname and newname != name:
self.log.info("%(name)s saved as %(newname)s" % {"name": name, "newname": newname})