当前位置: 首页>>代码示例>>Python>>正文


Python search.searchProviders函数代码示例

本文整理汇总了Python中sickbeard.search.searchProviders函数的典型用法代码示例。如果您正苦于以下问题:Python searchProviders函数的具体用法?Python searchProviders怎么用?Python searchProviders使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了searchProviders函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: execute

    def execute(self):

        generic_queue.QueueItem.execute(self)

        # check if we want to search for season packs instead of just season/episode
        seasonSearch = False
        seasonEps = self.show.getAllEpisodes(self.segment)
        if len(seasonEps) == len(self.wantedEpisodes):
            seasonSearch = True

        # convert indexer numbering to scene numbering for searches
        for i, epObj in enumerate(self.wantedEpisodes):
            (self.wantedEpisodes[i].scene_season,
             self.wantedEpisodes[i].scene_episode) = sickbeard.scene_numbering.get_scene_numbering(self.show.indexerid,
                                                                                                   self.show.indexer,
                                                                                                   epObj.season,
                                                                                                   epObj.episode)
            logger.log(
                "Beginning backlog search for " + self.wantedEpisodes[i].prettyName() + ' as ' + self.wantedEpisodes[
                    i].prettySceneName())

        # search for our wanted items and return the results
        results = search.searchProviders(self.show, self.segment, self.wantedEpisodes, seasonSearch=seasonSearch)

        # download whatever we find
        for curResult in results:
            search.snatchEpisode(curResult)
            time.sleep(5)

        self.finish()
开发者ID:Bespatter,项目名称:SickRage,代码行数:30,代码来源:search_queue.py

示例2: process

    def process(self, curProvider):
        if self.ep_obj.show.air_by_date:
            logger.log("Beginning manual search for " + self.ep_obj.prettyABDName())
        else:
            logger.log("Beginning manual search for " + self.ep_obj.prettyName())

        return search.searchProviders(self.ep_obj.show, self.ep_obj.season, [self.ep_obj], curProvider, False, True)
开发者ID:3ne,项目名称:SickRage,代码行数:7,代码来源:search_queue.py

示例3: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        episodes = []

        for epObj in episodes:
            (release, provider) = failed_history.findRelease(self.show, epObj.season, epObj.episode)
            if release:
                logger.log(u"Marking release as bad: " + release)
                failed_history.markFailed(self.show, epObj.season, epObj.episode)
                failed_history.logFailed(release)
                history.logFailed(self.show.indexerid, epObj.season, epObj.episode, epObj.status, release, provider)

                failed_history.revertEpisode(self.show, epObj.season, epObj.episode)
                episodes.append(epObj)

        # get search results
        results = search.searchProviders(self.show, episodes[0].season, episodes)

        # download whatever we find
        for curResult in results:
            self.success = search.snatchEpisode(curResult)
            time.sleep(5)

        self.finish()
开发者ID:BobWatson,项目名称:SickBeard-TVRage,代码行数:25,代码来源:search_queue.py

示例4: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        for season, episodes in self.segment.items():
            for epObj in episodes:
                logger.log(u"Marking episode as bad: [" + epObj.prettyName() + "]")
                failed_history.markFailed(epObj)

                (release, provider) = failed_history.findRelease(epObj)
                if release:
                    failed_history.logFailed(release)
                    history.logFailed(epObj, release, provider)

                failed_history.revertEpisode(epObj)
                logger.log("Beginning failed download search for [" + epObj.prettyName() + "]")

                try:
                    searchResult = search.searchProviders(self.show, season, [epObj], True)

                    # reset thread back to original name
                    threading.currentThread().name = self.thread_name

                    if searchResult:
                        for result in searchResult:
                            # just use the first result for now
                            logger.log(u"Downloading " + result.name + " from " + result.provider.name)
                            search.snatchEpisode(result)

                            # give the CPU a break
                            time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])

                    else:
                        logger.log(u"No valid episode found to retry for [" + epObj.prettyName() + "]")
                except Exception, e:
                    logger.log(traceback.format_exc(), logger.DEBUG)
开发者ID:Davejje,项目名称:SickRage,代码行数:35,代码来源:search_queue.py

示例5: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        # check if we want to search for season packs instead of just season/episode
        seasonSearch = False
        seasonEps = self.show.getAllEpisodes(self.segment)
        if len(seasonEps) == len(self.wantedEpisodes):
            seasonSearch = True

        providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive() and x]

        try:
            logger.log("Beginning backlog search for episodes from [" + self.show.name + "]  - Season[" + str(self.segment) + "]")
            searchResult = search.searchProviders(self, self.show, self.segment, self.wantedEpisodes, seasonSearch, False)

            if searchResult:
                self.success = SearchQueue().snatch_item(searchResult)

        except Exception:
            logger.log(traceback.format_exc(), logger.DEBUG)

        if not self.success:
            logger.log(u"No needed episodes found during backlog search")

        self.finish()
开发者ID:vzoltan,项目名称:SickRage,代码行数:25,代码来源:search_queue.py

示例6: run

    def run(self):
        generic_queue.QueueItem.run(self)

        try:
            logger.log(u"Marking episode as bad: [" + self.segment.prettyName() + "]")
            failed_history.markFailed(self.segment)

            (release, provider) = failed_history.findRelease(self.segment)
            if release:
                failed_history.logFailed(release)
                history.logFailed(self.segment, release, provider)

            failed_history.revertEpisode(self.segment)
            logger.log("Beginning failed download search for [" + self.segment.prettyName() + "]")

            searchResult = search.searchProviders(self.show, [self.segment], True)

            if searchResult:
                for result in searchResult:
                    # just use the first result for now
                    logger.log(u"Downloading " + result.name + " from " + result.provider.name)
                    search.snatchEpisode(result)

                    # give the CPU a break
                    time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
            else:
                logger.log(u"No valid episode found to retry for [" + self.segment.prettyName() + "]")
        except Exception:
            logger.log(traceback.format_exc(), logger.DEBUG)

        if self.success is None:
            self.success = False

        self.finish()
开发者ID:elliotlock,项目名称:SickRage,代码行数:34,代码来源:search_queue.py

示例7: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        failed_episodes = []
        for season in self.segment:
            epObj = self.segment[season]

            (release, provider) = failed_history.findRelease(epObj)
            if release:
                logger.log(u"Marking release as bad: " + release)
                failed_history.markFailed(epObj)
                failed_history.logFailed(release)
                history.logFailed(epObj, release, provider)
                failed_history.revertEpisode(epObj)
                failed_episodes.append(epObj)

                logger.log(
                    "Beginning failed download search for [" + epObj.prettyName() + "]")

        if len(failed_episodes):
            try:
                searchResult = search.searchProviders(self, self.show, failed_episodes[0].season, failed_episodes, False, True)

                if searchResult:
                    SearchQueue().snatch_item(searchResult)
                else:
                    logger.log(u"No episodes found to retry for failed downloads return from providers!")
            except Exception, e:
                logger.log(traceback.format_exc(), logger.DEBUG)
开发者ID:EchelonFour,项目名称:SickRage,代码行数:29,代码来源:search_queue.py

示例8: run

    def run(self):
        """
        Run forced search thread
        """
        generic_queue.QueueItem.run(self)
        self.started = True

        try:
            logger.log(u"Beginning {0} {1}search for: [{2}]".
                       format(('forced', 'manual')[bool(self.manual_search)],
                              ('', 'season pack ')[bool(self.manual_search_type == 'season')], self.segment[0].prettyName()))

            search_result = search.searchProviders(self.show, self.segment, True, self.downCurQuality,
                                                   self.manual_search, self.manual_search_type)

            if not self.manual_search and search_result:
                # just use the first result for now
                if search_result[0].seeders not in (-1, None) and search_result[0].leechers not in (-1, None):
                    logger.log(u"Downloading {0} with {1} seeders and {2} leechers from {3}".
                               format(search_result[0].name,
                                      search_result[0].seeders, search_result[0].leechers, search_result[0].provider.name))
                else:
                    logger.log(u"Downloading {0} from {1}".format(search_result[0].name, search_result[0].provider.name))
                self.success = search.snatchEpisode(search_result[0])

                # give the CPU a break
                time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
            elif self.manual_search and search_result:
                self.results = search_result
                self.success = True
                if self.manual_search_type == 'season':
                    ui.notifications.message("We have found season pack results for {0}".format(self.show.name),
                                             "These should become visible in the manual select page.")
                else:
                    ui.notifications.message("We have found single results for {0}".format(self.segment[0].prettyName()),
                                             "These should become visible in the manual select page.")
            else:
                ui.notifications.message('No results were found')
                logger.log(u"Unable to find {0} {1}results for: [{2}]".
                           format(('forced', 'manual')[bool(self.manual_search)],
                                  ('', 'season pack ')[bool(self.manual_search_type == 'season')],
                                  self.segment[0].prettyName()))

        except Exception:
            self.success = False
            logger.log(traceback.format_exc(), logger.DEBUG)

        # ## Keep a list with the 100 last executed searches
        fifo(FORCED_SEARCH_HISTORY, self, FORCED_SEARCH_HISTORY_SIZE)

        if self.success is None:
            self.success = False

        self.finish()
开发者ID:bitzorro,项目名称:SickRage,代码行数:54,代码来源:search_queue.py

示例9: run

    def run(self):
        super(FailedQueueItem, self).run()
        self.started = True

        try:
            for epObj in self.segment:

                logger.log("Marking episode as bad: [" + epObj.pretty_name() + "]")

                failed_history.markFailed(epObj)

                (release, provider) = failed_history.findRelease(epObj)
                if release:
                    failed_history.logFailed(release)
                    history.logFailed(epObj, release, provider)

                failed_history.revertEpisode(epObj)
                logger.log("Beginning failed download search for: [" + epObj.pretty_name() + "]")

            # If it is wanted, self.downCurQuality doesnt matter
            # if it isnt wanted, we need to make sure to not overwrite the existing ep that we reverted to!
            searchResult = search.searchProviders(self.show, self.segment, True, False)

            if searchResult:
                for result in searchResult:
                    # just use the first result for now
                    logger.log("Downloading " + result.name + " from " + result.provider.name)
                    search.snatchEpisode(result)

                    # give the CPU a break
                    time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
            else:
                pass
                # logger.log(u"No valid episode found to retry for: [" + self.segment.pretty_name() + "]")
        except Exception:
            logger.log(traceback.format_exc(), logger.DEBUG)

        # ## Keep a list with the 100 last executed searches
        fifo(MANUAL_SEARCH_HISTORY, self, MANUAL_SEARCH_HISTORY_SIZE)

        if self.success is None:
            self.success = False

        super(FailedQueueItem, self).finish()
        self.finish()
开发者ID:murbaniak,项目名称:SickRage,代码行数:45,代码来源:search_queue.py

示例10: test

    def test(self):
        global searchItems
        searchItems = curData["i"]
        show = TVShow(1, tvdbdid)
        show.name = show_name
        show.quality = curData["q"]
        show.saveToDB()
        sickbeard.showList.append(show)
        episode = None

        for epNumber in curData["e"]:
            episode = TVEpisode(show, curData["s"], epNumber)
            episode.status = c.WANTED
            episode.saveToDB()

        bestResult = search.searchProviders(show, episode.season, episode.episode, forceSearch)
        if not bestResult:
            self.assertEqual(curData["b"], bestResult)
        self.assertEqual(curData["b"], bestResult.name) #first is expected, second is choosen one
开发者ID:joshguerette,项目名称:SickGear,代码行数:19,代码来源:snatch_tests.py

示例11: run

    def run(self):
        generic_queue.QueueItem.run(self)
        self.started = True
        
        try:
            for epObj in self.segment:
            
                logger.log(u'Marking episode as bad: [' + epObj.prettyName() + ']')
                
                failed_history.markFailed(epObj)
    
                (release, provider) = failed_history.findRelease(epObj)
                if release:
                    failed_history.logFailed(release)
                    history.logFailed(epObj, release, provider)
    
                failed_history.revertEpisode(epObj)
                logger.log('Beginning failed download search for: [' + epObj.prettyName() + ']')

            searchResult = search.searchProviders(self.show, self.segment, True)

            if searchResult:
                for result in searchResult:
                    # just use the first result for now
                    logger.log(u'Downloading ' + result.name + ' from ' + result.provider.name)
                    search.snatchEpisode(result)

                    # give the CPU a break
                    time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
            else:
                pass
                #logger.log(u"No valid episode found to retry for: [" + self.segment.prettyName() + "]")
        except Exception:
            logger.log(traceback.format_exc(), logger.DEBUG)
            
        finally:
            ### Keep a list with the 100 last executed searches
            fifo(MANUAL_SEARCH_HISTORY, self, MANUAL_SEARCH_HISTORY_SIZE)

            if self.success is None:
                self.success = False

            self.finish()
开发者ID:joshguerette,项目名称:SickGear,代码行数:43,代码来源:search_queue.py

示例12: run

    def run(self):
        generic_queue.QueueItem.run(self)

        try:
            logger.log("Beginning backlog search for: [" + self.show.name + "]")
            searchResult = search.searchProviders(self.show, self.segment, False)

            if searchResult:
                for result in searchResult:
                    # just use the first result for now
                    logger.log(u"Downloading " + result.name + " from " + result.provider.name)
                    search.snatchEpisode(result)

                    # give the CPU a break
                    time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
            else:
                logger.log(u"No needed episodes found during backlog search for: [" + self.show.name + "]")
        except Exception:
            logger.log(traceback.format_exc(), logger.DEBUG)

        self.finish()
开发者ID:Hellowlol,项目名称:SickRage,代码行数:21,代码来源:search_queue.py

示例13: do_test

    def do_test():
        """
        Test to perform
        """
        global search_items  # pylint: disable=global-statement
        search_items = cur_data["i"]
        show = TVShow(1, tvdb_id)
        show.name = show_name
        show.quality = cur_data["q"]
        show.saveToDB()
        sickbeard.showList.append(show)
        episode = None

        for epNumber in cur_data["e"]:
            episode = TVEpisode(show, cur_data["s"], epNumber)
            episode.status = common.WANTED
            episode.saveToDB()

        best_result = search.searchProviders(show, episode.episode, force_search)
        if not best_result:
            assert cur_data["b"] == best_result
        # pylint: disable=no-member
        assert cur_data["b"] == best_result.name  # first is expected, second is chosen one
开发者ID:hernandito,项目名称:SickRage,代码行数:23,代码来源:snatch_tests.py

示例14: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        for season, episode in self.segment.iteritems():
            epObj = self.show.getEpisode(season, episode)

            (release, provider) = failed_history.findRelease(self.show, season, episode)
            if release:
                logger.log(u"Marking release as bad: " + release)
                failed_history.markFailed(self.show, season, episode)
                failed_history.logFailed(release)
                history.logFailed(self.show.indexerid, season, episode, epObj.status, release, provider)

            failed_history.revertEpisode(self.show, season, episode)

            # get search results
            results = search.searchProviders(self.show, season, episode)

            # download whatever we find
            for curResult in results:
                self.success = search.snatchEpisode(curResult)
                time.sleep(5)

        self.finish()
开发者ID:Wizkidje,项目名称:SickBeard-TVRage,代码行数:24,代码来源:search_queue.py


注:本文中的sickbeard.search.searchProviders函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。