如何获得youtube频道ID和名称,给定一个视频ID


How to get the youtube channel ID and name, given a video ID

我有一个YT视频id,例如:7-7knsP2n5w

(https://www.youtube.com/watch?v=7-7knsP2n5w)

我需要得到它的通道名称(在这种情况下: shakiraVEVO )和通道id ( UCGnjeahCJW1AF34HBmQTJ-Q )

有可能吗?

在PHP中解决:

$videoid = "7-7knsP2n5w";
$xml_video = simplexml_load_file("http://gdata.youtube.com/feeds/api/videos/".$videoid);
$xml_channel = simplexml_load_file($xml_video->author->uri);
//author:
echo $xml_video->author->name;
//channel:
echo $xml_channel->link[0]["href"];