Skip to content

Commit 0cc0470

Browse files
authored
[Streams] Attempt to fix unclear error in youtubestream (Cog-Creators#4148)
1 parent c673bb0 commit 0cc0470

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

redbot/cogs/streams/streamtypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ async def _fetch_channel_resource(self, resource: str):
190190
raise StreamNotFound()
191191
elif "items" in data:
192192
return data["items"][0][resource]
193+
elif (
194+
"pageInfo" in data
195+
and "totalResults" in data["pageInfo"]
196+
and data["pageInfo"]["totalResults"] < 1
197+
):
198+
raise StreamNotFound()
193199
raise APIError()
194200

195201
def __repr__(self):

0 commit comments

Comments
 (0)