Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Streams] Errors After Update Fix (3.4.5) #4695

Open
Menteroth opened this issue Dec 25, 2020 · 2 comments
Open

[Streams] Errors After Update Fix (3.4.5) #4695

Menteroth opened this issue Dec 25, 2020 · 2 comments
Assignees
Labels
Category: Cogs - Streams This is related to the Streams cog. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Milestone

Comments

@Menteroth
Copy link

Getting this for Streams now instead after fix. It's every 5-6 minutes. So whenever it checks for live streams I guess.

https://hastebin.com/evitafozuj.sql

@Menteroth Menteroth added the Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. label Dec 25, 2020
@github-actions github-actions bot added the Status: Needs Triage This has not been labeled or discussed for handling yet. label Dec 25, 2020
@Injabie3
Copy link
Contributor

Injabie3 commented Dec 25, 2020

+1, haven't looked into this one yet. I've seen this happen a few times in my instance but embeds still get posted.

I don't see the above paste anymore, so editing this with a recent snippet (please ignore the extra pprint import for debugging):

[11:35:40] ERROR    An error has occured with Streams. Please report it.                                                                                                                                                 [red.core.cogs.Streams]
                    ╭─────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────╮
                    │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streams.py:737 in check_streams                                                       │
                    │                                                                                                                                                                                                  │
                    │   734 │   │   │   │   │   │   embed, is_rerun = await stream.is_online()                                                                                                                         │
                    │   735 │   │   │   │   │                                                                                                                                                                          │
                    │   736 │   │   │   │   │   elif stream.__class__.__name__ == "YoutubeStream":                                                                                                                     │
                    │ ❱ 737 │   │   │   │   │   │   embed, is_schedule = await stream.is_online()                                                                                                                      │
                    │   738 │   │   │   │   │                                                                                                                                                                          │
                    │   739 │   │   │   │   │   else:                                                                                                                                                                  │
                    │   740 │   │   │   │   │   │   embed = await stream.is_online()                                                                                                                                   │
                    │                                                                                                                                                                                                  │
                    │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py:167 in is_online                                                       │
                    │                                                                                                                                                                                                  │
                    │   164 │   │   │   async with aiohttp.ClientSession() as session:                                                                                                                                 │
                    │   165 │   │   │   │   async with session.get(YOUTUBE_VIDEOS_ENDPOINT, params=params) as r:                                                                                                       │
                    │   166 │   │   │   │   │   data = await r.json()                                                                                                                                                  │
                    │ ❱ 167 │   │   │   return await self.make_embed(data)                                                                                                                                             │
                    │   168 │   │   raise OfflineStream()                                                                                                                                                              │
                    │   169 │                                                                                                                                                                                          │
                    │   170 │   async def make_embed(self, data):              '                                                                                                                                       │
                    │                                                                                                                                                                                                  │
                    │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py:173 in make_embed                                                      │
                    │                                                                                                                                                                                                  │
                    │   170 │   async def make_embed(self, data):                                                                                                                                                      │
                    │   171 │   │   from pprint import pprint                                                                                                                                                          │
                    │   172 │   │   pprint(data["items"])                                                                                                                                                              │
                    │ ❱ 173 │   │   vid_data = data["items"][0]                                                                                                                                                        │
                    │   174 │   │   video_url = "https://youtube.com/watch?v={}".format(vid_data["id"])                                                                                                                │
                    │   175 │   │   title = vid_data["snippet"]["title"]                                                                                                                                               │
                    │   176 │   │   thumbnail = vid_data["snippet"]["thumbnails"]["medium"]["url"]                                                                                                                     │
                    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
                    IndexError: list index out of range

@Kowlin Kowlin self-assigned this Dec 25, 2020
@Kowlin Kowlin added Category: Cogs - Streams This is related to the Streams cog. Status: Accepted We want this and removed Status: Needs Triage This has not been labeled or discussed for handling yet. labels Dec 25, 2020
@Injabie3
Copy link
Contributor

Injabie3 commented Jan 19, 2021

This is a hard to reproduce issue. I sprinkled in a print on the params before we use it for a YT request. It appears this issue arises when the stream goes offline and is privated afterwards.

Attaching some logs with my API key scrubbed. The livestream in question was https://www.youtube.com/watch?v=8AenYrsL8_M

Edit: And some time between me posting this update and me editing this, this stream has been unprivated.

image

[2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Cleaning unmute tasks
[2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Checking server unmutes
[2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Checking channel unmutes
{'id': '3gpkqxvtppM',
 'key': 'xxxx',
 'part': 'snippet,liveStreamingDetails'}
{'id': '8AenYrsL8_M',
 'key': 'xxxx',
 'part': 'snippet,liveStreamingDetails'}
[2021-01-18 20:50:02] [ERROR] red.core.cogs.Streams: An error has occured with Streams. Please report it.
Traceback (most recent call last):
  File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streams.py", line 737, in check_streams
    embed, is_schedule = await stream.is_online()
  File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py", line 169, in is_online
    return await self.make_embed(data)
  File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py", line 175, in make_embed
    vid_data = data["items"][0]
IndexError: list index out of range
{'id': 'lueGJGxj1ws',
 'key': 'xxxx',
 'part': 'snippet,liveStreamingDetails'}
[2021-01-18 20:50:04] [DEBUG] red.core.lavalink: [NODE] | Received Payload:: <{"op":"playerUpdate","state":{"position":589800,"time":1611031804647},"guildId":"xxx"}>

@Jackenmen Jackenmen added this to the 3.4.x milestone Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Cogs - Streams This is related to the Streams cog. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

No branches or pull requests

4 participants