如何检索特定Youtube用户上传的视频数量?我一直在寻找答案,但似乎无法找到答案。
使用您从此处获得的信息
gdata.youtube.com/feeds/api/users/username/uploads
我可以看到限制50个视频。但我想得到一个总数。有谁知道我怎么能得到这个?
答案 0 :(得分:2)
您可以从此处获取视频计数:
https://gdata.youtube.com/feeds/api/users/USERNAME_HERE/uploads?v=2&alt=jsonc&max-results=0
然后你可以轻松地使用javascript或其他任何东西来挑选你想要的东西。
答案 1 :(得分:1)
使用此代码:
<?php
$JSON = file_get_contents("https://gdata.youtube.com/feeds/api/users/YOUTUBE USERNAME/uploads?v=2&alt=jsonc&max-results=0");
$JSON_Data = json_decode($JSON);
$totalvideos = $JSON_Data->{'data'}->{'totalItems'};
?>