summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2017-11-23 00:22:35 +0200
committerTzafrir Cohen <tzafrir@cohens.org.il>2017-11-23 00:22:35 +0200
commit3adea057ad8b2ae403d13e19a7bd5730413dac98 (patch)
treee0f3cd13cebd0437b134e10132c9ae5bcb8ba778
parent670052a65c2769cd8bb442ae66cca2832c89fd0a (diff)
Use the USER_AGENT constant
-rw-r--r--default.py4
1 files 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))