style: auto format
This commit is contained in:
@@ -74,11 +74,11 @@ async function handler(ctx) {
|
||||
cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link
|
||||
url: item.link,
|
||||
}); // 获取详情页内容
|
||||
const content = load(detailResponse.data); // 使用cheerio解析内容
|
||||
|
||||
item.description = content('#vsb_content_2 .v_news_content').html() || '内容无法提取';// 提取内容区详情
|
||||
item.description = content('#vsb_content_2 .v_news_content').html() || '内容无法提取'; // 提取内容区详情
|
||||
|
||||
return item; // 返回完整的item
|
||||
})
|
||||
|
||||
@@ -77,7 +77,8 @@ async function handler(ctx) {
|
||||
cache.tryGet(item.link, async () => {
|
||||
const url = new URL(item.link); // 创建 URL 对象以验证链接
|
||||
// 确保链接是以正确的域名开头,并且不为空
|
||||
if (url.hostname === 'gs1.shu.edu.cn') { // 需校内访问
|
||||
if (url.hostname === 'gs1.shu.edu.cn') {
|
||||
// 需校内访问
|
||||
// Skip or handle differently for URLs with gs1.shu.edu.cn domain
|
||||
item.description = 'gs1.shu.edu.cn, 无法直接获取';
|
||||
return item;
|
||||
@@ -85,13 +86,12 @@ async function handler(ctx) {
|
||||
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link
|
||||
url: item.link,
|
||||
}); // 获取详情页内容
|
||||
const content = load(detailResponse.data); // 使用cheerio解析内容
|
||||
|
||||
item.description = content('#vsb_content .v_news_content').html() || item.description;
|
||||
|
||||
|
||||
return item; // 返回完整的item
|
||||
})
|
||||
)
|
||||
|
||||
@@ -74,7 +74,7 @@ async function handler(ctx) {
|
||||
cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link
|
||||
url: item.link,
|
||||
});
|
||||
const content = load(detailResponse.data);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ async function handler(ctx) {
|
||||
cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link
|
||||
url: item.link,
|
||||
}); // 获取详情页内容
|
||||
const content = load(detailResponse.data); // 使用cheerio解析内容
|
||||
|
||||
|
||||
Reference in New Issue
Block a user