fix: GQ台灣部分图集 (#5740)

This commit is contained in:
Ethan Shen 2020-09-26 22:26:48 +08:00 committed by GitHub
parent aeeaf1c279
commit b0584950d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -40,11 +40,17 @@ module.exports = async (ctx) => {
item.title = content('h1').text();
const article = content('section[data-test-id="ArticleBodyContent"]').html();
const gallery = content('section[data-test-id="GalleryImage"]').html();
if (ctx.params.caty === 'video') {
item.description = content('div[data-test-id="EmbedIframe"]').html() + content('p[data-test-id="DekText"]').parent().html();
item.pubDate = new Date(detailResponse.data.match(/pubDate":"(.*?)","channel/)[1]).toUTCString();
} else if (gallery !== null) {
item.description = gallery;
item.pubDate = new Date(detailResponse.data.match(/pubDate":"(.*?)","items/)[1]).toUTCString();
} else {
item.description = content('section[data-test-id="ArticleBodyContent"]').html();
item.description = article;
item.pubDate = new Date(detailResponse.data.match(/pubDate":"(.*?)","publishedRevisions/)[1]).toUTCString();
}