diff --git a/tystream/async_api/twitch.py b/tystream/async_api/twitch.py index 407c650..ec070fd 100644 --- a/tystream/async_api/twitch.py +++ b/tystream/async_api/twitch.py @@ -40,7 +40,7 @@ async def check_stream_live(self, streamer_name: str) -> TwitchStreamData: ------- :class:`TwitchStreamData` An instance of the TwitchStreamData class containing information about the live stream. - If the stream is not live, an empty TwitchStreamData instance is returned. + If the stream is not live, returned False. """ headers = await self._get_headers() async with aiohttp.ClientSession() as session: @@ -52,7 +52,7 @@ async def check_stream_live(self, streamer_name: str) -> TwitchStreamData: if not stream_data["data"]: self.logger.log(25, f"{streamer_name} is not live.") - return TwitchStreamData() + return False else: self.logger.log(25, f"{streamer_name} is live!") return TwitchStreamData(**stream_data["data"][0]) diff --git a/tystream/async_api/youtube.py b/tystream/async_api/youtube.py index 43f9994..d79662c 100644 --- a/tystream/async_api/youtube.py +++ b/tystream/async_api/youtube.py @@ -62,7 +62,7 @@ async def _get_live_id(self, channelid: str) -> str: ------- :class:`str` The ID of the live stream if a live stream is found. - False if no live stream is found. + Return False if no live stream is found. """ url = f"https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={channelid}&eventType=live&type=video&key={self.api_key}" @@ -87,7 +87,7 @@ async def check_stream_live(self, username: str) -> YoutubeStreamData: ------- :class:`YoutubeStreamData` An instance of the YoutubeStreamData class containing information about the live stream. - If the stream is not live, an empty YoutubeStreamData instance is returned.s + If the stream is not live, returned False. """ channelId = await self._get_channel_id(username) LiveId = await self._get_live_id(channelId) @@ -105,4 +105,4 @@ async def check_stream_live(self, username: str) -> YoutubeStreamData: return YoutubeStreamData(id=LiveId, **data) else: self.logger.log(20, f"{username} is not live.") - return YoutubeStreamData() + return False diff --git a/tystream/twitch.py b/tystream/twitch.py index 5d40941..bce42be 100644 --- a/tystream/twitch.py +++ b/tystream/twitch.py @@ -46,7 +46,7 @@ def check_stream_live(self, streamer_name: str) -> TwitchStreamData: ------- :class:`TwitchStreamData` An instance of the TwitchStreamData class containing information about the live stream. - If the stream is not live, an empty TwitchStreamData instance is returned. + If the stream is not live, returned False. """ headers = self._get_headers() stream = requests.get( diff --git a/tystream/youtube.py b/tystream/youtube.py index 4d0cefe..5490f6b 100644 --- a/tystream/youtube.py +++ b/tystream/youtube.py @@ -90,7 +90,7 @@ def check_stream_live(self, username: str) -> YoutubeStreamData: ------- :class:`YoutubeStreamData` An instance of the YoutubeStreamData class containing information about the live stream. - If the stream is not live, an empty YoutubeStreamData instance is returned.s + If the stream is not live, returned False. """ channelId = self._get_channel_id(username) LiveId = self._get_live_id(channelId) @@ -107,4 +107,4 @@ def check_stream_live(self, username: str) -> YoutubeStreamData: return YoutubeStreamData(id=LiveId, **data) else: self.logger.log(20, f"{username} is not live.") - return YoutubeStreamData() + return False