From 39192400d5c264cc183afb41f278fb9a2b9262e8 Mon Sep 17 00:00:00 2001 From: arzkar Date: Thu, 22 Apr 2021 22:33:27 +0530 Subject: [PATCH] Fixed a bug with request's params --- fichub_cli/fichub.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fichub_cli/fichub.py b/fichub_cli/fichub.py index 7108281..f380179 100644 --- a/fichub_cli/fichub.py +++ b/fichub_cli/fichub.py @@ -10,11 +10,12 @@ def get_fic_metadata(url, format_type, debug, 'User-Agent': 'fichub_cli/0.3.1', } + params = {'q': url} if automated: # for internal testing - headers['automated'] = 'true' + params['automated'] = 'true' response = requests.get( - "https://fichub.net/api/v0/epub", params={'q': url}, + "https://fichub.net/api/v0/epub", params=params, allow_redirects=True, headers=headers ).json() @@ -59,10 +60,11 @@ def get_fic_data(download_url, automated=False): 'User-Agent': 'fichub_cli/0.3.1', } + params = {} if automated: # for internal testing - headers['automated'] = 'true' + params['automated'] = 'true' data = requests.get( - download_url, allow_redirects=True, headers=headers).content + download_url, allow_redirects=True, headers=headers, params=params).content return data