diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2017-11-23 00:22:35 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2017-11-23 00:22:35 +0200 |
commit | 3adea057ad8b2ae403d13e19a7bd5730413dac98 (patch) | |
tree | e0f3cd13cebd0437b134e10132c9ae5bcb8ba778 | |
parent | 670052a65c2769cd8bb442ae66cca2832c89fd0a (diff) |
Use the USER_AGENT constant
-rw-r--r-- | default.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -21,7 +21,7 @@ import xbmcplugin KAN_URL = 'http://www.kan.org.il' -USER_AGENT = 'Kodi' # I'm optimistic +USER_AGENT = 'Kodi/plugin.video.kan/1.0' # I'm optimistic PLUGIN_NAME = "plugin.video.kan" # FIXME: a better way to get this? SiteCache = simplecache.SimpleCache() # FIXME: avoid this global @@ -74,7 +74,7 @@ def read_url(url): if cached_read: return cached_read - headers = {'user-agent': 'Kodi/plugin.video.kan/1.0'} + headers = {'user-agent': USER_AGENT} response = requests.get(url, headers=headers) if response.status_code != 200: raise IOError("Invalid URL {}".format(url)) |