From d86cb955603adc5e71af7c13a9fa6aa4a7bc936a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 22:23:34 +0200 Subject: [PATCH] Bump pylint from 2.14.5 to 2.15.0 (#3353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump pylint from 2.14.5 to 2.15.0 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.14.5 to 2.15.0. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fix code Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Noémi Ványi --- requirements-dev.txt | 2 +- searx/engines/spotify.py | 4 +++- searx_extra/update/update_external_bangs.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d133e919..0dd255b2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ mock==4.0.3 nose2[coverage_plugin]==0.12.0 cov-core==1.15.0 pycodestyle==2.9.1 -pylint==2.14.5 +pylint==2.15.0 splinter==0.18.1 transifex-client==0.14.3; python_version < '3.10' transifex-client==0.12.5; python_version == '3.10' diff --git a/searx/engines/spotify.py b/searx/engines/spotify.py index 0ad8bfe3..3c384999 100644 --- a/searx/engines/spotify.py +++ b/searx/engines/spotify.py @@ -23,6 +23,7 @@ categories = ['music'] paging = True api_client_id = None api_client_secret = None +timeout = 10.0 # search-url url = 'https://api.spotify.com/' @@ -40,9 +41,10 @@ def request(query, params): r = requests.post( 'https://accounts.spotify.com/api/token', + timeout=timeout, data={'grant_type': 'client_credentials'}, headers={'Authorization': 'Basic ' + base64.b64encode( - "{}:{}".format(api_client_id, api_client_secret).encode() + "{}:{}".format(api_client_id, api_client_secret).encode(), ).decode()} ) j = loads(r.text) diff --git a/searx_extra/update/update_external_bangs.py b/searx_extra/update/update_external_bangs.py index b8849643..f2df9a9d 100755 --- a/searx_extra/update/update_external_bangs.py +++ b/searx_extra/update/update_external_bangs.py @@ -30,7 +30,7 @@ HTTP_COLON = 'http:' def get_bang_url(): - response = requests.get(URL_BV1) + response = requests.get(URL_BV1, timeout=10.0) response.raise_for_status() r = RE_BANG_VERSION.findall(response.text) @@ -38,7 +38,7 @@ def get_bang_url(): def fetch_ddg_bangs(url): - response = requests.get(url) + response = requests.get(url, timeout=10.0) response.raise_for_status() return json.loads(response.content.decode())