验证中...
Languages: PHP
Categories: 嵌入式开发
Latest update 2019-02-12 17:40
1
Raw Copy
<?php
error_reporting(0);
$xml = "<?xml version=\"1.0\" encoding=\"gbk\" ?>\n<list>\n";
function g_contents($url) {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
@ $data = curl_exec($ch);
curl_close($ch);
return $data;
}
$fname = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER["SCRIPT_NAME"];
if(isset ($_GET['u'])){
$u=$_GET['u'];
$t = explode('-pg-', $u);
for ($i =1; $i <= $t[1]; $i++) {
$y = 'http://www.caijizy.com/?m=vod-type-id-' . $t[0] . '-pg-' . $i . '.html';
$xml .= '<m list_src="' . $fname . '?p=' . $y . '" label="第' . $i . '页" />'."\n";
}}
elseif(isset ($_GET['p'])){
$a=$_GET['p'];
$b = g_contents($a);
preg_match_all('|<td class="l"><a href="(.*)" target="_blank">(.*)<font color="red">(.*)<\/font>|', $b, $c1);
preg_match_all('|<td><font color="#2932E1">(.*)<\/font><\/td>
|', $b, $c2);
foreach ($c1[1] as $k => $v){
$xml.= '<m list_src="' . $fname . '?t=' .$v. '" label="'.$c1[2][$k].'" text="更新:' . $c2[1][$k] . '" />'."\n";
}}
elseif(isset ($_GET['t'])){
$aa = 'http://www.caijizy.com/'.$_GET['t'].'';
$b = file_get_contents($aa);
preg_match_all('#<!--片名开始-->(.*)<!--片名结束-->#',$b, $mz);
preg_match_all('#</span>(.*)</li><!--后jsm3u8-->
#',$b, $t);
preg_match_all('#<img src="(.*)"/>#',$b, $tt);
preg_match_all('#<div class="right">上映年份: <!--年代开始-->(.*)<!--年代结束-->#',$b, $zy);
foreach ($t[1] as $k => $v) {
$xml .='<m type="m3u8" src="' . $v . '" image="' . $tt[1][$k] . '" label="' . $mz[1][$k] . '" text="上映年份:' . $zy[1][$k] . '" />'."\n";
}}
else{
$hy = array (
'电影' => '1-pg-15',
'动作片' => '5-pg-2',
'喜剧片' => '6-pg-2',
'爱情片' => '7-pg-2',
'科幻片' => '8-pg-2',
'恐怖片' => '9-pg-2',
'剧情片' => '10-pg-2',
'战争片' => '11-pg-2',
'伦理片' => '16-pg-2',
'写真视频' => '21-pg-2',
'美女写真' => '22-pg-2',
'美女视频' => '23-pg-2',
);
foreach ($hy as $k => $v) {
$xml .= '<m list_src="' . $fname . '?u=' . $v . '" label="' . $k . '" />'."\n";
}}
$xml .= '</list>';
echo $xml;
?>

Comment list( 0 )

You need to Sign in for post a comment

Help Search

Gitee_sixth 5th_float_left_close