Get IRC formatting from the v4 server

This commit is contained in:
Lephenixnoir 2023-08-08 21:14:10 +02:00
parent c2ad050502
commit e3b7f076ae
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ class Shoutbox(object):
self._handler = Thread(target=self._handle)
for channel, last_id in self.channels.items():
messages = json.loads(r.get(f"https://www.planet-casio.com/Fr/shoutbox/api/read?since={last_id}&channel={channel}&format=text").text)['messages']
messages = json.loads(r.get(f"https://www.planet-casio.com/Fr/shoutbox/api/read?since={last_id}&channel={channel}&format=irc").text)['messages']
for m in messages:
self.channels[channel] = m['id']
@ -82,7 +82,7 @@ class Shoutbox(object):
for channel, last_id in self.channels.items():
# Do not spam with logs
logging.getLogger().setLevel(logging.INFO)
messages = json.loads(r.get(f"https://www.planet-casio.com/Fr/shoutbox/api/read?since={last_id}&channel={channel}&format=text").text)['messages']
messages = json.loads(r.get(f"https://www.planet-casio.com/Fr/shoutbox/api/read?since={last_id}&channel={channel}&format=irc").text)['messages']
logging.getLogger().setLevel(logging.DEBUG)
for m in messages:
logging.debug(m)