1
0
Fork 0
mirror of synced 2024-05-20 12:32:26 +12:00

Add a check to ensure that we have online channels

This commit is contained in:
Phxntxm 2017-03-27 21:27:17 -05:00
parent 26bd3931a6
commit e8b725484a

View file

@ -35,6 +35,8 @@ class Picarto:
# Channel is the name we are checking against that
# This creates a list of all users that match this channel name (should only ever be 1)
# And returns True as long as it is more than 0
if not self.channels:
return False
channel = re.search("(?<=picarto.tv/)(.*)", channel).group(1)
matches = [stream for stream in self.online_channels if stream['channel_name'].lower() == channel.lower()]
return len(matches) > 0