From ac40c99ec616a0b6a6aa8e43374231ed0643947b Mon Sep 17 00:00:00 2001 From: aliluya1977 <150768790+aliluya1977@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:02:17 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E8=8A=92=E6=9E=9C=E8=A7=86=E9=A2=91.j?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JS/芒果视频.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/JS/芒果视频.js b/JS/芒果视频.js index 2a8acfa..404771f 100644 --- a/JS/芒果视频.js +++ b/JS/芒果视频.js @@ -2,7 +2,11 @@ var rule = { title: '百忙无果[官]', host: 'https://pianku.api.%6d%67%74%76.com', homeUrl: '', - searchUrl: 'https://mobileso.bz.%6d%67%74%76.com/pc/search/v1?q=**&pn=fypage&pc=10', + // searchUrl: 'https://mobileso.bz.%6d%67%74%76.com/pc/search/v1?q=**&pn=fypage&pc=10', + // 新版接口搜索变成v2并且加了验证,蛋疼 + // searchUrl: 'https://mobileso.bz.mgtv.com/pc/search/v2?allowedRC=1&src=mgtv&did=cf03b959-6945-4cb6-bcb3-88762459354d×tamp=2024-06-21T15%3A52%3A55Z&signVersion=1&signNonce=8dae67a1fafc4bda984ec8deb47666ad&q=**&pn=fypage&pc=10&corr=1&_support=10000000&signature=4e27fddcd2a1a66d6c1764ed6b74bab7', + // 用手机的吧,搞不定这个 + searchUrl: 'https://mobileso.bz.%6d%67%74%76.com/msite/search/v2?q=**&pn=fypage&pc=10', detailUrl: 'https://pcweb.api.mgtv.com/episode/list?page=1&size=50&video_id=fyid', searchable: 2, quickSearch: 0, @@ -138,31 +142,29 @@ var rule = { let html = request(input); let json = JSON.parse(html); json.data.contents.forEach(function (data) { - if (data.data.sourceList || data.data.yearList) { - let list = data.data.sourceList ? data.data.sourceList : data.data.yearList[0].sourceList; - let desc = ""; - list.forEach(function (it) { - desc += it.name + "\t" - }); + if (data.type && data.type == 'media') { + let item = data.data[0]; + let desc = item.desc.join(','); let fyclass = ''; - if (list[0].source === "imgo") { - let img = data.data.pic ? data.data.pic : data.data.yearList[0].pic; + if (item.source === "imgo") { + let img = item.img ? item.img : ''; try { - fyclass = data.data.desc.find(it => it.label === '类型').url.match(/lib\/(\d+)/)[1] + '$'; + fyclass = item.rpt.match(/idx=(.*?)&/)[1] + '$'; } catch (e) { + log(e.message); fyclass = ''; } log(fyclass); d.push({ - title: data.data.title ? data.data.title : data.data.yearList[0].title, + title: item.title.replace(/|<\/B>/g, ''), img: img, - content: data.data.story ? data.data.story : data.data.yearList[0].story, - desc: data.data.playTime, - url: fyclass + list[0].vid + content: '', + desc: desc, + url: fyclass + item.url.match(/.*\/(.*?)\.html/)[1] }) } } }); setResult(d); }), -} \ No newline at end of file +}