Skip to content

Commit

Permalink
添加:播放器无播放资源时逻辑优化
Browse files Browse the repository at this point in the history
删除:低效解析器
  • Loading branch information
lifankohome committed Jan 28, 2018
1 parent b34131d commit ddc4f08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
1 change: 0 additions & 1 deletion Cinema/Spider.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,5 @@ public static function searchHistory($max = 10)
<button onclick=\"vParser('http://aikan-tv.com/?url=')\">解析器五</button>
<button onclick=\"vParser('http://j.zz22x.com/jx/?url=')\">解析器六</button>
<button onclick=\"vParser('http://jiexi.071811.cc/jx2.php?url=')\">解析器七</button>
<button onclick=\"vParser('http://api.wlzhan.com/sudu/?url=')\">解析器八</button>
</div>";
}
34 changes: 20 additions & 14 deletions play.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ function __autoload($class)
preg_match_all($introDom, $dom, $intro);
preg_match_all($linkDom, $dom, $link);

$name = $name[1][0];

if (empty($intro[1][0])) {
$intro = "";
} else {
$intro = '  ' . mb_substr($intro[1][0], 9, -14);
}

$name = $name[1][0];

$sets = array();
if (empty($link[2][0])) {
$multiSets = true;
Expand All @@ -63,10 +63,12 @@ function __autoload($class)
$setsDivDom = '/style="display:block;">[\s\S]+<li title=\'(.*?)\' class=\'w-newfigure w-newfigure-180x153\'>(.*?)<a href=\'(.*?)\'>/';
preg_match_all($setsDivDom, $dom, $setsDiv);
$setsLiDom = '/<li title=\'(.*?)\' class=\'w-newfigure w-newfigure-180x153\'>(.*?)<a href=\'(.*?)\'>/';
preg_match_all($setsLiDom, $setsDiv[0][0], $sets);
if(!empty($setsDiv[0])){
preg_match_all($setsLiDom, $setsDiv[0][0], $sets);

$sets[3] = array_unique($sets[3]); //确保不会有重复剧集
$sets[1] = array_unique($sets[1]);
$sets[3] = array_unique($sets[3]); //确保不会有重复剧集
$sets[1] = array_unique($sets[1]);
}
} else {
$varietyEpisode = false;
$setsDom = '#<a data-num="(.*?)" data-daochu="to=(.*?)" href="(.*?)">#';
Expand All @@ -76,7 +78,6 @@ function __autoload($class)
$multiSets = false;
$link = $link[2][0];
}

?>
<!DOCTYPE HTML>
<html>
Expand Down Expand Up @@ -148,16 +149,21 @@ function __autoload($class)
<div class="container">
<h3><?php
if ($multiSets) {
echo '' . $name . '》—— 总' . count($sets[3]) . '集<ul>';
foreach ($sets[3] as $key => $val) {
if ($varietyEpisode) {
echo "<li><a class='videoA' href='$val' target='ajax'>{$sets[1][$key]}</a></li>";
} else {
$key++;
echo "<li><a class='videoA' href='$val' target='ajax'>第{$key}集</a></li>"; //集数从1开始
if(empty($sets)){
echo '' . $name . '》—— 暂无播放资源';
}else{
echo '' . $name . '》—— 总' . count($sets[3]) . '集<ul>';
foreach ($sets[3] as $key => $val) {
if ($varietyEpisode) {
echo "<li><a class='videoA' href='$val' target='ajax'>{$sets[1][$key]}</a></li>";
} else {
$key++;
echo "<li><a class='videoA' href='$val' target='ajax'>第{$key}集</a></li>"; //集数从1开始
}
}
echo '</ul><div style="clear: both;border-bottom: 1px #ddd solid;padding-top: 1pc"></div>';
}
echo '</ul><div style="clear: both;border-bottom: 1px #ddd solid;padding-top: 1pc"></div>';

} else {
echo $name . "——<a class='videoA' href='$link' target='ajax'>立即播放</a>";
}
Expand Down

0 comments on commit ddc4f08

Please sign in to comment.