From 671be2c99225262f5e8f96bedbfc1f2084067b03 Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Thu, 26 Mar 2020 14:55:44 +0800 Subject: =?UTF-8?q?=F0=9F=92=BB=20Fix:=20=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E6=B3=A8=E9=87=8A=E4=BB=A5=E5=8F=8A=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E9=94=99=E5=88=AB=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bangumi.php | 196 ++++++++++++++++-------------------------------------------- 1 file changed, 52 insertions(+), 144 deletions(-) diff --git a/bangumi.php b/bangumi.php index 4c312c2..74952f5 100755 --- a/bangumi.php +++ b/bangumi.php @@ -1,66 +1,32 @@ need('includes/head.php'); $this->need('includes/header.php'); - - -function curl($url, $cookie) -{ - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $url); - //地址 - //curl_setopt ($curl, CURLOPT_COOKIEJAR, $cookiefile);//文件式 - //curl_setopt ($curl, CURLOPT_COOKIEFILE, $cookiefile); - curl_setopt($curl, CURLOPT_COOKIE, $cookie); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - $str = curl_exec($curl); - curl_close($curl); - return $str; -} - -function getSubstr($str, $leftStr, $rightStr) -{ - $left = strpos($str, $leftStr); - //echo '左边:'.$left; - $right = strpos($str, $rightStr, $left); - //echo '
右边:'.$right; - if ($left < 0 or $right < $left) return ''; - return substr($str, $left + strlen($leftStr), $right - $left - strlen($leftStr)); -} - +$this->need('libs/Bangumi.php'); if ($this->fields->uid == !'' && $this->fields->sessdata == !'') { + bilibili::setUserInfo($this->fields->uid, $this->fields->sessdata); if (empty($_GET['page']) || $_GET['page'] == 0) $page = 1; else $page = $_GET['page']; - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, 'https://api.bilibili.com/x/space/bangumi/follow/list?type=1&follow_status=0&vmid=' . $this->fields->uid . '&ps=16&pn=' . $page); - curl_setopt($curl, CURLOPT_COOKIE, 'SESSDATA=' . $this->fields->sessdata . ';'); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - $str = curl_exec($curl); - curl_close($curl); - $bgmdataraw = json_decode($str, true); - $error = false; - if (!$bgmdataraw) $error = true; + $bgmdataraw = bilibili::getFollowingListRaw($page,16); + $bgmlist = bilibili::getFormatList($bgmdataraw['data']['list']); } else { $bgmdataraw = array(); $bgmlist = array(); @@ -68,7 +34,7 @@ if ($this->fields->uid == !'' && $this->fields->sessdata == !'') { // Uncomment for debugging /* -if ($_GET['dbg'] == 'format') { +if ($_GET['dbg'] == 'fuck') { echo "
";
     print_r($bgmlist);
     echo "
"; @@ -82,106 +48,48 @@ if ($_GET['dbg'] == 'rawlist') { ?>
-
-
+
+
-
-
-
- - - - -
-
+
+
+
+ + + + +
+
need('includes/comments.php'); ?>
-- cgit v1.2.3