RingOV / gis-weather

Customizable weather widget
58 stars 18 forks source link

Remote end closed connection without response (Can't download weather icons) #28

Open Eng1958 opened 7 years ago

Eng1958 commented 7 years ago

I build an User-Agent header before downloading the weather icons

 96 import platform                                                                 
  97 # -------------------- new --------------------                                 
  98 from urllib.request import build_opener                                         
  99 from urllib.request import install_opener                                       
 100 # -------------------- end new ----------------                       
1267                     print ('pix_path: [' + pix_path + "]")                      
1268                     # ----------- new ------------------                        
1269                     opener = build_opener()                                     
1270                     opener.addheaders = [('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36 ')]
1271                     install_opener(opener)                                      
1272                     # ------------end new --------------       
1273                     urlretrieve(pix, pix_path)                                  

After this improvement everything works well ;-)

Best regards Dieter

RingOV commented 7 years ago

Worked fine. Thank you. d30335a3d95c1e7a8f4c1090fa7edefbc5d6891c b3181a92535d589906d0662dd34b1889c66fa16a