Add exception-catchers that point out exactly which game or channel causes a crash
This commit is contained in:
1 parent
dbd3cd82a0
commit
a536dde677
2 files changed
+19
-13
No files matched your search
@@ -1710,16 +1710,19 @@ class Twitch:
|
||||
return None
|
||||
|
||||
async def get_live_streams(self, game: Game, *, limit: int = 30) -> list[Channel]:
|
||||
response = await self.gql_request(
|
||||
GQL_OPERATIONS["GameDirectory"].with_variables({
|
||||
"limit": limit,
|
||||
"slug": game.slug,
|
||||
"options": {
|
||||
"includeRestricted": ["SUB_ONLY_LIVE"],
|
||||
"systemFilters": ["DROPS_ENABLED"],
|
||||
},
|
||||
})
|
||||
)
|
||||
try:
|
||||
response = await self.gql_request(
|
||||
GQL_OPERATIONS["GameDirectory"].with_variables({
|
||||
"limit": limit,
|
||||
"slug": game.slug,
|
||||
"options": {
|
||||
"includeRestricted": ["SUB_ONLY_LIVE"],
|
||||
"systemFilters": ["DROPS_ENABLED"],
|
||||
},
|
||||
})
|
||||
)
|
||||
except MinerException as exc:
|
||||
raise MinerException(f"Game: {game.slug}") from exc
|
||||
if "game" in response["data"]:
|
||||
return [
|
||||
Channel.from_directory(self, stream_channel_data["node"], drops_enabled=True)
|
||||
|
||||
Reference in new issue
Block a user