download_parser.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:yajuu 作者: vivescere 项目源码 文件源码
def validate_single_media(context, param, values):
    '''Parse the passed medias when they are "single", such as movies.'''

    medias = []

    for value in values:
        query = value.strip()

        try:
            media = context.obj['MEDIA_CLASS'](query)
        except Media.MediaNotFoundException:
            raise click.BadParameter('the media {} was not found'.format(
                query
            ))
        except pytvdbapi.error.ConnectionError:
            logger.error('You\'re not connected to any network.')
            os._exit(1)

        medias.append(('single', media))

    return medias
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号