Skip to content

Commit

Permalink
Added User-Agent headers which should restore diablo.trade functional…
Browse files Browse the repository at this point in the history
…ity (d4lfteam#295)

Co-authored-by: chrisoro <[email protected]>
  • Loading branch information
cjshrader and chrisoro authored Jun 15, 2024
1 parent 3b44b0a commit ed50cc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.5.7"
__version__ = "5.5.8"
5 changes: 4 additions & 1 deletion src/gui/importer/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def get_class_name(input_str: str) -> str:

def get_with_retry(url: str) -> requests.Response:
for _ in range(5):
r = requests.get(url)
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
}
r = requests.get(url, headers=headers)
if r.status_code == 200:
return r
Logger.debug(f"Request {url} failed with status code {r.status_code}, retrying...")
Expand Down

0 comments on commit ed50cc5

Please sign in to comment.