Robustness of illust

This commit is contained in:
WEBXOSS 2016-11-13 14:50:16 +08:00
parent eeeb72b6cd
commit 36a97064d3
3 changed files with 55 additions and 53 deletions

3
dist/index.js vendored
View file

@ -461,7 +461,8 @@ function toInfo(doc, id) {
// info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src') // info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src')
info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src') info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src')
info.illust = doc.querySelector('.card_img').textContent.match(/Illust (.*)$/)[1] info.illust = (doc.querySelector('.card_img').textContent.match(/Illust (.*)$/) || [])[1] || ''
if (!info.illust) console.warn(`${info.pid}: no illust!`)
info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq) info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq)

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -92,7 +92,8 @@ function toInfo(doc, id) {
// info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src') // info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src')
info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src') info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src')
info.illust = doc.querySelector('.card_img').textContent.match(/Illust (.*)$/)[1] info.illust = (doc.querySelector('.card_img').textContent.match(/Illust (.*)$/) || [])[1] || ''
if (!info.illust) console.warn(`${info.pid}: no illust!`)
info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq) info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq)