diff --git a/extend/DouBanLib/MovieTag.php b/extend/DouBanLib/MovieTag.php index 367629f..3f74816 100644 --- a/extend/DouBanLib/MovieTag.php +++ b/extend/DouBanLib/MovieTag.php @@ -86,24 +86,20 @@ static public function getTop250($page): array $_data = parent::curl_get($_url); $_ = parent::preg('#([\s\S]*?)<\/em>([\s\S]*?)([\s\S]*?)([\s\S]*?)#', $_data, 0); $_rank = parent::preg('#([\s\S]*?)<\/span>#', $_data, 1); - try { - $_count = count($_[0]); - $_return = []; - if ($_count) { - for ($i = 0; $i < $_count; $i++) { - $_return[$i]['em'] = $_[1][$i]; - $_return[$i]['id'] = $_[3][$i]; - $_return[$i]['name'] = $_[5][$i]; - $_return[$i]['rank'] = $_rank[$i]; - $_return[$i]['img'] = $_[6][$i]; - } - } else { - $_return = []; + $_count = parent::getCount($_[0]); + $_return = []; + if ($_count) { + for ($i = 0; $i < $_count; $i++) { + $_return[$i]['em'] = $_[1][$i]; + $_return[$i]['id'] = $_[3][$i]; + $_return[$i]['name'] = $_[5][$i]; + $_return[$i]['rank'] = $_rank[$i]; + $_return[$i]['img'] = $_[6][$i]; } - return $_return; - } catch (\Throwable $th) { - return []; + } else { + $_return = []; } + return $_return; } static public function getIndexMovie($MovieType = '热门', $MovieSort = 'recommend', $page_limit = '24', $page = 1): string