@@ -0,0 +1,1563 @@
+from __future__ import unicode_literals, division, absolute_import%0Aimport logging%0Aimport requests%0A%0Afrom flexget import plugin%0Afrom flexget.event import event%0Afrom flexget.entry import Entry%0A%0Alog = logging.getLogger('couchpotato')%0A%0A%0Aclass CouchPotato(object):%0A%0A    schema = %7B%0A        'type': 'object',%0A        'properties': %7B%0A            'base_url': %7B'tpye': 'string'%7D,%0A            'port': %7B'type': 'number'%7D,%0A            'api_key': %7B'type': 'string'%7D%0A        %7D,%0A        'required': %5B'api_key', 'base_url', 'port'%5D,%0A        'additionalProperties': False%0A    %7D%0A%0A    def on_task_input(self, task, config):%0A        %22%22%22Creates an entry for each item in your couchpotato wanted list.%0A%0A        Syntax:%0A%0A        couchpotato:%0A          base_url: %3Cvalue%3E%0A          port: %3Cvalue%3E%0A          api_key: %3Cvalue%3E%0A%0A        Options base_url, port and api_key are required.%0A        %22%22%22%0A%0A        url = '%25s:%25s/api/%25s/movie.list?status=active' %5C%0A              %25 (config%5B'base_url'%5D, config%5B'port'%5D, config%5B'api_key'%5D)%0A        json = task.requests.get(url).json()%0A        entries = %5B%5D%0A        for movie in json%5B'movies'%5D:%0A            if movie%5B'status'%5D == 'active':%0A                title = movie%5B%22title%22%5D%0A                entry = Entry(title=title,%0A                              url='')%0A                if entry.isvalid():%0A                    entries.append(entry)%0A                else:%0A                    log.debug('Invalid entry created? %25s' %25 entry)%0A%0A        return entries%0A%0A%0A@event('plugin.register')%0Adef register_plugin():%0A    plugin.register(CouchPotato, 'couchpotato', api_ver=2)%0A

add couchpotato plugin