问题
If I upload a video which has CategoryId 34 (Comedy/Komödie), the API tells me the CategoryId isn't available/supported. But I got the Categories from YouTube, saved the List in a DB with the following call:
https://developers.google.com/youtube/v3/docs/videoCategories/list?apix_params=%7B%22part%22%3A%22snippet%22%2C%22hl%22%3A%22de_DE%22%2C%22regionCode%22%3A%22DE%22%7D
and this category exists.
So with every "failed upload" my Quota raises. Unfortunately I can upload only 6 videos a day.
Any suggestions?
I checked the Categories, still up-to-date
回答1:
According to the URL of the request you provided in your question, you're using de_DE
as regionCode
.
If so, you need to use the id 23
instead - which corresponds to Komödie
.
See:
{
"kind": "youtube#videoCategory",
"etag": "\"0UM_wBUsFuT6ekiIlwaHvyqc80M/l3o_qqirQJQvOVhrSz9qa3x9Nxo\"",
"id": "23",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
"title": "Komödie",
"assignable": true
}
}
You can test the results in these demos:
- Results of videoCategories.list from Germany "de_DE" in YouTube Official Documentation - "try-it" feature.
- Results of videoCategories.list from Germany "de_DE" in Google API Explorer demo.
If you're still sure there's a problem with YouTube Data API, my advice is search whether your problem is already reported on Issue Tracker or report the problem there.
来源:https://stackoverflow.com/questions/57544070/youtube-data-api-v3-problem-with-categoryid-from-category-list