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

This commit is contained in:
Ethan Shen
2020-09-26 15:26:48 +01:00
committed by GitHub
parent aeeaf1c279
commit b0584950d1
+7 -1
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();
}