Skip to content

Commit

Permalink
- Added url output to response error
Browse files Browse the repository at this point in the history
- Updated user agent to fix 503 response (temporary fix)
  • Loading branch information
DJSchaffner committed Oct 19, 2020
1 parent ea54f67 commit 75b3b72
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import utils

class Webhook:
# Just some user agent because steam db expects one
headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}
# Just some user agent because steamdb rejects requests without one
# @TODO prevent this from breaking when the brower gets outdated because steamdb will start to send 503 response then
headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0'}

def query_patch_change_list(self):
"""Query a list of changed depots for all patches.
Expand Down Expand Up @@ -103,5 +104,5 @@ def _is_response_successful(self, response: requests.Response):
return response.status_code == 200

def _print_response_error(self, response: requests.Response):
"""Print the according error for a response."""
print(f"Error in HTML request: {response.status_code}")
"""Print the according error for a response."""
print(f"Error in HTML request: {response.status_code} ({response.url})")

0 comments on commit 75b3b72

Please sign in to comment.