listening to local owncast now

This commit is contained in:
Lili (Tlapka) 2022-05-25 13:24:55 +02:00
parent 540f9309e1
commit 1d3bce203c
1 changed files with 10 additions and 0 deletions

10
main.py
View File

@ -1,4 +1,5 @@
from flask import Flask,request,json
import requests
app = Flask(__name__)
@ -14,5 +15,14 @@ def githubIssue():
print(f'{data["issue"]["url"]} \n')
return data
@app.route('/owncastWebhook',methods=['POST'])
def owncastWebhook():
data = request.json
if data["type"] == "CHAT":
print("New chat message:")
print(f'from {data["eventData"]["user"]["displayName"]}:')
print(f'{data["eventData"]["body"]}')
return data
if __name__ == '__main__':
app.run(debug=True)