@@ -0,0 +1,2494 @@
+from loguru import logger%0Afrom requests.exceptions import RequestException%0A%0Afrom flexget import plugin%0Afrom flexget.event import event%0Afrom flexget.plugin import PluginWarning%0Afrom flexget.utils.requests import Session as RequestSession%0A%0Arequests = RequestSession(max_retries=3)%0A%0Aplugin_name = 'bark'%0A%0Alogger = logger.bind(name=plugin_name)%0A%0A%0Aclass BarkNotifier:%0A    %22%22%22%0A    Example::%0A%0A      notify:%0A        entries:%0A        title: %7C%0A              %7B%7Btask%7D%7D%0A        message: %7C%0A              %7B%25 if series_name is defined %25%7D%7B%7Bseries_name%7D%7D%7B%25 if series_id is defined %25%7D - %7B%7Bseries_id%7D%7D%7B%25 endif %25%7D%7B%25 if trakt_ep_name is defined %25%7D - %7B%7Btrakt_ep_name%7D%7D%7B%25 endif %25%7D%0A              %7B%25 elif imdb_name is defined%25%7D%7B%7Bmovie_name%7D%7D%0A              %7B%25 else %25%7D%7B%7Btitle%7D%7D%0A              %7B%25 endif %25%7D%0A          via:%0A            webpost:%0A              server: %3Cstring%3E%0A              device_key: %3Cstring%3E%0A              %5Blevel: %3Cstring%3E%5D%0A              %5Bbadge: %3Cint%3E%5D%0A              %5BautomaticallyCopy: %3Cstring%3E%5D%0A              %5Bcopy: %3Cstring%3E%5D%0A              %5Bsound: %3Cstring%3E%5D%0A              %5Bicon: %3Cstring%3E%5D%0A              %5Bgroup: %3Cstring%3E%5D%0A              %5BisArchive: %3Cstring%3E%5D%0A              %5Burl: %3Cstring%3E%5D%0A%0A    # https://github.com/Finb/bark-server/blob/master/docs/API_V2.md%0A%0A    %22%22%22%0A%0A    schema = %7B%0A        'type': 'object',%0A        'properties': %7B%0A            'server': %7B'type': 'string'%7D,%0A            'device_key': %7B'type': 'string'%7D,%0A            'level': %7B'type': 'string'%7D,%0A            'badge': %7B'type': 'int'%7D,%0A            'automaticallyCopy': %7B'type': 'string'%7D,%0A            'copy': %7B'type': 'string'%7D,%0A            'sound': %7B'type': 'string'%7D,%0A            'icon': %7B'type': 'string'%7D,%0A            'group': %7B'type': 'string'%7D,%0A            'isArchive': %7B'type': 'string'%7D,%0A            'url': %7B'type': 'string'%7D%0A        %7D,%0A        'required': %5B'server', 'device_key'%5D,%0A        'additionalProperties': False,%0A    %7D%0A%0A    def notify(self, title, message, config):%0A        %22%22%22%0A        Send notification to Bark%0A        %22%22%22%0A        notification = %7B%0A            'title': title,%0A            'body': message,%0A        %7D%0A        options = config.copy()%0A        server = options.pop('server')%0A        notification.update(options)%0A        try:%0A            requests.post(server, json=notification)%0A        except RequestException as e:%0A            raise PluginWarning(e.args%5B0%5D)%0A%0A%0A@event('plugin.register')%0Adef register_plugin():%0A    plugin.register(BarkNotifier, plugin_name,%0A                    api_ver=2, interfaces=%5B'notifiers'%5D)%0A

Add notifier for Bark