Skip to content

Commit

Permalink
✨ 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaoo committed Mar 31, 2020
1 parent 1446483 commit 4dd9f83
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 257 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
3. 提问前请先阅读 “主题文档” 先哦!
4. 如果喜欢这个主题,欢迎各位点个 Star !

## 黑名单

1. [http://kjxy.41f.cn/](http://kjxy.41f.cn/)(删除版权)

---

Copyright © 2020 [Bhao](https://dwd.moe/), under GPL-3.0 License.
4 changes: 2 additions & 2 deletions assets/css/cuckoo.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/cuckoo.min.js

Large diffs are not rendered by default.

196 changes: 47 additions & 149 deletions bilibili.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package custom
* @author Seirin
* @link https://qwq.best/
* @version 1.0.0
* @version 1.0.3
*/


Expand Down Expand Up @@ -81,45 +81,43 @@ function updateDate($userID, $cacheTime, $amout, $hideMedia)
$hideMedia = explode(",", $hideMedia);
$data = json_decode($output, true);

$i = 0;
//开始苦逼的缓存图片
foreach ($data['data']['list'] as $value) {
$imgUrl = $value['cover'];
$imgPath = $dirPath . '/' . $value['media_id'] . '.jpg';

if (file_exists($imgPath) == false) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $imgUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Origin: https://space.bilibili.com", "Referer: https://space.bilibili.com/" . $userID . "/bangumi"));
$file_content = curl_exec($ch);
curl_close($ch);
$img_file = fopen($imgPath, 'w');
fwrite($img_file, $file_content);
fclose($img_file);
}

if (in_array($value['media_id'], $hideMedia)) {
foreach($data['data']['list'] as $key => $bangumi) {
if (in_array($bangumi['media_id'], $hideMedia)) {
$display = '0';
} else {
$display = '1';
}
$data['data']['list'][$i]['display'] = $display;
$i++;
$array[] = [
'name' => $bangumi['title'],
'id' => $bangumi['media_id'],
'cover' => [
'large' => preg_replace('/http/', 'https', $bangumi['cover']),
'square' => preg_replace('/http/', 'https', $bangumi['square_cover'])
],
'url' => $bangumi['url'],
'type' => $bangumi['season_type_name'],
'area' => $bangumi['areas'][0]['name'],
'show' => (isset($bangumi['new_ep']['index_show'])) ? $bangumi['new_ep']['index_show'] : '即将开播',
'evaluate' => $bangumi['evaluate'],
'display' => $display
];
}

$data['time'] = time();
$data['BilibiliUid'] = $userID;
$data['amout'] = $amout;
$bangumi_data[] = [
'bangumi' => $array,
'time' => time(),
'BilibiliUid' => $userID,
'amout' => $amout,

$data = json_encode($data);
];
$bangumi_data = json_encode($bangumi_data);
$file = fopen($filePath, "w");
fwrite($file, $data);
fwrite($file, $bangumi_data);
fclose($file);

return $data;
return $bangumi_data;
}

?>
Expand All @@ -131,132 +129,31 @@ function updateDate($userID, $cacheTime, $amout, $hideMedia)


<style>
.seirin-bilibili-follow-panel-all {
margin-top: 20px;
}

.seirin-bilibili-page {
/*margin-bottom: 20px;*/
}

.seirin-bilibili-follow-panel {
padding: 0 !important;
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.8);
transition: all .3s;
margin-bottom: 20px;
}

.seirin-bilibili-follow-panel:hover {
background-color: rgba(255, 255, 255, 0.93);
transition: all .3s;
}

.seirin-bilibili-follow-panel-loading {
padding: 10px !important;
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.8);
margin-bottom: 20px;
}

.seirin-bilibili-follow-img-dad {
padding-right: 2px;
max-width: 145px !important;
}

.seirin-bilibili-follow-img {
width: 95%;
max-width: 140px !important;
margin: 0 !important;
padding: 0 !important;

}

.seirin-bilibili-follow-content {
padding-top: 15px;
padding-right: 20px;
padding-left: 10px;
padding-bottom: 15px;
}

.seirin-bilibili-follow-title {
font-weight: 400;
line-height: 24px;
font-size: 22px;
margin-bottom: 5px !important;
margin-top: 2px !important;

}

.seirin-bilibili-follow-text {
margin-bottom: 10px !important;
font-size: 14px;
}

.seirin-bilibili-follow-info {
font-size: 12px;
margin-bottom: 0 !important;
}
@media screen and (max-width:1016px) {
.seirin-bilibili-follow-img {
display:none;
}
.seirin-bilibili-follow-content {
padding-left:25px;
padding-top:10px;
width: 100%!important;
}
}
@media screen and (max-width:900px) {
.seirin-bilibili-follow-img {
display:block;
}
.seirin-bilibili-follow-content {
padding-top: 15px;
padding-right: 20px;
padding-left: 10px;
padding-bottom: 15px;
width: 75%!important;
}
}
@media screen and (max-width:706px) {
.seirin-bilibili-follow-img {
display:none;
}
.seirin-bilibili-follow-content {
padding-left:25px;
padding-top:10px;
width: 100%!important;
}
}
</style>


<div class="seirin-bilibili-follow-panel-all mdui-typo">
<div class="seirin-bilibili-page">
<div class="bilibili-panel-all">
<div class="seirin-bilibili-page mdui-typo">

<div class="mdui-card seirin-bilibili-follow-panel-loading mdui-shadow-10" id="panel-loading">
<div class="mdui-card bilibili-panel-loading mdui-shadow-10" id="panel-loading">
<p style="margin:0;">正在加载噢,请稍等qwq~</p>
</div>

<div class="mdui-card seirin-bilibili-follow-panel-loading mdui-shadow-10" id="panel-fail"
<div class="mdui-card bilibili-panel-loading mdui-shadow-10" id="panel-fail"
style="display: none;">
<p style="margin:0;">加载失败,请刷新页面重试QAQ</p>
</div>
<script type="text/javascript">
var bilibiliItemTemple = '<div class="mdui-card seirin-bilibili-follow-panel mdui-shadow-10">\n' +
' <div class="mdui-row">\n' +
' <div class="mdui-col-xs-3 seirin-bilibili-follow-img-dad">\n' +
' <img id="img" src="//<?=$_SERVER['SERVER_NAME']?>/usr/themes/Cuckoo/assets/cache/BilibiliFollow/{media_id}.jpg" alt="{title}" class="seirin-bilibili-follow-img block">\n' +
var bilibiliItemTemple = '<div class="mdui-card bilibili-panel mdui-shadow-10">\n' +
' <div class="bilibili-img-dad">\n' +
' <img src="{cover}" referrerpolicy="no-referrer" class="bilibili-img bilibili-img-pc">\n' +
' <img src="{coverPe}" referrerpolicy="no-referrer" class="bilibili-img">\n' +
' </div>\n' +
'\n' +
' <div class="mdui-col-xs-9 seirin-bilibili-follow-content">\n' +
' <a class="seirin-bilibili-follow-title" href="https://www.bilibili.com/bangumi/media/md{media_id}" target="_blank">{title}</a>\n' +
' <p class="seirin-bilibili-follow-text">{evaluate}</p>\n' +
' <p class="seirin-bilibili-follow-info">{season_type_name} | {areas_0_name} | {new_ep_index_show}</p>\n' +
' <div class="bilibili-content">\n' +
' <a class="bilibili-title bilibili-t" href="https://www.bilibili.com/bangumi/media/md{media_id}" target="_blank">{title}</a>\n' +
' <p class="bilibili-info">{season_type_name} | {areas_0_name} | {new_ep_index_show}</p>\n' +
' <p class="bilibili-text">{evaluate}</p>\n' +
' </div>\n' +
'\n' +
' </div>\n' +
' </div>';

open = function () {
Expand All @@ -273,19 +170,20 @@ function updateDate($userID, $cacheTime, $amout, $hideMedia)
success: function (data) {
loadingContainer.attr("style","display:none;");

var list = data['data']['list'];
var list = data[0]['bangumi'];
for (var i in list) {
var now = list[i];

if (now['display'] == '1') {
//匹配替换
var item = bilibiliItemTemple.replace("{title}", now['title']).replace("{title}", now['title'])
.replace("{media_id}", now['media_id'])
.replace("{media_id}", now['media_id'])
var item = bilibiliItemTemple.replace("{title}", now['name'])
.replace("{media_id}", now['id'])
.replace("{media_id}", now['id'])
.replace("{evaluate}", now['evaluate'])
.replace("{season_type_name}", now['season_type_name'])
.replace("{areas_0_name}", now['areas'][0]['name'])
.replace("{new_ep_index_show}", now['new_ep']['index_show']);
.replace("{season_type_name}", now['type'])
.replace("{areas_0_name}", now['area'])
.replace("{new_ep_index_show}", now['show'])
.replace("{cover}", now['cover']['large'])
.replace("{coverPe}", now['cover']['square']);
devContainer.append(item);
}
}
Expand Down
Loading

0 comments on commit 4dd9f83

Please sign in to comment.