[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 GitHub
parent c673bb0979
commit 0cc04706f6

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):