2019-02-18 00:26:46 +01:00
|
|
|
from platypush.context import get_plugin
|
|
|
|
from platypush.plugins.media.search import MediaSearcher
|
|
|
|
|
|
|
|
class TorrentMediaSearcher(MediaSearcher):
|
|
|
|
def search(self, query):
|
|
|
|
self.logger.info('Searching torrents for "{}"'.format(query))
|
|
|
|
|
|
|
|
torrents = get_plugin('torrent')
|
|
|
|
if not torrents:
|
|
|
|
raise RuntimeError('Torrent plugin not available/configured')
|
2019-06-24 01:01:08 +02:00
|
|
|
return torrents.search(query, ).output
|
2019-02-18 00:26:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# vim:sw=4:ts=4:et:
|