csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
789 stars 171 forks source link

Two types of weather condition icons #324

Closed Harmon758 closed 4 years ago

Harmon758 commented 4 years ago

https://openweathermap.org/weather-conditions shows two different types of icons, with the base URI being different: http://openweathermap.org/img/wn/ vs http://openweathermap.org/img/w/. PyOWM uses the latter right now: https://github.com/csparpa/pyowm/blob/e35446ebe081c0b14a25dca0f7f8105836745b04/pyowm/weatherapi25/uris.py#L18 Is there a documented reason for there being two different types? And would it be possible to choose which type to use with Weather.weather_icon_url? In my opinion, the /wn/ versions are cleaner and clearer in most cases.

csparpa commented 4 years ago

@Harmon758 I'm sorry, I've not been able to work on this for a while.

I do agree with you, the /wn icon set looks cleaner. I will replace the new URL into PyOWM

Harmon758 commented 4 years ago

No problem. Let me know if you'd like me to PR it. If it's just a replacement, I think it'd just be a simple one line change.

csparpa commented 4 years ago

fixed, in the works for 3.1

Wesley-Vos commented 4 years ago

Thanks for replacing the URL, I just started working on a PR for this. With the new set of icons, it is also possible to define the size of it (2x or 4x). Can you maybe add this size to the weather_function_url() function as an argument with default 2x? The size is specified in the URL as "@2x.png" or "@4x.png" near the icon name.

csparpa commented 3 years ago

Hi! yes please, put the size in as a parameter to the function call with a default (maybe the most commonly used size?) thanks!

Wesley-Vos commented 3 years ago

Hi! I've created a PR. I've set the default size to be the same size as the 'old' icons. 2x and 4x are as an option also included.

Muhammad-84 commented 2 years ago

HTTP request failed, statusCode: 404, http://openweathermap.org/img/wn/null@2x.png

I am facing this issue. can any one help

csparpa commented 2 years ago

@Muhammad-84 hi, can you please paste here a reference to the PyOWM code that is not working?

In your URL you can clearly see a "null" which is a bad thing of course. But we need to understand where that URL comes from first

Thanks