问题
How can I retrieve the number of videos uploaded by a specific Youtube user? I have been searching for the answer, but can't seem to find it.
Using the information you get from this
gdata.youtube.com/feeds/api/users/username/uploads
I can see a limit of 50 videos. But I would like to get a total count. Would anyone know how I can get this?
回答1:
You can get the video count from here:
https://gdata.youtube.com/feeds/api/users/USERNAME_HERE/uploads?v=2&alt=jsonc&max-results=0
And then you can easily use javascript or whatever to pick out what you want.
回答2:
Use this code:
<?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'};
?>
来源:https://stackoverflow.com/questions/9970501/how-can-i-retrieve-the-number-of-videos-uploaded-by-a-specific-youtube-user