>>pip install c:\path\to\wheel\file\YoutubeV3API-0.1.1-py3-none-any.whl
from youtube_v3api import youtube
#Retrieves a channel information based on the channelid, returns -> model.Channel object
mychannel = Channel()
mychannel = youtube.get_channel(channelid , APIKey)
'''Retrieves videos information (exclusive video stats for each Video, is faster than with stats)
based on a channelid returns -> collection of model.Video elements
by default the youtube query response is ordered by viewCount.
OrderBy valid values : viewCount, title, rating, date '''
videoElements = []
videoElements = youtube.get_videos_without_stats(channelid , APIKey , maxResult = 5 , orderBy = 'viewCount')
'''Retrieves videos information (inclusive video stats for each Video, this generates extra queries)
based on a channelid returns -> collection of model.Video elements
by default the youtube query response is ordered by viewCount.
OrderBy valid values : viewCount, title, rating, date '''
videoElements = []
videoElements = youtube.get_videos_with_stats(channelid , APIKey , maxResult = 5 , orderBy = 'viewCount')
'''retrieves channel info based on keywords
(keywords format=string, inclusive ex: 'key1|key2|key_n' exclusive ex: ' -key1 -key2'
by default the youtube query response is ordered by viewCount.
OrderBy valid values : viewCount, title, rating, date, videoCount
Maxresult is maximum 50
returns -> collection of model.Channel objects'''
channelElements = []
channelElements = youtube.search_channels_on_keywords(keywords , APIKey, maxResults = 10 , orderBy = 'viewCount')
'''retrieves channel info based on keywords
(keywords format=string, ex: 'key1|key2|key_n' exclusive ex: ' -key1 -key2'
by default the youtube query response is ordered by viewCount.
OrderBy valid values : viewCount, title, rating, date
Maxresult is maximum 50
returns -> collection of model.Channel objects'''
videoElements = []
videoElements = youtube.search_videos_on_keywords(keywords , APIKey , maxResults = 10 , orderBy = 'viewCount')
</tr>
Video | |
---|---|
channelid | The youtube ID of the channel |
id | The youtube ID of the video |
pubdate | Video publishing date |
title | Title of the video |
desc | Description of the video |
thumb_default | The video default thumbnail image link |
thumb_medium | Medium size thumbnail link |
thumb_high | High size thumbnail link |
channeltitle | The channel title |
stats | A dictionary containing the video statistics Keys { 'views':0 , 'likes':0 , 'dislikes':0 , 'comments':0 } |
Channel | |
---|---|
id | The youtube channel id |
title | Channel name |
desc | Channel description |
pubdate | Creation date |
thumb_default | The channel logo |
thumb_medium | Channel medium size banner |
thumb_high | Channel high size banner |
stats | Channel statistics dictionary {'views':0,'comments':0,'subs':0,'videos':0} |
videos | List of model.Video objects |