GiedriusS / TwitchNotifier

A tool that sits in the background and notifies you using libnotify if a channel you follow comes online or goes offline. Optionally it can only check for offline/online channels once.
GNU General Public License v3.0
27 stars 4 forks source link

Online Status Incorrectly Reported #12

Open ThePademelon opened 2 years ago

ThePademelon commented 2 years ago

I went to check if a streamer was online (they were) but twitchnotifier reported that they weren't. Looking at the verbose output it looks like the API usage is out of date.

[nim@pc-gamma ~]$ twitchnotifier -u adropofstevie -v
Configuration file: /home/nim/.config/twitchnotifier.cfg
--------------------
cmd: /streams
payload: {'channel': 'adropofstevie', 'limit': 100, 'offset': 0}
req.text: {"error":"Gone","status":410,"message":"v3 is a lie but v5 is still alive. See https://dev.twitch.tv/docs"}
req.status_code: 410
req.headers: {'Connection': 'keep-alive', 'Content-Length': '107', 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-cache, no-store, must-revalidate, private', 'Expires': '0', 'Pragma': 'no-cache', 'Timing-Allow-Origin': 'https://www.twitch.tv', 'Date': 'Mon, 11 Jul 2022 08:31:34 GMT', 'X-Served-By': 'cache-sea4438-SEA, cache-syd10131-SYD', 'X-Cache': 'MISS, MISS', 'X-Cache-Hits': '0, 0', 'X-Timer': 'S1657528294.458976,VS0,VS0,VE176', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=300'}
--------------------
adropofstevie is offline
GiedriusS commented 2 years ago

We've migrated to v5 a long time ago: https://github.com/GiedriusS/TwitchNotifier/commit/6348165fcab7e90a31e496ab7073e48813c8405e. Could you see if it is still reproducible with the newest version?

ThePademelon commented 2 years ago

I tried with the latest version (from here) but now I get a different error.

[nim@pc-gamma TwitchNotifier-0.5.1]$ twitchnotifier -u nadeshot -v
Configuration file: /home/nim/.config/twitchnotifier.cfg
--------------------
cmd: /users, payload: {'login': 'nadeshot'}
req.text: {"error":"Not Found","status":404,"message":"This API does not exist"}
req.status_code: 404
req.headers: {'Connection': 'keep-alive', 'Content-Length': '70', 'Content-Type': 'application/json; charset=utf-8', 'Access-Control-Allow-Origin': '*', 'Cache-Control': 'no-cache, no-store, must-revalidate, private', 'Expires': '0', 'Pragma': 'no-cache', 'Timing-Allow-Origin': 'https://www.twitch.tv', 'Date': 'Thu, 27 Oct 2022 07:47:49 GMT', 'X-Served-By': 'cache-bfi-kbfi7400037-BFI, cache-syd10158-SYD', 'X-Cache': 'MISS, MISS', 'X-Cache-Hits': '0, 0', 'X-Timer': 'S1666856869.399587,VS0,VS0,VE194', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=300'}
--------------------
Traceback (most recent call last):
  File "/usr/bin/twitchnotifier", line 65, in <module>
    RET = API.check_if_online(LST)
  File "/usr/lib/python3.10/site-packages/libtn.py", line 264, in check_if_online
    chan_ids = self.get_userids(chans)
  File "/usr/lib/python3.10/site-packages/libtn.py", line 184, in get_userids
    raise NameError(f'{nicks} has invalid nicknames')
NameError: ['nadeshot'] has invalid nicknames