From 60f4afc2a1fd5c9ccd2cb164d338d0f08c8c307a Mon Sep 17 00:00:00 2001 From: SunShinenny Date: Sun, 12 May 2019 15:15:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=98=80=E5=93=A9=E5=98=80=E5=93=A9?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=95=BF=E5=89=A7=E9=9B=86=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=96=87=E6=A1=A3=E8=A1=A8?= =?UTF-8?q?=E8=BF=B0=E4=B8=8D=E4=BD=B3=E7=9A=84=E5=9C=B0=E6=96=B9=20(#2104?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/anime.md | 6 +++++- lib/router.js | 0 lib/routes/dilidili/fanju.js | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) mode change 100755 => 100644 lib/router.js diff --git a/docs/anime.md b/docs/anime.md index b162432a7..abcf39fca 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -66,7 +66,11 @@ ## 嘀哩嘀哩-dilidili - + +请打开对应番剧的纵览页(非具体某集),从url中最后一位查看番剧id.(一般为英文) +除去超长的番剧(例如海贼)这种具有特殊页面的,绝大多数页面都可以解析. +最适合用来追新番 + ## 動畫瘋 diff --git a/lib/router.js b/lib/router.js old mode 100755 new mode 100644 diff --git a/lib/routes/dilidili/fanju.js b/lib/routes/dilidili/fanju.js index 8a4fcc9dc..3db287b35 100644 --- a/lib/routes/dilidili/fanju.js +++ b/lib/routes/dilidili/fanju.js @@ -44,7 +44,17 @@ module.exports = async (ctx) => { const animeName = $('body > div.container.clear > div.clear > div:nth-child(2) > div.detail.con24.clear > dl > dd > h1').text(); // @param {*} list 用于存储通过 " h4 > a "获取到的节点 - const list = $('body > div.container.clear > div.clear > div:nth-child(2) > div.con24.m-10.xf_news > div.time_pic.list > div:nth-child(1) > div.swiper-container.xfswiper1 > div > div > ul > li > a').get(); // 获取到剧集列表 + const beforeFilterList = $('div.swiper-container.xfswiper1 > div > div > ul > li > a').get(); // 获取到剧集列表 + const list = []; + beforeFilterList.forEach((element) => { + if ( + $(element) + .attr('href') + .indexOf('http://') != -1 + ) { + list.push(element); + } + }); // 使用promise处理多个节点 const process = await Promise.all( // 在list变量上使用map方法,对其拥有的每一个元素均进行"匿名函数"的操作