Red-DiscordBot icon indicating copy to clipboard operation
Red-DiscordBot copied to clipboard

streamalert throws error when a youtube stream goes live.

Open ltzmax opened this issue 3 years ago • 2 comments

What Red version are you using?

3.5.0.dev1

What were you trying to do?

Getting live notifications from a youtuber.

What did you expect to happen?

To send live streams without erroring.

What actually happened?

Jan 08 12:30:33 voltrabot python[440618]: Traceback (most recent call last):
Jan 08 12:30:33 voltrabot python[440618]:   File "/home/max/redenv/lib/python3.11/site-packages/redbot/cogs/streams/streams.py", line 836, in check_streams
Jan 08 12:30:33 voltrabot python[440618]:     embed, is_schedule = await stream.is_online()
Jan 08 12:30:33 voltrabot python[440618]:                          ^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 12:30:33 voltrabot python[440618]:   File "/home/max/redenv/lib/python3.11/site-packages/redbot/cogs/streams/streamtypes.py", line 212, in is_online
Jan 08 12:30:33 voltrabot python[440618]:     return await self.make_embed(data)
Jan 08 12:30:33 voltrabot python[440618]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 12:30:33 voltrabot python[440618]:   File "/home/max/redenv/lib/python3.11/site-packages/redbot/cogs/streams/streamtypes.py", line 216, in make_embed
Jan 08 12:30:33 voltrabot python[440618]:     vid_data = data["items"][0]
Jan 08 12:30:33 voltrabot python[440618]:                ~~~~~~~~~~~~~^^^
Jan 08 12:30:33 voltrabot python[440618]: IndexError: list index out of range

How can we reproduce this error?

  1. [p]streamset youtube ishowsepeed
  2. wait until he goes live.
  3. check logs.

Anything else?

Not sure if this is only for youtube but, i've mainly only seen this with youtube in my logs. You also may go live a few times, it only sent live notifications a few times or something to me until it started erroring.

ltzmax avatar Jan 08 '23 12:01 ltzmax

Have looked into this and cannot replicate it. However proper error handling here would be a nice stopping ground. Gonna leave this open.

Kowlin avatar Feb 07 '23 17:02 Kowlin

Just wanted to chime in and say that I'm having the same (or very similar) issue. Strangest part is that this was working for the longest time, & then sometime around June 30th it just stopped working. Here is a bit of logs:

[2023-07-07 03:15:06] [ERROR] red.core.cogs.Streams: An error has occurred with Streams. Please report it.
Traceback (most recent call last):
  File "/data/venv/lib/python3.11/site-packages/redbot/cogs/streams/streams.py", line 836, in check_streams
    embed, is_schedule = await stream.is_online()
                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/venv/lib/python3.11/site-packages/redbot/cogs/streams/streamtypes.py", line 210, in is_online
    return await self.make_embed(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/venv/lib/python3.11/site-packages/redbot/cogs/streams/streamtypes.py", line 214, in make_embed
    vid_data = data["items"][0]
               ~~~~~~~~~~~~~^^^
IndexError: list index out of range

^^ This log message is repeating every 5 minutes it looks like.

Happy to provide any additional details to help track this down.

CrystalENVT avatar Jul 07 '23 03:07 CrystalENVT