diff --git a/lib/v2/oreno3d/get_sec_page_data.js b/lib/v2/oreno3d/get_sec_page_data.js index ac023bd779..429f99aaf6 100644 --- a/lib/v2/oreno3d/get_sec_page_data.js +++ b/lib/v2/oreno3d/get_sec_page_data.js @@ -5,16 +5,16 @@ const rootUrl = 'https://oreno3d.com'; async function sync_detail(link) { // 主选择器 - const sec_page_selector = "article.g-main-video-article"; + const sec_page_selector = 'article.g-main-video-article'; // 分条选择器 - const raw_pic_selector = "header > figure.video-figure > a "; - const video_name_selector = "header > h1.video-h1 "; - const author_selector = "section:nth-child(4) > a > div.video-center"; - const origins_selector = "section:nth-child(5) > a > div.video-center"; - const characters_selector = "section:nth-child(6) > a > div.video-center"; - const tags_selector = "section:nth-child(7) > ul > li > a div.tag-text";// 未修复 - const desc_selector = "section blockquote.video-information-comment"; - const iwara_link_selector = "header > figure.video-figure > a"; + const raw_pic_selector = 'header > figure.video-figure > a '; + const video_name_selector = 'header > h1.video-h1 '; + const author_selector = 'section:nth-child(4) > a > div.video-center'; + const origins_selector = 'section:nth-child(5) > a > div.video-center'; + const characters_selector = 'section:nth-child(6) > a > div.video-center'; + const tags_selector = 'section:nth-child(7) > ul > li > a div.tag-text'; // 未修复 + const desc_selector = 'section blockquote.video-information-comment'; + const iwara_link_selector = 'header > figure.video-figure > a'; // 下载 const response = await got(link); const $ = cheerio.load(response.data); @@ -27,26 +27,34 @@ async function sync_detail(link) { const raw_pic_link = rootUrl + $(raw_pic_selector).find('img').attr('src'); const video_name = $(video_name_selector).text(); // 存为列表 - $(sec_page_selector).find(author_selector).each(function(i) { - authors[i] = $(this).text(); - authors[i].replace(" ", "");// 去空格 - authors[i].trim();// 去首尾空格 - }); - $(sec_page_selector).find(origins_selector).each(function(i) { - origins[i] = $(this).text(); - origins[i].replace(" ", ""); - origins[i].trim(); - }); - $(sec_page_selector).find(characters_selector).each(function(i) { - characters[i] = $(this).text(); - characters[i].replace(" ", ""); - characters[i].trim(); - }); - $(sec_page_selector).find(tags_selector).each(function(i) { - tags[i] = $(this).text(); - tags[i].replace(" ", ""); - tags[i].trim(); - }); + $(sec_page_selector) + .find(author_selector) + .each(function (i) { + authors[i] = $(this).text(); + authors[i].replace(' ', ''); // 去空格 + authors[i].trim(); // 去首尾空格 + }); + $(sec_page_selector) + .find(origins_selector) + .each(function (i) { + origins[i] = $(this).text(); + origins[i].replace(' ', ''); + origins[i].trim(); + }); + $(sec_page_selector) + .find(characters_selector) + .each(function (i) { + characters[i] = $(this).text(); + characters[i].replace(' ', ''); + characters[i].trim(); + }); + $(sec_page_selector) + .find(tags_selector) + .each(function (i) { + tags[i] = $(this).text(); + tags[i].replace(' ', ''); + tags[i].trim(); + }); // 筛选 const desc = $(sec_page_selector).find(desc_selector).text(); const iwara_link = $(iwara_link_selector).attr('href'); @@ -54,16 +62,14 @@ async function sync_detail(link) { return { raw_pic_link, video_name, - authors:authors.join(" "), - origins:origins.join(" "), - characters:characters.join(" "), - tags:tags.join(" "), + authors: authors.join(' '), + origins: origins.join(' '), + characters: characters.join(' '), + tags: tags.join(' '), desc, iwara_link, - oreno3d_link:link - + oreno3d_link: link, }; } - -module.exports = sync_detail; \ No newline at end of file +module.exports = sync_detail;