1
0
Fork 0
mirror of synced 2024-05-24 14:29:39 +12:00

Ensure the Picarto channel is given when checking online

This commit is contained in:
Phxntxm 2017-07-15 14:13:40 -05:00
parent 8ff72f07bd
commit caa3854dc2

View file

@ -28,6 +28,9 @@ class Picarto:
self.online_channels = await utils.request(url, payload=payload)
async def channel_embed(self, channel):
# First make sure the picarto URL is actually given
if not channel:
return None
# Use regex to get the actual username so that we can make a request to the API
stream = re.search("(?<=picarto.tv/)(.*)", channel).group(1)
url = BASE_URL + '/channel/name/{}'.format(stream)