diff options
Diffstat (limited to 'module/plugins/Plugin.py')
-rw-r--r-- | module/plugins/Plugin.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 51cd78f2d..e8df540a8 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -18,7 +18,6 @@ """ import logging -import re from os.path import exists from os.path import join @@ -89,8 +88,14 @@ class Plugin(object): self.pyfile = pyfile self.thread = None # holds thread in future + self.setup() + def __call__(self): return self.__name__ + + def setup(self): + """ more init stuff if needed """ + pass def preprocessing(self, thread): """ handles important things to do before starting """ @@ -98,6 +103,8 @@ class Plugin(object): if not self.account: self.req.clearCookies() + + self.pyfile.setStatus("starting") return self.process(self.pyfile) @@ -178,6 +185,9 @@ class Plugin(object): def download(self, url, get={}, post={}, ref=True, cookies=True): """ downloads the url content to disk """ + + self.pyfile.setStatus("downloading") + download_folder = self.config['general']['download_folder'] location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) @@ -187,5 +197,7 @@ class Plugin(object): newname = self.req.download(url, self.pyfile.name, location, get, post, ref, cookies) + self.pyfile.size = self.req.dl_size + if newname: self.pyfile.name = newname |