diff --git a/announce_url_title.py b/announce_url_title.py index acca4aa..019f8af 100644 --- a/announce_url_title.py +++ b/announce_url_title.py @@ -257,19 +257,22 @@ def url_process_launcher(): if not url_d: # empty dict means not launched url_d['launched'] = now() - title = get_title(url) + url_d['title'] = get_title(url) url_d['stdout'] = '' - url_d['url_hook_process'] = w.hook_process(title, 30 * 1000, "title_process_cb", "") + url_d['url_hook_process'] = w.hook_process(url, 30 * 1000, "title_process_cb", "") return w.WEECHAT_RC_OK -def title_process_cb(data, title, rc, stdout, stderr): +def title_process_cb(data, url, rc, stdout, stderr): """ Callback parsing html for title """ global buffer_name, urls + url_d = urls[url] + title = url_d['title'] + max_len = int(w.config_get_plugin('title_max_length')) if len(title) > max_len: title = "%s [...]" % title[0:max_len] @@ -294,6 +297,8 @@ def title_process_cb(data, title, rc, stdout, stderr): else: say(output,w.buffer_search('', buffer_name)) + urls[url]['stdout'] = '' + return w.WEECHAT_RC_OK