gpt4 book ai didi

api - 如何通过视频ID使用youtube api获取视频类别

转载 作者:行者123 更新时间:2023-12-03 06:06:59 30 4
gpt4 key购买 nike

如何通过视频ID使用youtube api获取视频类别?

https://www.googleapis.com/youtube/v3/videoCategoriespart=id&part=snippet&id=tjAsV8m24F4&key[YOUR_API_KEY]

我尝试了这个,但结果是:
{
"kind": "youtube#videoCategoryListResponse",
"etag": "qeAs28_qPv1tj8F0eBP7Qqr58Hw",
"items": []
}

没有什么用。

最佳答案

这个电话:

https://www.googleapis.com/youtube/v3/videoCategories

提供有关指定VideoVategories的信息,而不是此列表中的信息:

2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
23 - Comedy
24 - Entertainment
25 - News & Politics
26 - Howto & Style
27 - Education
28 - Science & Technology
29 - Nonprofits & Activism
30 - Movies
31 - Anime/Animation
32 - Action/Adventure
33 - Classics
34 - Comedy
35 - Documentary
36 - Drama
37 - Family
38 - Foreign
39 - Horror
40 - Sci-Fi/Fantasy
41 - Thriller
42 - Shorts
43 - Shows
44 - Trailers

您需要做 GET https://www.googleapis.com/youtube/v3/videos
获取类别ID,然后调用:
https://www.googleapis.com/youtube/v3/videoCategories

带有视频类别ID

关于api - 如何通过视频ID使用youtube api获取视频类别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62403121/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com