You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env python# coding:utf-8# params:# key: keywords# type: the type of result# maxresults: the maximum number of items that should be returned in the result set# num: number of you need# region: region code , default is USimportyoutube_apiyoutube=youtube_api.YoutubeAPI('Your api key from Google Api Console')
data=youtube.search('vevo', 'channel', 50, 100, 'US')
printdata
Get playlists by channel id
#!/usr/bin/env python# coding:utf-8# params:# channel idimportyoutube_apiyoutube=youtube_api.YoutubeAPI('Your api key from Google Api Console')
data=youtube.get_playlistid_by_channelid('UC-9-kyTW8ZkZNDHQJ6FgpwQ')
printdata
Get video id by playlist id
#!/usr/bin/env python# coding:utf-8# params:# playlist idimportyoutube_apiyoutube=youtube_api.YoutubeAPI('Your api key from Google Api Console')
data=youtube.get_videoid_by_playlistid('PL976DE11BCA1AF15E')
printdata
Get user's uploads playlist by user's channelid
#!/usr/bin/env python# coding:utf-8# params:# user's channel idimportyoutube_apiyoutube=youtube_api.YoutubeAPI('Your api key from Google Api Console')
data=youtube.get_useruploadsplaylist_by_userchannelid('UCANLZYMidaCbLQFWXBC95Jg')
printdata
Get channelid by videoid
#!/usr/bin/env python# coding:utf-8# params:# video idimportyoutube_apiyoutube=youtube_api.YoutubeAPIdata=youtube.get_channelid_by_videoid('8xg3vE8Ie_E')
printdata