本文整理汇总了Python中sickbeard.show_name_helpers.allPossibleShowNames函数的典型用法代码示例。如果您正苦于以下问题:Python allPossibleShowNames函数的具体用法?Python allPossibleShowNames怎么用?Python allPossibleShowNames使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了allPossibleShowNames函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_episode_search_strings
def _get_episode_search_strings(self, show, season, episode, add_string=''):
search_string = {'Episode': []}
if not episode:
return []
if show.air_by_date:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
str(episode).replace('-', '|') + '|' + \
episode.strftime('%b')
search_string['Episode'].append(ep_string)
elif show.sports:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
str(episode).replace('-', '|') + '|' + \
episode.strftime('%b')
search_string['Episode'].append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = show_name_helpers.sanitizeSceneName(show_name) + ' ' + \
sickbeard.config.naming_ep_type[2] % {'seasonnumber': season,
'episodenumber': episode}
search_string['Episode'].append(re.sub('\s+', ' ', ep_string))
return [search_string]
示例2: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=""):
search_string = {"Episode": []}
if not ep_obj:
return []
if self.show.air_by_date:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + " " + str(ep_obj.airdate).replace("-", "|")
search_string["Episode"].append(ep_string)
elif self.show.sports:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = (
sanitizeSceneName(show_name)
+ " "
+ str(ep_obj.airdate).replace("-", "|")
+ "|"
+ ep_obj.airdate.strftime("%b")
)
search_string["Episode"].append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = (
show_name_helpers.sanitizeSceneName(show_name)
+ " "
+ sickbeard.config.naming_ep_type[2]
% {"seasonnumber": ep_obj.scene_season, "episodenumber": ep_obj.scene_episode}
)
search_string["Episode"].append(re.sub("\s+", " ", ep_string))
return [search_string]
示例3: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=''):
search_string = {'Episode': []}
if not ep_obj:
return []
if self.show.air_by_date:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + '.' + \
str(ep_obj.airdate).replace('-', '|')
search_string['Episode'].append(ep_string)
elif self.show.sports:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + '.' + \
str(ep_obj.airdate).replace('-', '|') + '|' + \
ep_obj.airdate.strftime('%b')
search_string['Episode'].append(ep_string)
elif self.show.anime:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + '.' + \
"%i" % int(ep_obj.scene_absolute_number)
search_string['Episode'].append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = show_name_helpers.sanitizeSceneName(show_name) + '.' + \
sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep_obj.scene_season,
'episodenumber': ep_obj.scene_episode} + ' %s' % add_string
search_string['Episode'].append(re.sub('\s+', '.', ep_string))
return [search_string]
示例4: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=""):
search_string = {"Episode": []}
if not ep_obj:
return []
if self.show.air_by_date:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = show_name + " " + str(ep_obj.airdate).replace("-", "|")
search_string["Episode"].append(ep_string)
elif self.show.sports:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = (
show_name + " " + str(ep_obj.airdate).replace("-", "|") + "|" + ep_obj.airdate.strftime("%b")
)
search_string["Episode"].append(ep_string)
elif self.show.anime:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = show_name + " " + "%i" % int(ep_obj.scene_absolute_number)
search_string["Episode"].append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = (
show_name
+ " "
+ sickbeard.config.naming_ep_type[2]
% {"seasonnumber": ep_obj.scene_season, "episodenumber": ep_obj.scene_episode}
)
if add_string:
ep_string = ep_string + " %s" % add_string
search_string["Episode"].append(ep_string)
return [search_string]
示例5: _get_season_search_strings
def _get_season_search_strings(self, show, season=None):
search_string = []
if not show:
return []
myDB = db.DBConnection()
if show.air_by_date:
(min_date, max_date) = self._get_airbydate_season_range(season)
sqlResults = myDB.select("SELECT * FROM tv_episodes WHERE showid = ? AND airdate >= ? AND airdate <= ?", [show.tvdbid, min_date.toordinal(), max_date.toordinal()])
else:
sqlResults = myDB.select("SELECT * FROM tv_episodes WHERE showid = ? AND season = ?", [show.tvdbid, season])
for sqlEp in sqlResults:
if show.getOverview(int(sqlEp["status"])) in (Overview.WANTED, Overview.QUAL):
if show.air_by_date:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = show_name_helpers.sanitizeSceneName(show_name) +' '+ str(datetime.date.fromordinal(sqlEp["airdate"])).replace('-', '.')
search_string.append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = show_name_helpers.sanitizeSceneName(show_name) +' '+ sickbeard.config.naming_ep_type[2] % {'seasonnumber': season, 'episodenumber': int(sqlEp["episode"])}
search_string.append(ep_string)
return search_string
示例6: _get_episode_search_strings
def _get_episode_search_strings(self, show, season, episode, abd=False, add_string=''):
search_string = {'Episode': []}
if not show:
return []
self.show = show
if abd:
for show_name in set(allPossibleShowNames(show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
str(episode).replace('-','|') + '|' + \
helpers.custom_strftime('%b', episode)
search_string['Episode'].append(ep_string)
else:
for show_name in set(allPossibleShowNames(show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
sickbeard.config.naming_ep_type[2] % {'seasonnumber': season,
'episodenumber': episode} + '|' + \
sickbeard.config.naming_ep_type[0] % {'seasonnumber': season,
'episodenumber': episode} + '|' + \
sickbeard.config.naming_ep_type[3] % {'seasonnumber': season,
'episodenumber': episode} + ' %s category:tv' % add_string
search_string['Episode'].append(re.sub('\s+', ' ', ep_string))
return [search_string]
示例7: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=''):
search_string = {'Episode': []}
if self.show.air_by_date:
for show_name in set(allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
str(ep_obj.airdate).replace('-','|')
search_string['Episode'].append(ep_string)
elif self.show.sports:
for show_name in set(allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
str(ep_obj.airdate).replace('-', '|') + '|' + \
ep_obj.airdate.strftime('%b')
search_string['Episode'].append(ep_string)
else:
for show_name in set(allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep_obj.scene_season,
'episodenumber': ep_obj.scene_episode} + '|' + \
sickbeard.config.naming_ep_type[0] % {'seasonnumber': ep_obj.scene_season,
'episodenumber': ep_obj.scene_episode} + '|' + \
sickbeard.config.naming_ep_type[3] % {'seasonnumber': ep_obj.scene_season,
'episodenumber': ep_obj.scene_episode} + ' %s category:tv' % add_string
search_string['Episode'].append(re.sub('\s+', ' ', ep_string))
return [search_string]
示例8: _get_episode_search_strings
def _get_episode_search_strings(self, show, season, episode, abd=False, add_string=""):
search_string = {"Episode": []}
if not episode:
return []
if abd:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = (
sanitizeSceneName(show_name)
+ " "
+ str(episode).replace("-", "|")
+ "|"
+ helpers.custom_strftime("%b", episode)
)
search_string["Episode"].append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(show)):
ep_string = (
show_name_helpers.sanitizeSceneName(show_name)
+ " "
+ sickbeard.config.naming_ep_type[2] % {"seasonnumber": season, "episodenumber": episode}
)
search_string["Episode"].append(re.sub("\s+", " ", ep_string))
return [search_string]
示例9: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=""):
search_string = {"Episode": []}
if not ep_obj:
return []
if ep_obj.show.air_by_date:
for show_name in set(show_name_helpers.allPossibleShowNames(ep_obj.show)):
ep_string = (
show_name_helpers.sanitizeSceneName(show_name)
+ " "
+ str(ep_obj.airdate)
+ "|"
+ helpers.custom_strftime("%Y %b {S}", ep_obj.airdate)
)
search_string["Episode"].append(ep_string)
else:
for show_name in set(show_name_helpers.allPossibleShowNames(ep_obj.show)):
ep_string = (
show_name_helpers.sanitizeSceneName(show_name)
+ " "
+ sickbeard.config.naming_ep_type[2]
% {"seasonnumber": ep_obj.season, "episodenumber": ep_obj.episode}
+ " %s" % add_string
)
search_string["Episode"].append(re.sub("\s+", " ", ep_string))
return [search_string]
示例10: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=""):
search_string = {"Episode": []}
if not ep_obj:
return []
self.show = ep_obj.show
if ep_obj.show.air_by_date:
for show_name in set(allPossibleShowNames(ep_obj.show)):
ep_string = sanitizeSceneName(show_name) + " " + str(ep_obj.airdate)
search_string["Episode"].append(ep_string)
else:
for show_name in set(allPossibleShowNames(ep_obj.show)):
ep_string = (
sanitizeSceneName(show_name)
+ " "
+ sickbeard.config.naming_ep_type[2]
% {"seasonnumber": ep_obj.season, "episodenumber": ep_obj.episode}
)
for x in add_string.split("|"):
to_search = re.sub("\s+", " ", ep_string + " %s" % x)
search_string["Episode"].append(to_search)
return [search_string]
示例11: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=''):
search_string = {'Episode': []}
if not ep_obj:
return []
self.show = ep_obj.show
if ep_obj.show.air_by_date:
for show_name in set(allPossibleShowNames(ep_obj.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
str(ep_obj.airdate) + '|' + \
helpers.custom_strftime('%Y %b {S}', ep_obj.airdate)
search_string['Episode'].append(ep_string)
else:
for show_name in set(allPossibleShowNames(ep_obj.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \
sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep_obj.season,
'episodenumber': ep_obj.episode} + '|' + \
sickbeard.config.naming_ep_type[0] % {'seasonnumber': ep_obj.season,
'episodenumber': ep_obj.episode} + '|' + \
sickbeard.config.naming_ep_type[3] % {'seasonnumber': ep_obj.season,
'episodenumber': ep_obj.episode} + ' %s category:tv' % add_string
search_string['Episode'].append(re.sub('\s+', ' ', ep_string))
return [search_string]
示例12: _doSearch
def _doSearch(self, search_params, epcount=0, age=0):
results = []
items = {'Season': [], 'Episode': [], 'RSS': []}
for mode in search_params.keys():
for search_string in search_params[mode]:
if mode != 'RSS':
searchURL = self.proxy._buildURL(self.searchurl % (urllib.quote(unidecode(search_string))))
else:
searchURL = self.proxy._buildURL(self.url + 'tv/latest/')
logger.log(u"Search string: " + searchURL, logger.DEBUG)
data = self.getURL(searchURL)
if not data:
continue
re_title_url = self.proxy._buildRE(self.re_title_url)
#Extracting torrent information from data returned by searchURL
match = re.compile(re_title_url, re.DOTALL).finditer(urllib.unquote(data))
for torrent in match:
title = torrent.group('title').replace('_',
'.') #Do not know why but SickBeard skip release with '_' in name
url = torrent.group('url')
id = int(torrent.group('id'))
seeders = int(torrent.group('seeders'))
leechers = int(torrent.group('leechers'))
#Filter unseeded torrent
if mode != 'RSS' and seeders == 0:
continue
#Accept Torrent only from Good People for every Episode Search
if self.confirmed and re.search('(VIP|Trusted|Helper)', torrent.group(0)) is None:
logger.log(u"ThePirateBay Provider found result " + torrent.group(
'title') + " but that doesn't seem like a trusted result so I'm ignoring it", logger.DEBUG)
continue
#Check number video files = episode in season and find the real Quality for full season torrent analyzing files in torrent
if mode == 'Season':
ep_number = int(epcount / len(set(allPossibleShowNames(self.show))))
title = self._find_season_quality(title, id, ep_number)
if not title or not url:
continue
item = title, url, id, seeders, leechers
items[mode].append(item)
#For each search mode sort all the items by seeders
items[mode].sort(key=lambda tup: tup[3], reverse=True)
results += items[mode]
return results
示例13: _get_season_search_strings
def _get_season_search_strings(self, show, season):
showNames = show_name_helpers.allPossibleShowNames(show)
result = []
for showName in showNames:
result.append( showName + " S%02d" % season )
return result
示例14: _get_episode_search_strings
def _get_episode_search_strings(self, ep_obj, add_string=''):
search_string = {'Episode': []}
if not ep_obj:
return []
for show_name in set(show_name_helpers.allPossibleShowNames(ep_obj.show)):
ep_string = show_name + ' '
if ep_obj.show.air_by_date:
ep_string += str(ep_obj.airdate).replace('-', '|')
elif ep_obj.show.sports:
ep_string += str(ep_obj.airdate).replace('-', '|') + '|' + \
ep_obj.airdate.strftime('%b')
elif ep_obj.show.anime:
ep_string += "%02d" % int(ep_obj.scene_absolute_number)
else:
ep_string += sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep_obj.scene_season,
'episodenumber': ep_obj.scene_episode}
if add_string:
ep_string = ep_string + ' %s' % add_string
search_string['Episode'].append(ep_string)
return [search_string]
示例15: _get_season_search_strings
def _get_season_search_strings(self, show, season=None):
search_string = {"Episode": []}
if not show:
return []
self.show = show
seasonEp = show.getAllEpisodes(season)
wantedEp = [x for x in seasonEp if show.getOverview(x.status) in (Overview.WANTED, Overview.QUAL)]
# If Every episode in Season is a wanted Episode then search for Season first
if wantedEp == seasonEp and not show.air_by_date:
search_string = {"Season": [], "Episode": []}
for show_name in set(allPossibleShowNames(show)):
ep_string = show_name + " S%02d" % int(season) # 1) ShowName SXX -SXXE
search_string["Season"].append(ep_string)
ep_string = show_name + " Season " + str(season) # 2) ShowName Season X
search_string["Season"].append(ep_string)
# Building the search string with the episodes we need
for ep_obj in wantedEp:
search_string["Episode"] += self._get_episode_search_strings(ep_obj)[0]["Episode"]
# If no Episode is needed then return an empty list
if not search_string["Episode"]:
return []
return [search_string]