|
|
@@ -31,12 +31,16 @@ def live_now(): # Check if stream is live
|
|
|
url = f'{owncast_url}/api/status'
|
|
|
try:
|
|
|
response = requests.get(url)
|
|
|
+ if response.json()['online']:
|
|
|
+ return True
|
|
|
+ else:
|
|
|
+ return False
|
|
|
except requests.exceptions.RequestException as cserror:
|
|
|
current_app.logger.error(f'Couldn\'t check if stream is live: {cserror.args[0]}')
|
|
|
return False
|
|
|
- return response.json()['online']
|
|
|
else:
|
|
|
current_app.logger.error('Owncast url is not set. Can\'t check if stream is live.')
|
|
|
+ return False
|
|
|
|
|
|
|
|
|
def award_points(db): # Award points to users
|