Closed fin273 closed 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.
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.
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.