From c81a826c57ec7f7e623f9b66da71091ae57ea37b Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 8 Jul 2017 16:06:33 +0800 Subject: [PATCH] github wants the User-Agent header properly set --- nvchecker/source/github.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvchecker/source/github.py b/nvchecker/source/github.py index d0c8506..526576b 100644 --- a/nvchecker/source/github.py +++ b/nvchecker/source/github.py @@ -23,7 +23,10 @@ async def get_version(name, conf): url = GITHUB_MAX_TAG % repo else: url = GITHUB_URL % (repo, br) - headers = {'Accept': "application/vnd.github.quicksilver-preview+json"} + headers = { + 'Accept': 'application/vnd.github.quicksilver-preview+json', + 'User-Agent': 'lilydjwg/nvchecker', + } if 'NVCHECKER_GITHUB_TOKEN' in os.environ: headers['Authorization'] = 'token %s' % os.environ['NVCHECKER_GITHUB_TOKEN']