<?php
require_once("class.movie_info.php");
class youku_info extends movie_info{
	var $start_key = "</div><!-- head -->";
	var $end_key = "<!-- .showPoster -->";

	var $play_year_start = "<span class=\"label\">上映: </span>";
	var $play_year_end = "</div>";

	var $play_area_start = "<span class=\"label\">地区: </span>";
	var $play_area_end = "</div>";

	var $play_leader_start = "<span class=\"label\">导演: </span>";
	var $play_leader_end = "</div>";

	var $play_actor_start = "<span class=\"label\">演员: </span>";
	var $play_actor_end = "</div>";

	var $type_start = "<span class=\"label\">类型: </span>";
	var $type_end = "</div>";

	var $description_start = "<span id=\"infoLong\" style=\"display:none\">";
	var $description_end = "<span class=\"handle\">";

	var $thumb_start = "<img class=\"cover\" src=\"";
	var $thumb_end = "\" alt=\"";

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

	function get(){
		parent::init();
		$this->param['play_year'] = trim($this->curl->cut($this->param['play_year'], "target=\"_blank\">", "</a>"));
		$this->param['play_area'] = trim($this->curl->cut($this->param['play_area'], 'html">', '</a>'));
		$this->param['description'] = trim(substr($this->param['description'], 0, -7));
		$this->param['play_leader'] = $this->get_actor('play_leader');
		$this->param['play_actor'] = $this->get_actor('play_actor');
		return $this->param;
	}

	function get_actor($type){
		preg_match_all("/\_blank\"\>(.*?)\<\/a\>/", $this->param[$type], $match);
		return implode(",", $match[1]);
	}

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