forked from platypush/platypush
Fabio Manganiello
ce882381c0
- 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.
16 lines
521 B
Python
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:
|