Skip to content

Commit

Permalink
修复知乎未登录时没获取到图片
Browse files Browse the repository at this point in the history
  • Loading branch information
kscript committed Sep 16, 2024
1 parent 3cd5ebb commit c20a7a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const extract = async (markdownBody, selectors, options, exec) => {
downloadUrl
}
}
const src = item.getAttribute(options.lazyKey) || item.src
const src = item.getAttribute([].concat(options.lazyKey || []).find(key => item.getAttribute(key)) || 'src')
const url = src.replace(/\?$/, '')
const ext = getExt(url)
const name = realName + '/' + md5(url) + (ext ? '.' + ext : '')
Expand Down
2 changes: 1 addition & 1 deletion src/websites/zhihu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const options = {
link: false,
br: true,
code: false,
lazyKey: 'data-original',
lazyKey: ['data-original', 'data-actualsrc'],
selectors: {
title: '.Post-Title',
body: '.Post-RichText',
Expand Down

0 comments on commit c20a7a3

Please sign in to comment.