1

以后如何通过 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

两个都失败了!

有没有其他方法可以得到它?非常感谢。

4

1 回答 1

0

经过一次又一次的测试和尝试,可以在我的开发环境中成功执行的代码与 Youtube 文档非常不同:https ://developers.google.com/youtube/2.0/developers_guide_protocol?hl=en#Retrieving_watch_later_playlist 。

仅供参考。
1. 使用 playlist_entry_id 而不是 VIDEO_ID:
- 如何获取稍后观看的每个视频的 playlist_entry_id?
. 一般播放列表: entry.id.text.split('/')[-1]
。稍后观看播放列表:entry.id.text.split('watch_later:')[-1]
2. API URL 需要添加'?v=2'

我的回答:
playlist_uri = https://gdata.youtube.com/feeds /api/users/default/watch_later/ playlist_entry_id?v=2
self.__ytService.Delete(playlist_uri)

于 2013-11-06T09:16:20.723 回答