klenwell / covid-19

Python command-line application to collect and analyze COVID-19 data.
1 stars 0 forks source link

Kent County COVID-19 extract failed with 401 status. #36

Closed klenwell closed 3 years ago

klenwell commented 3 years ago

Recent days have seen some data delays. Now this morning I got the following error:

$ python app.py kent-daily
...
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://wabi-us-gov-iowa-api.analysis.usgovcloudapi.net/public/reports/querydata

Defect Card: https://trello.com/c/tN2W55Uk

klenwell commented 3 years ago

Resolved

Needed to change what I suspect were so reporting ID values. The PR explains it more clearly:

Reorganized code slightly so that if problem arises again it should be even easier to fix.

klenwell commented 3 years ago

Also ended up needing to update the request headers the next day. See this commit: