eriknyquist / nedry

Nedry is a fun & useful discord bot with a modular plugin system (formerly "twitch_monitor_discord_bot")
Apache License 2.0
10 stars 3 forks source link

Invalid twitch streamer: #1

Closed kapiorr closed 1 year ago

kapiorr commented 2 years ago

Windows Python 3.10 Debian 11 Python 3.9

When run command @bot !addstreamers streamer always - get error: Invalid twitch streamer: If add streamer to config file, get error: Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/olo/.local/lib/python3.9/site-packages/twitch_monitor_discord_bot/__main__.py", line 112, in <module> main() File "/home/olo/.local/lib/python3.9/site-packages/twitch_monitor_discord_bot/__main__.py", line 93, in main monitor = TwitchMonitor(config.twitch_clientid, config.streamers) File "/home/olo/.local/lib/python3.9/site-packages/twitch_monitor_discord_bot/twitch_monitor.py", line 36, in __init__ self._update_users() File "/home/olo/.local/lib/python3.9/site-packages/twitch_monitor_discord_bot/twitch_monitor.py", line 39, in _update_users self.users = self.translate_usernames(self.usernames) File "/home/olo/.local/lib/python3.9/site-packages/twitch_monitor_discord_bot/twitch_monitor.py", line 88, in translate_usernames users.extend(self.client.users.translate_usernames_to_ids(req)) File "/home/olo/.local/lib/python3.9/site-packages/twitch/api/users.py", line 129, in translate_usernames_to_ids response = self._request_get("users?login={}".format(usernames)) File "/home/olo/.local/lib/python3.9/site-packages/twitch/api/base.py", line 53, in _request_get response.raise_for_status() File "/home/olo/.local/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.twitch.tv/kraken/users?login=streamer_name_example

kevenaaron commented 2 years ago

I am also getting this error, whether I add twitch usernames via config file ("404 Client Error") or via !addstreamers ("Invalid twitch streamer") I tried entering just the username, the whole url with twitch(dot)tv(slash), and even the supposed twitch id

eriknyquist commented 2 years ago

twitch deprecated the API I was using to get information about other twitch users, and I haven't got around updating it to use the new API yet. sorry.

kevenaaron commented 2 years ago

Well that explains that. And no worries you do you! Maybe I can read around and see what is the way to do that now. Thank you

eriknyquist commented 1 year ago

Finally got around to fixing this (supporting new twitch API), new version out later today

eriknyquist commented 1 year ago

Haven't pushed a new version to pypi yet, but the master branch should be working again