I can confirm that this does work, I modified the download function in 
forecast.py to:

                req = urllib2.Request(u)
                req.add_header('User-Agent', 'Mozilla/5.0 (Macintosh; Intel 
Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/50.0.2661.102 Safari/537.36')
                response = urllib2.urlopen(req)
                return response.read()

Mike

On Sunday, March 1, 2020 at 12:17:00 PM UTC, Phil Owers wrote:
>
> The UK Met Office has now raised an issue with there datapoint services 
> but did suggest to try
>
> Could you try the following : change the User-Agent to
> 'Mozilla/5.0'. It could be that the user agent of 'python/urllib/2.5' is 
> the issue. This worked for some users.
>
>
> Not sure what that means
>
> Phil
>
>
> On Saturday, February 29, 2020 at 6:38:50 PM UTC, Phil Owers wrote:
>>
>> Hi Guys
>> Have 2 raspberry pi each running to a vantage pro. Both stopped 
>> downloading uk met office forecasts (2 api keys) on the 25 feb.  The log 
>> suggests HTTP Error 403 Forbidden.  If i put the 
>> http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/354731?res=3hourly&key=api
>>  
>> key into a browser it has data. Has anybody else had this problem.  Nothing 
>> has changed on the rasberry as both have been working without intervention 
>> since 3.9.2 many weeks ago.  Thanks for any help Phil
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/8ce9e4fe-ade9-413c-9d2f-f63433eb2f85%40googlegroups.com.

Reply via email to