You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/bazarr/api/system/notifications.py

28 lines
503 B

# coding=utf-8
import apprise
from flask import request
from flask_restful import Resource
from ..utils import authenticate
class Notifications(Resource):
@authenticate
def patch(self):
url = request.form.get("url")
asset = apprise.AppriseAsset(async_mode=False)
apobj = apprise.Apprise(asset=asset)
apobj.add(url)
apobj.notify(
title='Bazarr test notification',
body='Test notification'
)
return '', 204