prueker / METARMap

Raspberry Pi project to visualize flight conditions on a map using WS8211 LEDs addressed via NeoPixel
MIT License
120 stars 72 forks source link

403 Forbidden when running #13

Closed fin273 closed 3 years ago

fin273 commented 3 years ago

I am getting the following error today after starting up my raspberry pi

https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=5&mostRecentForEachStation=true&stationString=KSAC,KMHR,KMCC,KSMF,KDWA,KEDU,KVCB,KSUU,KLHM,KAUN,KBAB,KPVF,KMYV,KOVE,KCIC,KRBL,KRDD,KBLU,KGOO,KTRK,KRNO,KTVL,KJAQ,KO22,KSCK,KMOD,KTCY,KC83,KLVK,KHWD,KOAK,KSFO,KSQL,KPAO,KSJC,KRHV,KWVI,KCVH,KSNS,KMRY,KHAF,KAPC,KSTS,KO69,KCCR,KMCE,KMER,KFAT,KMAE,KHJO Traceback (most recent call last): File "metar.py", line 60, in content = urllib.request.urlopen(url).read() File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.7/urllib/request.py", line 531, in open response = meth(req, response) File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.7/urllib/request.py", line 569, in error return self._call_chain(args) File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(args) File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

No changes since it was working fine just yesterday.

When i got to the URL from a separate browser, it returns the correct information.

prueker commented 3 years ago

It appears that the aviationweather.gov service has stopped accepting the python user agent overnight. Thanks for letting me know. I've fixed the metar.py script to address the issue.