我正在尝试在最高视图顺序
中获取特定频道(例如:-Luis Fonsi)的视频。我正在传递订单参数
通过 viewcount
对响应进行排序
: -
order = ViewCount
URL: -
https://www.googleapis.com/youtube/youtube/v3/search?key= [my-api-key]& canneliD = ucxoq-paqeadk_zyg8ys0jqa&part ; order = viewCount& maxResults = 20000
当我尝试运行它时,它并没有按照我的预期进行排序。我期望第一首歌是 despacito
,但它肯定没有最高的观点。
如 youtube-api文档
in 搜索节。
ViewCount - 资源从最高到最低的视图数量排序。
它无法正常工作。
我尝试过很多次,但仍然无法正常工作。
任何帮助都将不胜感激。
I am trying to get videos of a particular channel (like :- Luis Fonsi) in highest views order
. And I am passing order parameter
to sort the response by viewCount
like :-
order=viewCount
URL :-
https://www.googleapis.com/youtube/v3/search?key=[MY-API-KEY]&channelId=UCxoq-PAQeAdk_zyg8YS0JqA&part=snippet,id&order=viewCount&maxResults=20000
When I try to run it then It is not sorting as I expected. I was expecting first song would be Despacito
But It got another one which definitely don't have the highest views.
As mentioned in Youtube-API Documentation
in search section.
viewCount – Resources are sorted from highest to lowest number of views.
It is not working like this.
I have tried many times but it is still not working.
Any help would be much Appreciated.
发布评论
评论(1)
YouTube数据API V3在某些方面被打破,如果我是您,我只会从给定的YouTube频道中检索所有视频,然后对它们进行排序。
这样做:
part = contentDetails
。列表
使用
playlistid = uploads_playlist_id
(替换uploads_playlist_id
带有您刚获得的)。视频的视图通过
part = statistics
with 。YouTube Data API v3 is broken on some aspects, if I were you, I would just retrieve all videos from the given YouTube channel and then sort them.
To do so:
uploads
playlist id by using Channels: list withpart=contentDetails
.list
with
playlistId=UPLOADS_PLAYLIST_ID
(replacingUPLOADS_PLAYLIST_ID
with the one you just obtained).video's view count by using
part=statistics
with Videos:list.