diff options
-rw-r--r-- | module/plugins/Plugin.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 5058ebdc8..0e78686c7 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -280,8 +280,19 @@ class Plugin(object): def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False): """ returns the content loaded """ if self.pyfile.abort: raise Abort - - return self.req.load(url, get, post, ref, cookies, just_header) + + res = self.req.load(url, get, post, ref, cookies, just_header) + if self.core.debug: + from inspect import currentframe + frame = currentframe() + if not exists(join("tmp", self.__name__)): + makedirs(join("tmp", self.__name__)) + + f = open(join("tmp", self.__name__, "%s_line%s.dump" % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)), "wb") + f.write(res) + f.close() + + return res def download(self, url, get={}, post={}, ref=True, cookies=True): """ downloads the url content to disk """ |