<?php
if ( ! defined( 'MOD' )) die("access die");
$url = urldecode(trim($_POST['url']));
$path = parse_url($url);
$dom = qbase::get_domain($path['host']);
$type = '';
$class = '';
$data = array();
switch($dom){
	case 'youku.com':
		$class = $type = 'youku';
	break;

	case 'ku6.com':
		$class = $type = 'ku6';
	break;

	case '56.com':
		$class =  'com56';
		$type = '56';
	break;

	case 'tudou.com':
		$class = $type = 'tudou';
	break;

	case 'sina.com.cn':
		$class = $type = 'sina';
	break;

	case 'baidu.com':
		$class = $type = 'baidu';
	break;

	case 'qiyi.com':
		$class = $type = 'qiyi';
	break;

	case 'sohu.com':
		if($path['host'] == 'tv.sohu.com'){
			$type = 'sohuhd';
		}else{
			$type = 'sohu';
		}
		$class = 'sohu';
	break;
}
$classfile = R_P . "/include/movie/class." . $class . ".php";
if($class && is_file($classfile)){
	require_once($classfile);
	$obj = new $class($url, 0);
	$data = $obj->get();
	$data = array('data'=>$data, 'type'=>$type, 'status'=>200);
}else{
	$data = array('data'=>array(), 'type'=>'', 'status'=>404);
}
echo qbase::xmlPrint(qbase::jsonencode($data));
exit();
?>
