Skip to content

Commit

Permalink
fix: support for eveira
Browse files Browse the repository at this point in the history
  • Loading branch information
IITII committed Dec 5, 2023
1 parent 32e462b commit 0cec840
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
12 changes: 4 additions & 8 deletions libs/download/sites/Eveira.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
12 changes: 9 additions & 3 deletions libs/download/sites/EveiraTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0cec840

Please sign in to comment.