mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-01-30 10:06:25 +00:00
add 'user_agent' config for the regex source
This commit is contained in:
parent
ca931633aa
commit
e4830dd162
@ -91,6 +91,9 @@ regex
|
||||
proxy
|
||||
The HTTP proxy to use. The format is ``host:port``, e.g. ``localhost:8087``. This requires `pycurl <http://pycurl.sourceforge.net/>`_.
|
||||
|
||||
user_agent
|
||||
The ``User-Agent`` header value to use. Use something more like a tool (e.g. ``curl/7.40.0``) in Europe or the real web page won't get through because cookie policies (SourceForge has this issue).
|
||||
|
||||
Find with a Command
|
||||
-------------------
|
||||
Use a shell command line to get the version. The output is striped first, so trailing newlines do not bother.
|
||||
|
@ -30,6 +30,8 @@ def get_version(name, conf, callback):
|
||||
kwargs['proxy_port'] = int(port)
|
||||
else:
|
||||
logger.warn('%s: proxy set but not used because pycurl is unavailable.', name)
|
||||
if conf.get('user_agent'):
|
||||
kwargs['user_agent'] = conf['user_agent']
|
||||
|
||||
httpclient.fetch(conf['url'], partial(
|
||||
_got_version, name, r, encoding, callback
|
||||
|
Loading…
Reference in New Issue
Block a user