platypush/plugins/torrent/__init__.py
def search(self, query, category=None, language=None, *args, **kwargs):
        """
        Perform a search of video torrents.

        :param query: Query string, video name or partial name
        :type query: str

        :param category: Category to search. Supported types: "movies", "tv".
            Default: None (search all categories)
        :type category: str or list

        :param language: Language code for the results - example: "en" (default: None, no filter)
        :type language: str
        """

        assert self.imdb_key, 'No imdb_key specified'
        results = []
        if isinstance(category, str):
            category = [category]

        # noinspection PyCallingNonCallable
        def worker(cat):
            if cat not in self.categories:
                raise RuntimeError('Unsupported category {}. Supported category: {}'.
                                   format(cat, self.categories.keys()))

            self.logger.info('Searching {} torrents for "{}"'.format(cat, query))
            results.extend(self.categories[cat](query, language=language, *args, **kwargs))

        workers = [
            threading.Thread(target=worker, kwargs={'cat': category})
            for category in (category or self.categories.keys())
        ]

        for worker in workers:
            worker.start()
        for worker in workers:
            worker.join()

        return results

        Perform a search of video torrents.

        :param query: Query string, video name or partial name
        :type query: str

        :param category: Category to search. Supported types: "movies", "tv".
            Default: None (search all categories)
        :type category: str or list

        :param language: Language code for the results - example: "en" (default: None, no filter)
        :type language: str
        
Perform a search of video torrents.
Perform a search of video torrents .
def search(self, query, category=None, language=None, *args, **kwargs):
        assert self.imdb_key, 'No imdb_key specified'
        results = []
        if isinstance(category, str):
            category = [category]
        def worker(cat):
            if cat not in self.categories:
                raise RuntimeError('Unsupported category {}. Supported category: {}'.
                                   format(cat, self.categories.keys()))
            self.logger.info('Searching {} torrents for "{}"'.format(cat, query))
            results.extend(self.categories[cat](query, language=language, *args, **kwargs))
        workers = [
            threading.Thread(target=worker, kwargs={'cat': category})
            for category in (category or self.categories.keys())
        ]
        for worker in workers:
            worker.start()
        for worker in workers:
            worker.join()
        return results
def search ( self , query , category = None , language = None , * args , ** kwargs ) : assert self . imdb_key , 'No imdb_key specified' results = [ ] if isinstance ( category , str ) : category = [ category ] def worker ( cat ) : if cat not in self . categories : raise RuntimeError ( 'Unsupported category {}. Supported category: {}' . format ( cat , self . categories . keys ( ) ) ) self . logger . info ( 'Searching {} torrents for "{}"' . format ( cat , query ) ) results . extend ( self . categories [ cat ] ( query , language = language , * args , ** kwargs ) ) workers = [ threading . Thread ( target = worker , kwargs = { 'cat' : category } ) for category in ( category or self . categories . keys ( ) ) ] for worker in workers : worker . start ( ) for worker in workers : worker . join ( ) return results
Perform a search of video torrents.
Perform a search of video torrents .
"""
        Perform a search of video torrents.

        :param query: Query string, video name or partial name
        :type query: str

        :param category: Category to search. Supported types: "movies", "tv".
            Default: None (search all categories)
        :type category: str or list

        :param language: Language code for the results - example: "en" (default: None, no filter)
        :type language: str
        """ # noinspection PyCallingNonCallable
self
query
Query string, video name or partial name
Query string video name or partial name
category
Category to search. Supported types: "movies", "tv".
Default: None (search all categories)
Category to search . Supported types : " movies " " tv " . Default : None ( search all categories )
language
Language code for the results - example: "en" (default: None, no filter)
Language code for the results - example : " en " ( default : None no filter )