您好我正在尝试使用videoid获取youtube视频详细信息,但我无法在此获取说明如何获取它。这是我的链接
https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=iwGFalTRHDA&format=json
这是json:
{
"title": "Trololo",
"width": 459,
"height": 344,
"thumbnail_height": 360,
"html": "\u003ciframe width=\"459\" height=\"344\" src=\"https:\/\/www.youtube.com\/embed\/iwGFalTRHDA?feature=oembed\" frameborder=\"0\" allowfullscreen\u003e\u003c\/iframe\u003e",
"thumbnail_width": 480,
"author_url": "https:\/\/www.youtube.com\/user\/KamoKatt",
"provider_name": "YouTube",
"version": "1.0",
"type": "video",
"provider_url": "https:\/\/www.youtube.com\/",
"author_name": "KamoKatt",
"thumbnail_url": "https:\/\/i.ytimg.com\/vi\/iwGFalTRHDA\/hqdefault.jpg"
}
答案 0 :(得分:0)
在Youtube的API中使用此终端的视频ID。
https://www.googleapis.com/youtube/v3/videos?part=snippet&id={VIDEO_ID}&fields=items/snippet/title,items/snippet/description&key={YOUR_API_KEY}
- jlmcdonald
带有网址的视频:
https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=iwGFalTRHDA&format=json
视频ID为iwGFalTRHDA
,现在您只需使用API_KEY
即可。如果您没有,则可以按照说明操作,然后启用youtube API并使用提供给您的密钥,从而获得一个here。
使用此视频和我的api密钥(我没有把它放在tho下面)
https://www.googleapis.com/youtube/v3/videos?part=snippet&id=iwGFalTRHDA&fields=items/snippet/title,items/snippet/description&key={YOUR_API_KEY}
结果如下:
{
"items": [
{
"snippet": {
"title": "Trololo",
"description": ""
}
}
]
}
这是一段视频ID为e-5obm1G_FY
的视频:
{
"items": [
{
"snippet": {
"title": "Anjana Vakil: Learning Functional Programming with JavaScript - JSUnconf 2016",
"description": "Slides: https://slidr.io/vakila/learning-functional-programming-with-javascript"
}
}
]
}