Skip to content

Commit 6547dd8

Browse files
authored
fix: Rushmoor started blocking default python-requests header (#5603)
1 parent 6ba76b0 commit 6547dd8

File tree

1 file changed

+2
-1
lines changed
  • custom_components/waste_collection_schedule/waste_collection_schedule/source

1 file changed

+2
-1
lines changed

custom_components/waste_collection_schedule/waste_collection_schedule/source/rushmoor_gov_uk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"GU14": {"uprn": "100060551749"},
1212
}
1313

14+
HEADERS = {"user-agent": "Mozilla/5.0 (xxxx Windows NT 10.0; Win64; x64)"}
1415
ICON_MAP = {
1516
"Refuse": "mdi:trash-can",
1617
"Recycling": "mdi:recycle",
@@ -27,7 +28,7 @@ def __init__(self, uprn):
2728

2829
def fetch(self):
2930
params = {"selectedAddress": self._uprn, "weeks": "16"}
30-
r = requests.get(API_URL, params=params)
31+
r = requests.get(API_URL, params=params, headers=HEADERS)
3132
r.raise_for_status()
3233
data = r.json()
3334

0 commit comments

Comments
 (0)