From 3adea057ad8b2ae403d13e19a7bd5730413dac98 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Thu, 23 Nov 2017 00:22:35 +0200 Subject: Use the USER_AGENT constant --- default.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.py b/default.py index 80ff282..4ee56a2 100644 --- a/default.py +++ b/default.py @@ -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)) -- cgit v1.2.3