Skip to content

Commit

Permalink
Minor change and version upgrades (#306)
Browse files Browse the repository at this point in the history
- Updated requirements.txt versions
- Improve internal code used for making requests
  • Loading branch information
dmytrokoren authored Sep 30, 2024
1 parent 0fad971 commit 50798ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
Expand Down
7 changes: 4 additions & 3 deletions lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def make_request(
attempts = 0
while attempts < max_attempts:
attempts += 1
if method == "POST":

if method.upper() == "POST":
response = requests.post(url, headers=headers, json=info)
else:
response = requests.get(url, headers=headers, params=info)
Expand All @@ -69,9 +70,9 @@ def make_request(
logger.debug("Successfully made request after %d attempts", attempts)
return response.json()

# Request did not succeed
# Handle unsuccessful responses
response_body = response.content.decode()
error_msg = response.reason + " " + str(response.status_code)
error_msg = f"{response.reason} ({response.status_code})"
error = RequestError(error_msg, response_body)

try:
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apprise==1.8.1
apprise==1.9.0
ntplib==0.4.0
pytz==2024.1 # Remove when this script only supports Python 3.9+
requests==2.31.0
seleniumbase==4.29.9
seleniumbase==4.31.2

0 comments on commit 50798ca

Please sign in to comment.