使用API​​获取YouTube收藏夹/频道喜欢的频道

时间:2018-07-20 20:29:01

标签: python-3.x youtube-api

通过使用Youtube API,在Python 3.5.2中,我想获取给定频道ID的喜欢/收藏。 这是我使用的代码:

channel_details = youtube.channels().list(id=channel_id, part='snippet, contentDetails').execute()
    for c_detail in channel_details['items']:
        c_upload_list_id = c_detail['contentDetails']['relatedPlaylists']['Favorites']

根据文档:https://developers.google.com/youtube/v3/docs/channels “收藏夹” /“喜欢”属性存在于“ contentDetails”对象中。但是,出现以下错误:

  

KeyError:“收藏夹”

尝试获取自己的YouTube频道的点赞/收藏(即使将它们设为公开)时,也会遇到相同的错误。

有人可以帮助我吗?

谢谢

0 个答案:

没有答案