diff --git a/libs/download/sites/Eveira.js b/libs/download/sites/Eveira.js index 9205054..7e6f456 100644 --- a/libs/download/sites/Eveira.js +++ b/libs/download/sites/Eveira.js @@ -10,20 +10,16 @@ const {uniq} = require('lodash') module.exports = class Eveira extends AbsDownloader { async handle_dom($, original) { - const title = titleFormat($('.entry-header .title').text()) - const metaR = $('.entry-header ul a').map((i, el) => { - return {url: el.attribs.href, text: $(el).text()} - }).get(), - meta = urlTextsToAbs(metaR, original) - const tagsR = $('.nv-tags-list a').map((i, el) => { + const title = titleFormat($('.entry-header h1').text()) + const tagsR = $('#content .post-tags a').map((i, el) => { return {url: el.attribs.href, text: $(el).text()} }).get(), tags = urlTextsToAbs(tagsR, original) - const rawImgs = $('.entry-content img').map((i, el) => el.attribs['data-src']).get() + const rawImgs = $("#content figure img").map((i, el) => el.attribs['data-src'] || el.attribs['src']).get() const absImgs = arrToAbsUrl(rawImgs, original), imgs = uniq(absImgs) // const imgs = await zipUrlExt(absImgs, getSaveDir(title)) - const res = {title, meta, tags, imgs} + const res = {title, tags, imgs} return Promise.resolve(res) } } diff --git a/libs/download/sites/EveiraTags.js b/libs/download/sites/EveiraTags.js index 0c8cda8..e171239 100644 --- a/libs/download/sites/EveiraTags.js +++ b/libs/download/sites/EveiraTags.js @@ -29,10 +29,16 @@ module.exports = class EveiraTags extends AbsDownloader { } async handle_dom($, original) { - const title = titleFormat($('.nv-page-title').text()) - let images = $('.posts-wrapper .nv-post-thumbnail-wrap a').map((_, el) => { + let title = $('title').text()?.replace(/– ?EVERIA\.CLUB/, '') + title = title.replace(/["“”]/g, '').replace('Search Results for', '') + title = titleFormat(title) + let s1 = $('#blog-entries article .thumbnail a'), + s2 = $('#content .thumbnail a'), + s3 = s1.length > 0 ? s1 : s2 + let images = s3.map((_, el) => { const poster = $(el).find('img').get(0)?.attribs['data-src'] || $(el).find('img').get(0)?.attribs.src - const text = el.attribs.title + let text = $(el).find('img').get(0) + text = text?.attribs.title || text?.attribs.alt return {url: el.attribs.href, text, poster} }).get() images = uniqUrlTexts(images)