[Streams] Attempt to fix unclear error in youtubestream (#4148)

This commit is contained in:
Jamie
2020-08-05 19:39:28 +01:00
committed by jack1142
parent dc3fe1f8f8
commit b8e56f3632

View File

@@ -190,6 +190,12 @@ class YoutubeStream(Stream):
raise StreamNotFound()
elif "items" in data:
return data["items"][0][resource]
elif (
"pageInfo" in data
and "totalResults" in data["pageInfo"]
and data["pageInfo"]["totalResults"] < 1
):
raise StreamNotFound()
raise APIError()
def __repr__(self):