2022-04-19 13:27:39 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from flask import Flask, Response
|
2022-04-27 11:24:45 +03:00
|
|
|
from core import owncast, __version__
|
|
|
|
from core.logger import logging
|
2022-04-19 13:27:39 +03:00
|
|
|
|
|
|
|
|
2022-04-24 04:47:08 +03:00
|
|
|
logging.info("Loaded %s, running ameliabot v%s)" % (
|
|
|
|
owncast.config["DEFAULT"]["BotName"], __version__))
|
2022-04-19 13:27:39 +03:00
|
|
|
|
|
|
|
# the url of the Owncast API for bot posts
|
|
|
|
owncast_url = "{}/api/integrations/chat/send".format(
|
2022-04-24 04:47:08 +03:00
|
|
|
owncast.config["owncast"]["ServerURL"])
|
2022-04-19 13:27:39 +03:00
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/webhook/owncast', methods=['POST'])
|
|
|
|
def respond():
|
|
|
|
owncast.parse_webhook()
|
|
|
|
return Response(status=200)
|