• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python summary.SummaryMapper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get

    def get(self, id):
        response = self.http.get(
            str(id)
        )

        return SummaryMapper.show(
            self.get_data(response)
        )
开发者ID:HaKDMoDz,项目名称:Plex-Trakt-Scrobbler,代码行数:8,代码来源:__init__.py


示例2: season

    def season(self, id, season):
        response = self.http.get(str(id), [
            'seasons', str(season)
        ])

        return SummaryMapper.episodes(
            self.get_data(response)
        )
开发者ID:HaKDMoDz,项目名称:Plex-Trakt-Scrobbler,代码行数:8,代码来源:__init__.py


示例3: seasons

    def seasons(self, id):
        response = self.http.get(str(id), [
            'seasons'
        ])

        return SummaryMapper.seasons(
            self.get_data(response)
        )
开发者ID:HaKDMoDz,项目名称:Plex-Trakt-Scrobbler,代码行数:8,代码来源:__init__.py


示例4: trending

    def trending(self, **kwargs):
        response = self.http.get('trending', query=dict(**popitems(kwargs, ['extended', 'limit'])))

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
开发者ID:SiCKRAGETV,项目名称:SiCKRAGE,代码行数:9,代码来源:__init__.py


示例5: get

    def get(self, id, **kwargs):
        response = self.http.get(str(id), query=dict(**popitems(kwargs, ['extended', 'limit'])))

        item = self.get_data(response, **kwargs)

        if isinstance(item, requests.Response):
            return item

        return SummaryMapper.show(self.client, item)
开发者ID:SiCKRAGETV,项目名称:SiCKRAGE,代码行数:9,代码来源:__init__.py


示例6: trending

    def trending(self):
        response = self.http.get(
            'trending'
        )

        return SummaryMapper.movies(
            self.client,
            self.get_data(response)
        )
开发者ID:beljim,项目名称:tknorris-beta-repo,代码行数:9,代码来源:__init__.py


示例7: season

    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)
        )
开发者ID:engeld,项目名称:traktforalfred,代码行数:9,代码来源:__init__.py


示例8: get

    def get(self, id, **kwargs):
        response = self.http.get(
            str(id)
        )

        return SummaryMapper.show(
            self.client,
            self.get_data(response, **kwargs)
        )
开发者ID:engeld,项目名称:traktforalfred,代码行数:9,代码来源:__init__.py


示例9: trending

    def trending(self, **kwargs):
        response = self.http.get(
            'trending'
        )

        return SummaryMapper.shows(
            self.client,
            self.get_data(response, **kwargs)
        )
开发者ID:engeld,项目名称:traktforalfred,代码行数:9,代码来源:__init__.py


示例10: seasons

    def seasons(self, id, **kwargs):
        response = self.http.get(str(id), [
            'seasons'
        ])

        return SummaryMapper.seasons(
            self.client,
            self.get_data(response, **kwargs)
        )
开发者ID:engeld,项目名称:traktforalfred,代码行数:9,代码来源:__init__.py


示例11: episode

    def episode(self, id, season, episode):
        response = self.http.get(str(id), [
            'seasons', str(season),
            'episodes', str(episode)
        ])

        return SummaryMapper.episode(
            self.get_data(response)
        )
开发者ID:HaKDMoDz,项目名称:Plex-Trakt-Scrobbler,代码行数:9,代码来源:__init__.py


示例12: get

    def get(self, id, **kwargs):
        response = self.http.get(
            str(id)
        )

        # Parse response
        return SummaryMapper.movie(
            self.client,
            self.get_data(response, **kwargs)
        )
开发者ID:AMOboxTV,项目名称:AMOBox.LegoBuild,代码行数:10,代码来源:__init__.py


示例13: seasons

    def seasons(self, id, extended=None, **kwargs):
        response = self.http.get(str(id), [
            'seasons'
        ], query={
            'extended': extended
        })

        return SummaryMapper.seasons(
            self.client,
            self.get_data(response, **kwargs)
        )
开发者ID:MCs88,项目名称:Plex-Trakt-Scrobbler,代码行数:11,代码来源:__init__.py


示例14: trending

    def trending(self, extended=None, **kwargs):
        response = self.http.get('trending', query={
            'extended': extended
        })

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
开发者ID:fuzeman,项目名称:Plex-Trakt-Scrobbler,代码行数:11,代码来源:__init__.py


示例15: get

    def get(self, id, extended=None, **kwargs):
        response = self.http.get(str(id), query={
            'extended': extended
        })

        item = self.get_data(response, **kwargs)

        if isinstance(item, requests.Response):
            return item

        return SummaryMapper.show(self.client, item)
开发者ID:fuzeman,项目名称:Plex-Trakt-Scrobbler,代码行数:11,代码来源:__init__.py


示例16: season

    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)
开发者ID:fuzeman,项目名称:Plex-Trakt-Scrobbler,代码行数:13,代码来源:__init__.py


示例17: get


#.........这里部分代码省略.........
        :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)

        if isinstance(items, requests.Response):
            return items

        # Map items
        if media == 'shows':
            return SummaryMapper.episodes(
                self.client, items,
                parse_show=True
            )

        return SummaryMapper.movies(self.client, items)
开发者ID:fuzeman,项目名称:trakt.py,代码行数:101,代码来源:calendars.py


示例18: get

    def get(self, id, **kwargs):
        response = self.http.get(
            str(id)
        )

        # Parse response
        return SummaryMapper.person(
            self.client,
            self.get_data(response, **kwargs)
        )

    def movies(self, id, **kwargs)
        response = self.http.get(
            str(id) + '/movies'
        )

        return SummaryMapper.people(
            self.client,
            self.get_data(response, **kwargs)
        )

    def shows(self, id, **kwargs)
        response = self.http.get(
            str(id) + '/shows'
        )
        
        return SummaryMapper.people(
            self.client,
            self.get_data(response, **kwargs)
        )
开发者ID:TWaalen,项目名称:trakt.py,代码行数:30,代码来源:__init__.py


示例19: episode

    def episode(self, id, season, episode, **kwargs):
        response = self.http.get(str(id), ["seasons", str(season), "episodes", str(episode)])

        return SummaryMapper.episode(self.client, self.get_data(response, **kwargs))
开发者ID:shad7,项目名称:trakt.py,代码行数:4,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.extract_ids函数代码示例发布时间:2022-05-27
下一篇:
Python msg.JointTrajectoryPoint类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap