这是youtube数据api v3的一个简单客户端

pyytdata的Python项目详细描述


这是一个youtube数据api v3包装器,可以集成到任何python应用程序中,基本上是在推荐youtube视频的web应用程序中。在

https://img.shields.io/pypi/v/pyytdatahttps://travis-ci.org/Agent-Hellboy/YouTubeDataApi_Wrapper.svg?branch=masterhttps://img.shields.io/pypi/pyversions/pyytdata.svghttps://img.shields.io/pypi/l/pyytdata.svghttps://pepy.tech/badge/pyytdatahttps://img.shields.io/pypi/format/pyytdata.svghttps://coveralls.io/repos/github/Agent-Hellboy/YouTubeDataApi_Wrapper/badge.svg?branch=master

先决条件

安装

for stable version
  • pip install pyytdata
for developement

使用

>>>frompyytdataimportPyYtData>>>obj=PyYtData('flask',1)>>>vid=obj.get_videoinfo()>>>vid[<util.vidinfo.VidInfoobjectat0x7ff971539e10>]#You can fire dir on this object to get the attribute and method of the object.>>>dir(vid[0])['_Info__API_KEY','__class__','__delattr__','__dict__','__dir__','__doc__','__eq__','__format__','__ge__','__getattribute__','__gt__','__hash__','__init__','__init_subclass__','__le__','__lt__','__module__','__ne__','__new__','__reduce__','__reduce_ex__','__repr__','__setattr__','__sizeof__','__str__','__subclasshook__','__weakref__','_id','channel_info','get_description','get_image_url','get_link','get_publishedtime','get_title','keyword','maxlen','open_id','order','result','type','youtube']# To get the description of the video>>>vid[0].get_description()'Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. Learn how to use it ...'# To get the title of the video.>>>vid[0].get_title()'Learn Flask for Python - Full Tutorial'# To get the link for the video which can we used in web app to open the link for the video.>>>vid[0].get_link()'https://www.youtube.com/watch?v=Z1RJmh_OqeA'# To get the title img of the video which can be rendered through HTML tag.>>>vid[0].get_image_url()'https://i.ytimg.com/vi/Z1RJmh_OqeA/mqdefault.jpg'# To get the date at which the video is published>>>vid[0].get_publisheddate()# To get the chnlInfo object having methods which describes a channel.>>>chnl=vid[0].channel_info()>>>dir(chnl)['__class__','__delattr__','__dict__','__dir__','__doc__','__eq__','__format__','__ge__','__getattribute__','__gt__','__hash__','__init__','__init_subclass__','__le__','__lt__','__module__','__ne__','__new__','__reduce__','__reduce_ex__','__repr__','__setattr__','__sizeof__','__str__','__subclasshook__','__weakref__','id','result','total_subscriber','total_video','total_viewcnt','youtube']# To get the total view count of the channel.>>>chnl.total_viewcnt()'95246354'# To get the number of subscribers of the channel.>>>chnl.total_subscriber()'2170000'# To get number of video uploaded by this particular channel.>>>chnl.total_video()'1133'# To get the obejct having stat of the video>>>vidinf=vid[0].video_stat()# To get total number of like to the video>>>vidinf.total_like()'7203'# To get total number of dislike to the video>>>vidinf.total_dislike()'166'# To get total number of views>>>vidinf.total_view()'436803'# To get total number of comment on the video>>>vidinf.total_comment()'621'

一般信息

开发中

/images/info.png
  • 我认为这个包实现了facade模式,因为像videoinfo和chnlinfo这样的底层包是独立于pyytdata的,不向客户端公开,而且通过提供接口/模块pyytdata,queryer和videoinfo之间的交互对客户端是隐藏的
  • vidoinfo类和Chnlinfo有合成关系,因为视频没有通道就不存在

包体系结构

Architecture

贡献

欢迎拉取请求。对于重大更改,请先打开问题 讨论你想改变什么。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何从IBM MQ的JMSException检测可恢复错误   java Lucene6。4.2:找不到类,尝试添加查询。   Java Pdf差异库   在Java中多线程处理我的线程   java将字符串传递给Uri。下载中的parse()   java在列表中查找原语位置   java JPA条件从另一个查询中选择   java中的强制转换和转换   java如何在没有上下文的情况下获取SOAP Web服务(Apache Axis 1.4)的调用客户端的IP地址   java Android IllegalBlockSizeException:解密中最后一个块未完成   java Jersey是否要自定义无效资源路径的错误处理?   如何将JavaCVS web项目转换为基于maven的web项目?   java如何检查通用列表是否与jUnit相等?   arraylist java。util。尝试使用迭代器时发生ConcurrentModificationException错误   使用springsecurity,jsp上的java${u csrf.token}始终为空   sql使用java从临时表中选择数据   spring验证中的java@Notnull和@Pattern无效   java如何使用jQuery将包含对象数组的对象数组传递给Spring MVC控制器?