Remove processing of tags;

- Removes all logic related to stream tags processing
- Implements a new method of fetching live non-ACL channels, with drops enabled
- Minor logic cleanup changes
This commit is contained in:
DevilXD committed 2023-10-15 12:06:58 +02:00
1 parent 67cfc6603d
commit 5e862f9543
4 files changed
+54 -22

No files matched your search

+5 -7
View File
@@ -65,7 +65,6 @@ from constants import (
GQL_OPERATIONS,
MAX_CHANNELS,
WATCH_INTERVAL,
# DROPS_ENABLED_TAG,
State,
ClientType,
WebsocketTopic,
@@ -1537,7 +1536,7 @@ class Twitch:
if (
"message" in error_dict
and error_dict["message"] in (
"service error",
# "service error",
"service unavailable",
"service timeout",
"context deadline exceeded",
@@ -1558,8 +1557,7 @@ class Twitch:
merged = {}
for key in set(chain(primary_data.keys(), secondary_data.keys())):
in_primary = key in primary_data
in_secondary = key in secondary_data
if in_primary and in_secondary:
if in_primary and key in secondary_data:
vp = primary_data[key]
vs = secondary_data[key]
if not isinstance(vp, type(vs)) or not isinstance(vs, type(vp)):
@@ -1693,15 +1691,15 @@ class Twitch:
response = await self.gql_request(
GQL_OPERATIONS["GameDirectory"].with_variables({
"limit": limit,
"name": game.name,
"slug": game.slug,
"options": {
"includeRestricted": ["SUB_ONLY_LIVE"],
# "tags": [DROPS_ENABLED_TAG],
"systemFilters": ["DROPS_ENABLED"],
},
})
)
return [
Channel.from_directory(self, stream_channel_data["node"])
Channel.from_directory(self, stream_channel_data["node"], drops_enabled=True)
for stream_channel_data in response["data"]["game"]["streams"]["edges"]
]