diff --git a/lib/routes/algocasts/all.js b/lib/routes/algocasts/all.js
index 070072fc9..fb31efaa2 100644
--- a/lib/routes/algocasts/all.js
+++ b/lib/routes/algocasts/all.js
@@ -8,7 +8,7 @@ const getCacheParsed = async (ctx, key) => {
}
};
-const generateResponse = async (ctx, items) => ({
+const generateResponse = async (items) => ({
// 源标题
title: 'AlgoCasts',
// 源链接
@@ -96,5 +96,5 @@ module.exports = async (ctx) => {
infos.push({ id, title, episode, link });
});
- ctx.state.data = await generateResponse(ctx, await makeFull(ctx, infos));
+ ctx.state.data = await generateResponse(await makeFull(ctx, infos));
};
diff --git a/lib/routes/cartoonmad/comic.js b/lib/routes/cartoonmad/comic.js
index b2e11bb43..52557af20 100644
--- a/lib/routes/cartoonmad/comic.js
+++ b/lib/routes/cartoonmad/comic.js
@@ -33,7 +33,7 @@ const getChapters = async (id, $, caches) => {
link,
title,
};
- const other = await caches.tryGet(link, async () => await load(a, `https://www.cartoonmad.com/home75458/${id}/${title.split(' ')[1]}`));
+ const other = await caches.tryGet(link, () => load(a, `https://www.cartoonmad.com/home75458/${id}/${title.split(' ')[1]}`));
return Promise.resolve(Object.assign({}, single, other));
})
.toArray()
diff --git a/lib/routes/clickme/index.js b/lib/routes/clickme/index.js
index fb19d154d..ac35aff05 100644
--- a/lib/routes/clickme/index.js
+++ b/lib/routes/clickme/index.js
@@ -50,7 +50,7 @@ module.exports = async (ctx) => {
try {
const response = await got.get(link);
const result = parseContent(response.data);
- if (!result) {
+ if (!result.description) {
return Promise.resolve('');
}
rssitem.description = result.description;
diff --git a/lib/routes/cnu/selected.js b/lib/routes/cnu/selected.js
index f51b14d75..d8270577c 100644
--- a/lib/routes/cnu/selected.js
+++ b/lib/routes/cnu/selected.js
@@ -29,7 +29,7 @@ module.exports = async (ctx) => {
try {
const response = await got.get(link);
const result = utils.parseContent(response.data);
- if (!result) {
+ if (!result.description) {
return Promise.resolve('');
}
diff --git a/lib/routes/dekudeals/index.js b/lib/routes/dekudeals/index.js
index 757ec0f65..ae3cac04b 100644
--- a/lib/routes/dekudeals/index.js
+++ b/lib/routes/dekudeals/index.js
@@ -4,6 +4,8 @@ const url = require('url');
module.exports = async (ctx) => {
const type = ctx.params.type;
+
+ const host = 'https://www.dekudeals.com/';
const link = url.resolve(host, type);
const response = await got.get(link);
@@ -12,7 +14,6 @@ module.exports = async (ctx) => {
const title = $('#search-title').text();
const list = $('.search-main > .item-grid2 > div');
- const host = 'https://www.dekudeals.com/';
const out = await Promise.all(
list
.map(async (index, item) => {
diff --git a/lib/routes/dlsite/new.js b/lib/routes/dlsite/new.js
index 2115c81b5..2ef0d7d2d 100644
--- a/lib/routes/dlsite/new.js
+++ b/lib/routes/dlsite/new.js
@@ -50,12 +50,13 @@ const infos = {
module.exports = async (ctx) => {
const info = infos[ctx.params.type];
- const link = host + info.url;
// 判断参数是否合理
if (info === undefined) {
throw Error('不支持指定类型!');
}
+ const link = host + info.url;
+
const response = await got(link, {
method: 'GET',
baseUrl: host,
diff --git a/lib/routes/lol/newsindex.js b/lib/routes/lol/newsindex.js
index a6b00e90e..439b6f64d 100644
--- a/lib/routes/lol/newsindex.js
+++ b/lib/routes/lol/newsindex.js
@@ -68,17 +68,12 @@ module.exports = async (ctx) => {
}
function getUrl(sRedirectURL, iDocID, sVID) {
// 由于数据源太多,具体的URL返回逻辑可以参考news/index.html页面里面的handleData方法
- let pageUrl;
+
if (sRedirectURL) {
- pageUrl = sRedirectURL;
- if (pageUrl.indexOf('docid') > 0) {
- sRedirectURL = pageUrl;
+ if (sRedirectURL.indexOf('?') > 0) {
+ sRedirectURL = sRedirectURL + '&docid=' + iDocID;
} else {
- if (pageUrl.indexOf('?') > 0) {
- sRedirectURL = pageUrl + '&docid=' + iDocID;
- } else {
- sRedirectURL = pageUrl + '?docid=' + iDocID;
- }
+ sRedirectURL = sRedirectURL + '?docid=' + iDocID;
}
} else {
if (sVID) {
@@ -87,10 +82,8 @@ module.exports = async (ctx) => {
sRedirectURL = 'http://lol.qq.com/news/detail.shtml?docid=' + iDocID;
}
}
- pageUrl = sRedirectURL;
- // console.log(iDocID,pageUrl);
- // console.log('\niDocID:', iDocID, '\nsVID:', sVID, '\nsRedirectURL:', sRedirectURL, '\nsURL:', sUrl, '\npageurl:', pageUrl, '\n');
- return pageUrl;
+
+ return sRedirectURL;
}
return list.map((item) => ({
title: `【${typeName}】` + item.sTitle,
diff --git a/lib/routes/metred/fuli.js b/lib/routes/metred/fuli.js
index 342e734bd..035a56f04 100644
--- a/lib/routes/metred/fuli.js
+++ b/lib/routes/metred/fuli.js
@@ -16,12 +16,9 @@ async function load(link, ctx) {
$(images[k]).replaceWith(``);
}
const couponUrl = $('.layui-btn.layui-btn.layui-btn-lg').attr('href');
- let eventHtml;
- if (!couponUrl || couponUrl === undefined) {
- eventHtml = '
活动链接:无
活动链接:无