-
+
diff --git a/bangumi.php b/bangumi.php
index e76208dc..4c312c26 100755
--- a/bangumi.php
+++ b/bangumi.php
@@ -1,32 +1,66 @@
need('includes/head.php');
$this->need('includes/header.php');
-$this->need('libs/Bangumi.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));
+}
+
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'];
- $bgmdataraw = bilibili::getFollowingListRaw($page,16);
- $bgmlist = bilibili::getFormatList($bgmdataraw['data']['list']);
+ $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;
} else {
$bgmdataraw = array();
$bgmlist = array();
@@ -34,7 +68,7 @@ function is_https() {
// Uncomment for debugging
/*
-if ($_GET['dbg'] == 'fuck') {
+if ($_GET['dbg'] == 'format') {
echo "
"; print_r($bgmlist); echo ""; @@ -48,70 +82,106 @@ function is_https() { ?>