请帮助我获取以下页面的内容:
http://www.youtube.com/my_videos_annotate?feature=vm&v=someVideoId
使用PHP / Curl。
我想我需要先登录YouTube的服务,但不知道该怎么做。
答案 0 :(得分:0)
使用youtube-api
示例强>
$feedURL = 'http://gdata.youtube.com/feeds/api/users/**ACCOUNTNAME**/uploads?max-results=50';
$sxml = simplexml_load_file($feedURL);
$i=0;
foreach ($sxml->entry as $entry) {
$media = $entry->children('media', true);
$watch = (string)$media->group->player->attributes()->url;
$thumbnail = (string)$media->group->thumbnail[0]->attributes()->url;
$input = array('http://www.youtube.com/watch?v=','&feature=youtube_gdata_player');
$change = array('','') ;
$link = @str_replace ($input ,$change, $watch);
echo $link.'</br>';
echo $thumbnail.'</br>'; //**thumbnail
echo $media->group->title.'</br>'; //**title
echo $media->group->description.'</br>'; //**description
}
希望这会有所帮助