diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/download_thread.py | 18 | ||||
-rwxr-xr-x | module/network/Request.py | 3 | ||||
-rw-r--r-- | module/thread_list.py | 2 |
3 files changed, 12 insertions, 11 deletions
diff --git a/module/download_thread.py b/module/download_thread.py index 502d42ddc..96bc4dd34 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -83,13 +83,12 @@ class Download_Thread(threading.Thread): if self.parent.py_load_files: self.loadedPyFile = self.parent.get_job() if self.loadedPyFile: - try: + try: self.download(self.loadedPyFile) - except Exception, e: - print "Error:", e - #catch up all error here - finally: - self.parent.job_finished(self.loadedPyFile) + except Exception, e: + print "Error:", e #catch up all error here + finally: + self.parent.job_finished(self.loadedPyFile) sleep(0.5) if self.shutdown: sleep(1) @@ -99,9 +98,9 @@ class Download_Thread(threading.Thread): pyfile = py_load_file status = pyfile.status pyfile.prepareDownload() - - if not status.exists: - raise "FileDontExists" #i know its deprecated, who cares^^ + + if not status.exists: + raise "FileDontExists" #i know its deprecated, who cares^^ if status.want_reconnect: print "handle reconnect" @@ -112,7 +111,6 @@ class Download_Thread(threading.Thread): try: status.type = "downloading" - print "download", status.filename pyfile.plugin.proceed(status.url, pyfile.download_folder + "/" + status.filename) status.type = "finished" diff --git a/module/network/Request.py b/module/network/Request.py index 1c0317cc7..510f6d069 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -27,6 +27,7 @@ class Request: def __init__(self): self.dl_time = 0 + self.dl_finished = 0 self.dl_size = 0 self.dl_arrived = 0 self.dl = False @@ -114,7 +115,7 @@ class Request: def get_ETA(self): try: - return (self.dl_size - self.dl_arrived) / (self.dl_arrived / (time.time() - self.dl_time)) + return (self.dl_size - self.dl_arrived) / (self.dl_arrived / (time.time() - self.dl_time if self.dl else self.dl_finished)) except: return "No Download" diff --git a/module/thread_list.py b/module/thread_list.py index 979a98c60..065318a56 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -73,6 +73,7 @@ class Thread_List(object): self.py_downloading.append(pyfile) if not pyfile.plugin.multi_dl: self.occ_plugins.append(pyfile.modul.__name__) + self.parent.logger.info('start downloading ' + pyfile.url ) self.lock.release() return pyfile @@ -85,6 +86,7 @@ class Thread_List(object): self.occ_plugins.remove(pyfile.modul.__name__) self.py_downloading.remove(pyfile) + self.parent.logger.info('finished downloading ' + pyfile.url + ' @'+str(pyfile.status.get_speed())+'kb/s') if pyfile.plugin.plugin_type == "container": self.parent.extend_links(pyfile.plugin.links) |