验证中...
Languages: PHP
Categories: 嵌入式开发
Latest update 2019-02-12 16:33
优酷采集工具
Raw Copy
<?php
error_reporting(0);
function CURL($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
if($_POST['submit']){
$url = $_POST['url'];
if(strpos($url, 'youku.com')){
$fiurl = CURL($url."?spm=");
preg_match('/<div class="p-thumb"><a title="(.*)" href/imsU', $fiurl, $name);
preg_match('/showid:"([0-9]+)"/imsU', $fiurl, $sid);
preg_match('/videoId:"([0-9]+)"/imsU', $fiurl, $vdid);
preg_match('/catId:"([0-9]+)"/imsU', $fiurl, $cid);
preg_match('/episodeLast:"([0-9]+)"/imsU', $fiurl, $eid);
$ueurl = "http://api.m.youku.com/api/showlist/getshowlist?vid=".$vdid[1]."&showid=".$sid[1]."&cateid=".$cid[1]."&pagesize=".$eid[1];
$urrls = CURL($ueurl);
$json = json_decode($urrls,true);
$items = $json['data']['items'];
foreach($items as $ks){
$list .= '<m type="merge" src="{youku}http://v.youku.com/v_show/id_' .$ks['videoid']. '.html" label="' .$ks['title']. ' ' .$ks['rc_title'].'" />' . PHP_EOL;
$macl .= $ks['title']. '$http://v.youku.com/v_show/id_' .$ks['videoid']. '.html' . PHP_EOL;
}
if($_POST['type']=='cmplist'){
$xml .= "<list>\n";
$xml .= $list;
$xml .= "</list>";
}elseif($_POST['type']=='maccms'){
$xml .= $macl;
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
*{ margin:0; padding:0; list-style-type:none; text-decoration:none;}
body{margin:0; overflow:auto;}
.box{max-width: 960px;min-width: 580px;width: 100%;margin: 0 auto;padding-left:35px;}
.from_box{height: 50px;line-height: 50px;text-align: center;}
.sel{height: 30px;}
.text{height: 24px;width: 370px;}
.submit{height: 30px;padding: 0 10px;}
.textar{text-align: center; margin-top:10px}
.area{max-width: 960px;min-width: 580px;height: 353px;line-height: 20px;}
.copy{padding:5px 15px;}
</style>
</head>
<body>
<div class="box">
<div class="from_box">
<form method="post" action="">
<select name="type" class="sel">
<option value="cmplist">CMP列表</option>
<option value="maccms">MACCMS播放地址</option>
</select>
<input id="url" class="text" type="text" name="url" value="<?=$url?>" placeholder='输入URL地址' />
<input class="submit" type="submit" name="submit" value="提交" />
</form>
</div>
<div class="textar">
<textarea class="area" id="txtstr">
<?=$xml?>
</textarea><br /><br />
<input class="copy" type="button" onClick="copyUrl2()" value="复制">
<input class="copy" type="button" onClick="closs()" value="清空">
</div>
</div>
<script type="text/javascript">
function copyUrl2(){
var Url2=document.getElementById("txtstr");
Url2.select();
document.execCommand("Copy");
alert("已复制好,可贴粘。");
}
function closs(){
document.getElementById("txtstr").value="";
document.getElementById("url").value="";
}
</script>
</body>
</html>

Comment list( 0 )

You need to Sign in for post a comment

Help Search

Gitee_sixth 5th_float_left_close