【发布时间】:2013-10-29 21:45:24
【问题描述】:
以后如何通过 python gdata 库从 youtube watch 中删除视频? 我检查 API:https://developers.google.com/youtube/2.0/developers_guide_protocol?hl=en#Retrieving_watch_later_playlist, 并尝试它的方法: 从播放列表中删除视频: https://gdata.youtube.com/feeds/api/users/default/watch_later/VIDEO_ID.
通过python gdata库
playlist_uri = u"https://gdata.youtube.com/feeds/api/users/default/watch_later"
playlist_entry_id = videoID .............(Does watch later have playlist_entry_id??)
response = yt_service.DeletePlaylistVideoEntry(playlist_uri,
playlist_entry_id)
=>Error: Bad request
或
playlist_uri = u"https://gdata.youtube.com/feeds/api/users/default/watch_later/%s" % videoID
response = yt_service.Delete("playlist_uri)
=>Error: Bad request
都失败了!
还有其他方法可以获取吗?非常感谢。
【问题讨论】:
-
DeletePlaylistVideoEntry(playlist_uri, playlist_entry_id是要走的路,你的错误信息是什么或会发生什么?为什么这不起作用?请给我们线索和代码。另请注意,https://gdata.youtube.com/feeds/api/users/default/watch_later/似乎是一个无效的 URI。 -
亲爱的 Torxed,我按照“稍后观看”进行编码,但我不知道如何使用 API 定义的 uri“gdata.youtube.com/feeds/api/users/default/watch_later/…>”。此外,如果使用 DeletePlaylistVideoEntry(playlist_uri, playlist_entry_id) 工作,playlist_uri, playlist_entry_id 在稍后观看是什么?非常感谢。
-
首先你需要比这两行更多的代码,你需要初始化
YouTubeService,然后你需要找到播放列表和它的实际名称(不确定watch_later是否正确,可能是只是实际播放列表的别名.. 但无论如何)查看这个参考库,看看它是否有帮助(你可以形成自己的请求):developers.google.com/youtube/2.0/…