本文整理汇总了Python中sickbeard.tvcache.TVCache.search_cache方法的典型用法代码示例。如果您正苦于以下问题:Python TVCache.search_cache方法的具体用法?Python TVCache.search_cache怎么用?Python TVCache.search_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sickbeard.tvcache.TVCache
的用法示例。
在下文中一共展示了TVCache.search_cache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GenericProvider
# 需要导入模块: from sickbeard.tvcache import TVCache [as 别名]
# 或者: from sickbeard.tvcache.TVCache import search_cache [as 别名]
#.........这里部分代码省略.........
logger.log('Downloading a result from {0} at {1}'.format(self.name, url))
downloaded_filename = download_file(url, filename, session=self.session, headers=self.headers,
hooks={'response': self.get_url_hook}, return_filename=True)
if downloaded_filename:
if self._verify_download(downloaded_filename):
logger.log('Saved result to {0}'.format(downloaded_filename), logger.INFO)
return True
logger.log('Could not download {0}'.format(url), logger.WARNING)
remove_file_failed(downloaded_filename)
if urls:
logger.log('Failed to download any results', logger.WARNING)
return False
def find_propers(self, search_date=None):
results = self.cache.list_propers(search_date)
return [Proper(x[b'name'], x[b'url'], datetime.fromtimestamp(x[b'time']), self.show) for x in results]
def find_search_results(self, show, episodes, search_mode, # pylint: disable=too-many-branches,too-many-arguments,too-many-locals,too-many-statements
manual_search=False, download_current_quality=False):
self._check_auth()
self.show = show
results = {}
items_list = []
searched_scene_season = None
for episode in episodes:
cache_result = self.cache.search_cache(episode, manual_search=manual_search,
down_cur_quality=download_current_quality)
if cache_result:
if episode.episode not in results:
results[episode.episode] = cache_result
else:
results[episode.episode].extend(cache_result)
continue
if len(episodes) > 1 and search_mode == 'sponly' and searched_scene_season == episode.scene_season:
continue
search_strings = []
searched_scene_season = episode.scene_season
if len(episodes) > 1 and search_mode == 'sponly':
search_strings = self._get_season_search_strings(episode)
elif search_mode == 'eponly':
search_strings = self._get_episode_search_strings(episode)
for search_string in search_strings:
items_list += self.search(search_string, ep_obj=episode)
if len(results) == len(episodes):
return results
if items_list:
items = {}
unknown_items = []
for item in items_list:
quality = self.get_quality(item, anime=show.is_anime)