multimokia / MAS-Submod-Auto-Atmos-Change

Allows the weather and suntimes to automatically match your current location
12 stars 5 forks source link

Topic crashes in my city #8

Open AnIdiotsavant opened 3 years ago

AnIdiotsavant commented 3 years ago

[code] I'm sorry, but an uncaught exception occurred.

While running game code: File "game/script-ch30.rpy", line 1475, in script call File "game/event-handler.rpy", line 2516, in script call File "game/Submods/Auto Weather Change/awc_topics.rpy", line 81, in script $ awc_savePlayerCityCountryTup((temp_city, awc_getCityCountry(temp_city))) File "game/Submods/Auto Weather Change/awc_topics.rpy", line 81, in $ awc_savePlayerCityCountryTup((temp_city, awc_getCityCountry(temp_city))) File "game/Submods/Auto Weather Change/Utilities/awc_utils.rpy", line 252, in awc_getCityCountry return store.awc_globals.owm.weather_at_place(city_name).get_location().get_country() UnauthorizedError: Your API subscription level does not allow to perform this operation

Reason: Invalid API key

-- Full Traceback ------------------------------------------------------------

Full traceback: File "game/script-ch30.rpy", line 1475, in script call File "game/event-handler.rpy", line 2516, in script call File "game/Submods/Auto Weather Change/awc_topics.rpy", line 81, in script $ awc_savePlayerCityCountryTup((temp_city, awc_getCityCountry(temp_city))) File "C:\Users\Shaun\3D Objects\Josh's files\Josh\DDLC-1.1.1-pc\renpy\ast.py", line 814, in execute renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) File "C:\Users\Shaun\3D Objects\Josh's files\Josh\DDLC-1.1.1-pc\renpy\python.py", line 1719, in py_exec_bytecode exec bytecode in globals, locals File "game/Submods/Auto Weather Change/awc_topics.rpy", line 81, in $ awc_savePlayerCityCountryTup((temp_city, awc_getCityCountry(temp_city))) File "game/Submods/Auto Weather Change/Utilities/awc_utils.rpy", line 252, in awc_getCityCountry return store.awc_globals.owm.weather_at_place(city_name).get_location().get_country() File "C:\Users\Shaun\3D Objects\Josh's files\Josh\DDLC-1.1.1-pc\game\python-packages\pyowm-2.8.0-py2.7.egg\pyowm\webapi25\owm25.py", line 231, in weather_at_place File "C:\Users\Shaun\3D Objects\Josh's files\Josh\DDLC-1.1.1-pc\game\python-packages\pyowm-2.8.0-py2.7.egg\pyowm\commons\weather_client.py", line 94, in call_API File "C:\Users\Shaun\3D Objects\Josh's files\Josh\DDLC-1.1.1-pc\game\python-packages\pyowm-2.8.0-py2.7.egg\pyowm\commons\weather_client.py", line 58, in _lookup_cache_or_invoke_API UnauthorizedError: Your API subscription level does not allow to perform this operation

Reason: Invalid API key

Windows-8-6.2.9200 Ren'Py 6.99.12.4.2187 Monika After Story 0.12.1 [/code]

This was when I told monika of my city in the philippines

multimokia commented 3 years ago

This may be an issue as a result of some of the changes on OpenWeatherMap's end. We're looking into it, but they seem to be depreciating the API version we're using right now due to Python 2's depreciation.

Getting a version going that will not be depreciated may take some time though, as we need to develop a Python 3 compatibility layer and port the API over, which a lot of it needs to be rewritten.

zwartkop2 commented 3 years ago

I don't know if this information would be useful, but I had the same problem, so I decided to experiment. It seems the exception does not trigger if there are multiple cities that share the inputted name. i.e.: Entering 'Nome' or 'Seattle' raised an exception, while entering 'Philadelphia' or 'Buffalo' does not.

multimokia commented 3 years ago

Very odd, it's almost as if certain cities are blacklisted on the api end. Unfortunately I'm not sure how much I can do to mitigate this due to how the api works

zwartkop2 commented 3 years ago

Update: I live in a city which throws the exception, and I’ve noticed that the part of the submod which updates the sunrise/sunset times seems to work just fine.