问题描述
尽管youtube-api v3允许您请求来自特定区域的视频(例如,通过指定位置和半径),但似乎有关视频的结果信息不包含地点信息.也就是说,您无法获得视频本身的经纬度报告.
Although the youtube-api, v3, allows you to make a request for videos that come from a particular area (for example, by specifying the location and the radius), it appears that the resulting information about the videos does not contain location information. That is, you can't get the reported lat/long of the video itself.
A query for a specific location would look like this:https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&key=[key]&location=37,5%2C-120.5&locationRadius=2km&maxResults=5
这是返回信息的描述. https://developers.google.com/youtube/v3/docs/search#top_of_page
Here's the description of the information returned.https://developers.google.com/youtube/v3/docs/search#top_of_page
那是正确的吗?是否不再有办法找出查询中返回的视频的经纬度信息?
So, is that correct? Is there no longer any way to find out the lat/long information of a video that is returned in a query?
推荐答案
好的,我知道了.位置查询将仅返回有关视频信息的各种摘要,这是正确的.但是,您可以随后更深入地查看各个视频以找到它们的位置.例如:
OK, I figured this out. The location query will only return the various snippets of information about the videos, that is true. However, you can then look at individual videos in more depth to find their locations. For example:
https://www .googleapis.com/youtube/v3/videos?part = recordingDetails& key = [key]& id = HiFnDoUiaqg
将返回记录信息,包括: "recordingDetails":{ 地点": { 纬度":37.50973, 经度":-120.49805, 海拔":0.0 }
will return recording information including: "recordingDetails": { "location": { "latitude": 37.50973, "longitude": -120.49805, "altitude": 0.0 },
所以这是一个两步过程.您可以找到位置查询返回的视频列表,然后查看这些视频的详细信息.
So it's a 2-step process. You find the list of videos returned by the location query, and then you look at the detailed information for those videos.
这篇关于youtube-api,v3,地理位置信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!