From 325860e5efeecc049076b972830b176371493a07 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 20 Feb 2023 15:58:13 -0400 Subject: [PATCH] fix(route): 7mmtv (#11918) --- docs/en/multimedia.md | 4 +-- docs/multimedia.md | 4 +-- lib/v2/7mmtv/index.js | 38 ++++++++++---------------- lib/v2/7mmtv/templates/description.art | 6 +++- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/docs/en/multimedia.md b/docs/en/multimedia.md index 9355cf184..9f5ed7f4e 100644 --- a/docs/en/multimedia.md +++ b/docs/en/multimedia.md @@ -14,7 +14,7 @@ Full transcript support for better user experience. ### Category - + **Language** @@ -42,7 +42,7 @@ Full transcript support for better user experience. ### Maker - + **Language** diff --git a/docs/multimedia.md b/docs/multimedia.md index 8104621a4..8a8ff7b71 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -154,7 +154,7 @@ pageClass: routes ### 分类 - + **语言** @@ -182,7 +182,7 @@ pageClass: routes ### 制作商 - + **语言** diff --git a/lib/v2/7mmtv/index.js b/lib/v2/7mmtv/index.js index 79784e522..929c735df 100644 --- a/lib/v2/7mmtv/index.js +++ b/lib/v2/7mmtv/index.js @@ -9,7 +9,7 @@ module.exports = async (ctx) => { const category = ctx.params.category ?? 'censored_list'; const type = ctx.params.type ?? 'all'; - const rootUrl = 'https://7mmtv.tv'; + const rootUrl = 'https://7mmtv.sx'; const currentUrl = `${rootUrl}/${language}/${category}/${type}/1.html`; const response = await got({ @@ -19,22 +19,19 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); - $('.pull-left p a').remove(); - - let items = $('.latest-korean-box-text a') + let items = $('.video') .toArray() .map((item) => { item = $(item); - const video = item.parent().parent().find('video'); - + const title = item.find('.video-title a'); return { - title: item.text(), - author: item.parent().find('.pull-left').text(), - pubDate: parseDate(item.parent().find('.date-part').text()), - link: `${item.attr('href').match(/^(http.*_content\/\d+)/)[1]}/index.html`, - poster: video.attr('poster'), - video: video.attr('srcmv'), + title: title.text(), + author: item.find('.video-channel').text(), + pubDate: parseDate(item.find('.small').text()), + link: title.attr('href'), + poster: item.find('img').attr('data-src'), + video: item.find('video').attr('data-src'), }; }); @@ -49,23 +46,18 @@ module.exports = async (ctx) => { const content = cheerio.load(detailResponse.data); item.description = art(path.join(__dirname, 'templates/description.art'), { - cover: content('.post-inner-details-img img').attr('src'), - images: content('.video-introduction-images-list-row') - .find('img') + cover: content('.content_main_cover img').attr('src'), + images: content('.owl-lazy') .toArray() - .map((i) => content(i).attr('src')), + .map((i) => content(i).attr('data-src')), + description: content('.video-introduction-images-text').html(), poster: item.poster, video: item.video, }); - item.category = content('.actor-right-images-part p') + item.category = content('.categories a') .toArray() - .map((a) => content(a).text()) - .concat( - content('.posts-inner-details-text-under ul .posts-message span') - .toArray() - .map((c) => content(c).text()) - ); + .map((a) => content(a).text()); delete item.poster; delete item.video; diff --git a/lib/v2/7mmtv/templates/description.art b/lib/v2/7mmtv/templates/description.art index 04aa7c28e..ead6ae7c9 100644 --- a/lib/v2/7mmtv/templates/description.art +++ b/lib/v2/7mmtv/templates/description.art @@ -1,11 +1,15 @@ {{ if cover }} {{ /if }} + {{ if video }}

{{ /if }} + +{{ if description }}{{@ description }}{{ /if }} + {{ each images }} -{{ /each }} \ No newline at end of file +{{ /each }}