<?php
class baidu
{
	private $curl = null;
	private $mid = 0;
	private $url = '';
	private $html = '';
	private $total = 0;
	private $specialid = 0;

	function baidu($url, $mid)
	{
		$this->curl = qbase::get_object('curl');
		$this->url = $url;
		$this->mid = $mid;
	}

	function get(){
		$this->html = $this->curl->load($this->url);
		$player = trim($this->curl->cut($this->html, "BVP.play(\"", "\","));
		$temp = trim($this->curl->cut($this->html, "<title>", "</title>"));
		if(!$player || !$temp) return array();
		$name = explode('_', $temp);
		$name = $name[0];
		$name = str_replace("¡¶", "", $name);
		$name = str_replace("¡·", "", $name);
		$name = $this->curl->relace_script($name);
		$data[] = array($this->charsetLocal($name), $this->linkToUrl($player));
		return $data;
	}

	function charsetLocal($s){
		global $_SET;
		return qbase::iconvs($s, $_SET['def_charset'], 'utf-8');
	}

	function linkToUrl($code){
		return $code;
	}
}
?>