Skip to content

Commit dd99a17

Browse files
committed
Adjusted poeprices.info timeout.
1 parent 177a951 commit dd99a17

File tree

2 files changed

+12
-273
lines changed

2 files changed

+12
-273
lines changed

tests/brokenItems.txt

Lines changed: 0 additions & 265 deletions
This file was deleted.

utils/web.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,23 +420,27 @@ def get_poe_prices_info(item):
420420
421421
:param item: The item whose info we will query
422422
"""
423-
try:
424-
results = requests.post(b"http://poeprices.info", timeout=2)
425-
except Exception:
426-
logging.info("poeprices.info is not available.")
427-
return {}
428423
try:
429424
league = bytes(config.LEAGUE, "utf-8")
430425
try:
426+
logging.debug(
427+
b"Visiting "
428+
+ b"https://poeprices.info/api?l="
429+
+ league
430+
+ b"&i="
431+
+ base64.b64encode(bytes(item.text, "utf-8"))
432+
)
431433
results = requests.post(
432-
b"http://poeprices.info/api?l="
434+
b"https://poeprices.info/api?l="
433435
+ league
434436
+ b"&i="
435-
+ base64.b64encode(bytes(item.text, "utf-8"), timeout=5)
437+
+ base64.b64encode(bytes(item.text, "utf-8")),
438+
timeout=5,
436439
)
440+
logging.debug(results)
437441
return results.json()
438442
except Exception:
439-
logging.info("poeprices.info is not available.")
443+
logging.info("poeprices.info took too long to respond.")
440444
return {}
441445
except Exception:
442446
logging.error("Could not retrieve data from poeprices.info")

0 commit comments

Comments
 (0)