From 214ba906f72487d4192c41170f67fec10a8015a4 Mon Sep 17 00:00:00 2001 From: IMGSS <838632526@qq.com> Date: Mon, 2 Dec 2019 15:29:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=B5=E5=BD=B1=E5=A4=A9=E5=A0=82?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E5=90=8C=E7=B1=BB=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E9=98=B3=E5=85=89=E7=94=B5=E5=BD=B1=20(#3517)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/dytt/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/routes/dytt/index.js b/lib/routes/dytt/index.js index b9b56ab076..ff30c7f5a8 100644 --- a/lib/routes/dytt/index.js +++ b/lib/routes/dytt/index.js @@ -1,7 +1,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); const iconv = require('iconv-lite'); - +const baseURL = 'https://www.ygdy8.net'; async function load(link, ctx) { const cache = await ctx.cache.get(link); if (cache) { @@ -20,7 +20,7 @@ async function load(link, ctx) { } module.exports = async (ctx) => { - const response = await got.get('https://www.dytt8.net/index0.html', { + const response = await got.get(baseURL, { responseType: 'buffer', }); response.data = iconv.decode(response.data, 'gb2312'); @@ -35,7 +35,7 @@ module.exports = async (ctx) => { const process = await Promise.all( list.map(async (item) => { const link = $(item).find('a:nth-of-type(2)'); - const itemUrl = 'http://www.dytt8.net' + link.attr('href'); + const itemUrl = baseURL + link.attr('href'); const other = await load(itemUrl, ctx); return { @@ -54,8 +54,8 @@ module.exports = async (ctx) => { ); const data = { - title: '电影天堂', - link: 'http://www.dytt8.net', + title: '电影天堂/阳光电影', + link: baseURL, description: '电影天堂RSS', item: process, };