Skip to content

Commit b86dd3c

Browse files
committed
Merge branch 'master' into linux
2 parents 98f7721 + e408869 commit b86dd3c

12 files changed

+665
-347
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ if they aren't already there. Doing so ensures proper markdown rendering on Gith
6969
• Please ensure your editor won't trim the spaces upon saving the file.
7070
-->
7171

72-
@Suz1e - For the entirety of the Chinese (简体中文) translation.
72+
@Suz1e - For the entirety of the Chinese (简体中文) translation and revisions.
73+
@wwj010 - For the Chinese (简体中文) translation corrections and revisions.
7374
@nwvh - For the entirety of the Czech (Čeština) translation.
7475
@ThisIsCyreX - For the entirety of the German (Deutsch) translation.

channel.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222

2323
class Stream:
24+
__slots__ = ("channel", "broadcast_id", "viewers", "drops_enabled", "game", "title")
25+
2426
def __init__(
2527
self,
2628
channel: Channel,
@@ -76,7 +78,7 @@ def __init__(
7678
id: SupportsInt,
7779
login: str,
7880
display_name: str | None = None,
79-
priority: bool = False,
81+
acl_based: bool = False,
8082
):
8183
self._twitch: Twitch = twitch
8284
self._gui_channels: ChannelList = twitch.gui.channels
@@ -87,11 +89,11 @@ def __init__(
8789
self.points: int | None = None
8890
self._stream: Stream | None = None
8991
self._pending_stream_up: asyncio.Task[Any] | None = None
90-
# Priority channels are:
92+
# ACL-based channels are:
9193
# • considered first when switching channels
92-
# • if we're watching a non-priority channel, a priority channel going up triggers a switch
94+
# • if we're watching a non-based channel, a based channel going up triggers a switch
9395
# • not cleaned up unless they're streaming a game we haven't selected
94-
self.priority: bool = priority
96+
self.acl_based: bool = acl_based
9597

9698
@classmethod
9799
def from_acl(cls, twitch: Twitch, data: JsonType) -> Channel:
@@ -100,7 +102,7 @@ def from_acl(cls, twitch: Twitch, data: JsonType) -> Channel:
100102
id=data["id"],
101103
login=data["name"],
102104
display_name=data.get("displayName"),
103-
priority=True,
105+
acl_based=True,
104106
)
105107

106108
@classmethod
@@ -114,9 +116,9 @@ def from_directory(cls, twitch: Twitch, data: JsonType) -> Channel:
114116

115117
@classmethod
116118
async def from_name(
117-
cls, twitch: Twitch, channel_login: str, *, priority: bool = False
119+
cls, twitch: Twitch, channel_login: str, *, acl_based: bool = False
118120
) -> Channel:
119-
self = cls(twitch, id=0, login=channel_login, priority=priority)
121+
self = cls(twitch, id=0, login=channel_login, acl_based=acl_based)
120122
# id and display name to be filled/overwritten by get_stream
121123
stream = await self.get_stream()
122124
if stream is not None:
@@ -180,7 +182,7 @@ def pending_online(self) -> bool:
180182

181183
@property
182184
def game(self) -> Game | None:
183-
if self._stream is not None and self._stream.game is not None:
185+
if self._stream is not None:
184186
return self._stream.game
185187
return None
186188

constants.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def _resource_path(relative_path: Path | str) -> Path:
6464
BASE_URL = URL("https://twitch.tv")
6565
CLIENT_ID = "kd1unb4b3q4t58fwlpcbzcbnm76a8fp"
6666
# CLIENT_ID = "uo6dggojyb8d6soh92zknwmi5ej1q2"
67-
USER_AGENT = (
68-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
69-
"Chrome/105.0.0.0 Safari/537.36"
67+
ANDROID_USER_AGENT = (
68+
"Dalvik/2.1.0 (Linux; U; Android 7.1.2; SM-G975N Build/N2G48C) "
69+
"tv.twitch.android.app/13.4.1/1304010"
7070
)
7171
# Intervals and Delays
7272
PING_INTERVAL = timedelta(minutes=3)

0 commit comments

Comments
 (0)