platypush/platypush/plugins/media/search/torrent.py
Fabio Manganiello ce882381c0 Fixes to torrent search + SASS library migration
- Support for custom PopcornTime API mirror/base URL.

- Full support for TV series search.

- Fixed torrent search (now using a different PopcornTime API mirror).

- Migrated SASS engine from `node-sass` (currently deprecated and broken on Node 16) to `sass`.

- Fixed alignment of Z-Wave UI header on Chrome/Webkit.
2021-05-06 23:18:47 +02:00

16 lines
521 B
Python

from platypush.context import get_plugin
from platypush.plugins.media.search import MediaSearcher
class TorrentMediaSearcher(MediaSearcher):
def search(self, query, **kwargs):
self.logger.info('Searching torrents for "{}"'.format(query))
torrents = get_plugin(self.media_plugin.torrent_plugin if self.media_plugin else 'torrent')
if not torrents:
raise RuntimeError('Torrent plugin not available/configured')
return torrents.search(query, ).output
# vim:sw=4:ts=4:et: