我在https://developers.google.com/youtube/v3/docs/playlistItems/insert上寻找了一些代码片段 了解如何使用命令行curl进行此操作。但是我没有发现任何有用的东西。
我尝试了这种方法:
curl -H "Content-Type:application/json" -H "Authorization: Bearer <my access token>" -X POST "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&snippet.playlistId=PL76DFLbfkwzJAp2YAeJcdxle-screWohd&snippet.resourceId.kind=youtube#video&snippet.resourceId.videoId=aAQZPBwz2CI"
但是我总是收到这个:
{
"error": {
"errors": [
{
"domain": "youtube.playlistItem",
"reason": "resourceIdRequired",
"message": "Required"
}
],
"code": 400,
"message": "Required"
}
}
我也尝试过:
curl -H "Content-Type: application/json" -H "Authorization: Bearer <my access token>" -G -d '{"snippet"={"playlistId"="PL76DFLbfkwzJAp2YAeJcdxle-screWohd","resourceId"={"kind"="youtube##video","videoId"="aAQZPBwz2CI"}}}' -X POST "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet"
但仍然没有结果...
有人知道这个问题的解决方案吗?