本文整理汇总了Python中trakt.mapper.summary.SummaryMapper.episodes方法的典型用法代码示例。如果您正苦于以下问题:Python SummaryMapper.episodes方法的具体用法?Python SummaryMapper.episodes怎么用?Python SummaryMapper.episodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trakt.mapper.summary.SummaryMapper
的用法示例。
在下文中一共展示了SummaryMapper.episodes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: season
# 需要导入模块: from trakt.mapper.summary import SummaryMapper [as 别名]
# 或者: from trakt.mapper.summary.SummaryMapper import episodes [as 别名]
def season(self, id, season):
response = self.http.get(str(id), [
'seasons', str(season)
])
return SummaryMapper.episodes(
self.get_data(response)
)
示例2: season
# 需要导入模块: from trakt.mapper.summary import SummaryMapper [as 别名]
# 或者: from trakt.mapper.summary.SummaryMapper import episodes [as 别名]
def season(self, id, season, **kwargs):
response = self.http.get(str(id), [
'seasons', str(season)
])
return SummaryMapper.episodes(
self.client,
self.get_data(response, **kwargs)
)
示例3: season
# 需要导入模块: from trakt.mapper.summary import SummaryMapper [as 别名]
# 或者: from trakt.mapper.summary.SummaryMapper import episodes [as 别名]
def season(self, id, season, extended=None, **kwargs):
response = self.http.get(str(id), [
'seasons', str(season)
], query={
'extended': extended
})
items = self.get_data(response, **kwargs)
if isinstance(items, requests.Response):
return items
return SummaryMapper.episodes(self.client, items)
示例4: get
# 需要导入模块: from trakt.mapper.summary import SummaryMapper [as 别名]
# 或者: from trakt.mapper.summary.SummaryMapper import episodes [as 别名]
def get(self, source, media, collection=None, start_date=None, days=None, query=None, years=None, genres=None,
languages=None, countries=None, runtimes=None, ratings=None, certifications=None, networks=None,
status=None, **kwargs):
"""Retrieve calendar items.
The `all` calendar displays info for all shows airing during the specified period. The `my` calendar displays
episodes for all shows that have been watched, collected, or watchlisted.
:param source: Calendar source (`all` or `my`)
:type source: str
:param media: Media type (`dvd`, `movies` or `shows`)
:type media: str
:param collection: Collection type (`new`, `premieres`)
:type collection: str or None
:param start_date: Start date (defaults to today)
:type start_date: datetime or None
:param days: Number of days to display (defaults to `7`)
:type days: int or None
:param query: Search title or description.
:type query: str or None
:param years: Year or range of years (e.g. `2014`, or `2014-2016`)
:type years: int or str or tuple or None
:param genres: Genre slugs (e.g. `action`)
:type genres: str or list of str or None
:param languages: Language codes (e.g. `en`)
:type languages: str or list of str or None
:param countries: Country codes (e.g. `us`)
:type countries: str or list of str or None
:param runtimes: Runtime range in minutes (e.g. `30-90`)
:type runtimes: str or tuple or None
:param ratings: Rating range between `0` and `100` (e.g. `75-100`)
:type ratings: str or tuple or None
:param certifications: US Content Certification (e.g. `pg-13`, `tv-pg`)
:type certifications: str or list of str or None
:param networks: (TV) Network name (e.g. `HBO`)
:type networks: str or list of str or None
:param status: (TV) Show status (e.g. `returning series`, `in production`, ended`)
:type status: str or list of str or None
:return: Items
:rtype: list of trakt.objects.video.Video
"""
if source not in ['all', 'my']:
raise ValueError('Unknown collection type: %s' % (source,))
if media not in ['dvd', 'movies', 'shows']:
raise ValueError('Unknown media type: %s' % (media,))
# Default `start_date` to today when only `days` is provided
if start_date is None and days:
start_date = datetime.utcnow()
# Request calendar collection
response = self.http.get(
'/calendars/%s/%s%s' % (
source, media,
('/' + collection) if collection else ''
),
params=[
start_date.strftime('%Y-%m-%d') if start_date else None,
days
],
query={
'query': query,
'years': years,
'genres': genres,
'languages': languages,
'countries': countries,
'runtimes': runtimes,
'ratings': ratings,
'certifications': certifications,
# TV
'networks': networks,
'status': status
},
**popitems(kwargs, [
'authenticated',
'validate_token'
])
)
# Parse response
items = self.get_data(response, **kwargs)
#.........这里部分代码省略.........