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, };