Modification to have url into title_process_cb (instead of only title)
This commit is contained in:
parent
39d5f5762c
commit
a6a08103bb
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue