如何通过gdata Python库获取YouTube上所有视频的列表
我在看这个文档。
https://developers.google.com/youtube/1.0/developers_guide_python#SearchingVideos
这个文档解释了在YouTube上可以进行的各种操作。
但是我不太明白,怎么才能获取一个YouTube频道里的所有视频。
我需要获取所有视频的标题、网址和缩略图。
如果有人能帮忙就太好了。
谢谢!
2 个回答
2
在StackOverflow上还有很多其他问题可能对你有帮助。以下是一些相关问题的列表:
如何使用YouTube v3 API获取YouTube播放列表中的所有视频
如何通过YouTube API获取YouTube视频的缩略图?
希望这些信息对你有帮助。
2
我从文档里找到了答案,万一有人需要的话。
yt_service = gdata.youtube.service.YouTubeService()
yt_service.ssl = True
yt_service.developer_key = 'xxx'
yt_service.client_id = 'xxx'
yt_service.email = 'xxx@dd.com'
yt_service.password = 'xxx'
yt_service.source = 'youtube'
yt_service.ProgrammaticLogin()
videos = yt_service.GetYouTubeVideoFeed("https://gdata.youtube.com/feeds/api/users/default/uploads")
然后
for video in videos.entry
print video