=>使用API中获取视频信息的方法 http://api.tudou.com/v6/video/info?app_key=23365aeb6a339f06&format=xml&itemCodes=sample ===== 2.通过API获取视频信息(XML格式) 3.分析XML,并获得无广告地址 4.输出 */ if ($_POST['tudou']) { //1.获取视频的ID $tudou = $_POST['tudou']; $id = basename($tudou, '.html'); $app_key = '23365aeb6a339f06'; $api = 'http://api.tudou.com/v6/video/info?app_key=' . $app_key . '&format=xml&itemCodes=' . $id; $xml = file_get_contents($api); $dom = new DOMdocument('1.0', 'utf-8'); $dom->loadxml($xml); $nl = $dom->getElementsByTagName('outerGPlayerUrl'); $tudou2 = $nl->item(0)->textContent; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"> <head> <title>xml demo-利用XML获取无广告土豆视屏</title> <p></p> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> </head> <body> <h1>感觉不会再看土豆广告了</h1> <p>测试地址:</p>