dglent / meteo-qt

System tray application for weather status information
GNU General Public License v3.0
82 stars 21 forks source link

Error 401: Unauthorized with personal OpenWheaterMap API key #77

Closed CocoCocoAlx closed 5 years ago

CocoCocoAlx commented 5 years ago

Hi. It this plugin working? I get these messages when I set my location. I get succesfully added my personal api key to the program, but still get errors. What I'm doing wrong? My system is SparkyLinux 5.x Nibiru (Debian Testing) with LXQt 0.13.0, with all up-to-date. Many thanks for your work!

dglent commented 5 years ago

Hello

Everything is working, something is going wrong with your key or your installed version. Check if you have the latest version above this one https://github.com/dglent/meteo-qt/releases/tag/v0.9.7 Check your key in your account here: https://home.openweathermap.org/blocks

CocoCocoAlx commented 5 years ago

Hi, sorry for delay. My installed version of your program is 0.9.9, with Python 3.6.7 and Qt 5.11.3. In OpenWeatherMap, my key is not shown as blocked. There is another thing to try? Many thanks. Greetings from Argentina.

CocoCocoAlx commented 5 years ago

I forgot to mention that: when I try to access directly from web browser with the API url, it works. For example, in browser I put: https://api.openweathermap.org/data/2.5/weather?q=Posadas&appid=&lang=es and I obtain this:

{"coord":{"lon":-55.89,"lat":-27.37},"weather":[{"id":804,"main":"Clouds","description":"nubes","icon":"04n"}],"base":"stations","main":{"temp":301.15,"pressure":1006,"humidity":65,"temp_min":301.15,"temp_max":301.15},"visibility":10000,"wind":{"speed":2.1,"deg":110},"clouds":{"all":90},"dt":1542931200,"sys":{"type":1,"id":4727,"message":0.0042,"country":"PY","sunrise":1542962490,"sunset":1543011525},"id":3429886,"name":"Posadas","cod":200}

so I understand that the key is working, right?

Thanks again and sorry for my bad english. Bye!

dglent commented 5 years ago

Try to remove the file: ~/.config/meteo-qt/meteo-qt.conf in order to start as a fresh install If negative: Open the file ~/.config/meteo-qt/meteo-qt.conf and change the line for logging from INFO to DEBUG: [Logging] Level=DEBUG Launch meteo-qt from the terminal Copy the link that provokes the 401 error and open it with the browser and copy it here (without your personal key)

CocoCocoAlx commented 5 years ago

Hi again, yes, I try two or three refreshes of the config file, but still not working. Debug output is:

DEBUG: Update... - meteo_qt DEBUG: Fetching url for actual weather: http://api.openweathermap.org/data/2.5/weather?id=3429886&mode=xml&units=metric&APPID= - meteo_qt DEBUG: Fetching url for 6 days :http://api.openweathermap.org/data/2.5/forecast/daily?id=3429886&mode=xml&units=metric&APPID=&cnt=7 - meteo_qt WARNING: Error: HTTP Error 401: Unauthorized - meteo_qt INFO: Try again...1 - meteo_qt (...) DEBUG: Download thread done - meteo_qt ERROR: Error: Error:401 Unauthorized - meteo_qt DEBUG: Trying to retrieve data ... - meteo_qt (...) DEBUG: Attempts: 0 - meteo_qt DEBUG: Update... - meteo_qt

And nothings happen.

dglent commented 5 years ago

It blocks in the 6 days forecast Try this in your browser by adding the your key: http://api.openweathermap.org/data/2.5/forecast/daily?id=3429886&mode=xml&units=metric&APPID=&cnt=7

If it blocks try with cnt=6 cnt=5 cnt=4 and tell me which is working (so i will adapt the number of days for the forecast)

CocoCocoAlx commented 5 years ago

Well... from 7 to 1, none. In all cases the site denies the access and fail. You got a free API key, or it's a paid key? Maybe OWM are changing the terms of use...

El vie., 23 de nov. de 2018 02:54, Dimitrios Glentadakis < notifications@github.com> escribió:

It blocks in the 6 days forecast Try this in your browser by adding the your key:

http://api.openweathermap.org/data/2.5/forecast/daily?id=3429886&mode=xml&units=metric&APPID=

&cnt=7 If it blocks try with cnt=6 cnt=5 cnt=4 and tell me which is working (so i will adapt the number of days for the forecast) - Probably limitation of the not paid license — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .
dglent commented 5 years ago

Ok i see. I have a free key too but it works now because for a period didn't work either. I thought that they aloud now the 6 days forecast. I will be oblige to remove the 6 days and take the 4 days forecast as i had before. I will fix this in the next days (probably this weekend)

Thanks for reporting it

dglent commented 5 years ago

Could you please test the above fix ?

CocoCocoAlx commented 5 years ago

It working now! If I set language in options, changes won't save. Can I set the language of the information gathered from OpenWeatherMap? Adding "&lang=es" at the end of the URL the results came in spanish. Which lines I would to modify?

Many thanks for your excellent work! (And, again, sorry for my bad english)

Greetings again. We can close this post if you decide.

CocoCocoAlx commented 5 years ago

Hi again, I solve that installing as root the app and translating some strings myself. I'm very satisfied. Marked as solved and closed.

Greetings! remmina_netbook_192 168 0 41_20181125-152654 590383

dglent commented 5 years ago

Hello Very nice :) If you like you can contribute with your translation here: https://www.transifex.com/dglent/meteo-qt/language/es/ in order to include it in the project Greetings

CocoCocoAlx commented 5 years ago

Yes, of course! Thank you for the invitation!

El lun., 26 nov. 2018 a las 2:01, Dimitrios Glentadakis (< notifications@github.com>) escribió:

Hello Very nice :) If you like you can contribute with your translation here: https://www.transifex.com/dglent/meteo-qt/language/es/ in order to include it in the project Greetings

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/dglent/meteo-qt/issues/77#issuecomment-441519774, or mute the thread https://github.com/notifications/unsubscribe-auth/AQgRquWJqExxmOor3G1UymjMTcpCdoB1ks5uy3WogaJpZM4YpyBT .