From cec592830266aebba4e6a5473b5a62d2c8c9d252 Mon Sep 17 00:00:00 2001 From: make Date: Tue, 18 Nov 2025 00:30:28 +0800 Subject: [PATCH] debug --- code/app/common.php | 6 ++++++ code/app/task/crawler/douban/page/VideoInfoPage.php | 4 ++++ code/extend/template/taglib/Site.php | 2 ++ 3 files changed, 12 insertions(+) diff --git a/code/app/common.php b/code/app/common.php index 6b3c76a..230d58a 100644 --- a/code/app/common.php +++ b/code/app/common.php @@ -765,6 +765,7 @@ namespace { /** * Undocumented function + * 有个bug 如果传入是中英文结合/纯英文/纯数字,则是返回是空 * * @param string $strZh * @return string @@ -781,6 +782,11 @@ namespace { $strPinYin = trim((string) $strPinYin); + if (!is_string($strPinYin) || trim($strPinYin) === '') { + return 'k_' . substr(sha1($strZh), 0, 12); + } + + return $strPinYin; } diff --git a/code/app/task/crawler/douban/page/VideoInfoPage.php b/code/app/task/crawler/douban/page/VideoInfoPage.php index f40397c..776a6ff 100644 --- a/code/app/task/crawler/douban/page/VideoInfoPage.php +++ b/code/app/task/crawler/douban/page/VideoInfoPage.php @@ -67,7 +67,11 @@ class VideoInfoPage extends BasePage if (empty($this->arrVideo)) { $arrVideo = json_decode($this->getContent(), true); + // $arrVideo = $arrVideo['list'][0]; // 这个日志会报错 + $arrVideo = $arrVideo['list'][0] ?? []; + $arrVideo = $arrVideo['list'][0]; + // print_r($arrVideo); $strPlayUrl = $arrVideo['vod_play_url']; diff --git a/code/extend/template/taglib/Site.php b/code/extend/template/taglib/Site.php index 7307c32..11bf88a 100644 --- a/code/extend/template/taglib/Site.php +++ b/code/extend/template/taglib/Site.php @@ -343,6 +343,8 @@ EOD; public function tagWz($tag) { $strWords = isset($tag['wz']) ? $tag['wz'] : ''; + $strWords = $this->customBuildVar($strWords); + echo $strWords; $parse = <<