Skip to content

Commit

Permalink
fix: get qq anonymous avatar (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
Android-KitKat authored Sep 8, 2023
1 parent d1972ba commit f175155
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/server/function/twikoo/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,8 @@ const fn = {
async getQQAvatar (qq) {
try {
const qqNum = qq.replace(/@qq.com/ig, '')
const result = await axios.get(`https://s.p.qq.com/pub/get_face?img_type=4&uin=${qqNum}`, {
maxRedirects: 0,
validateStatus: status => [301, 302, 307, 308].includes(status)
})
return result?.headers?.location || null
const result = await axios.get(`https://aq.qq.com/cn2/get_img/get_face?img_type=3&uin=${qqNum}`)
return result.data?.url || null
} catch (e) {
logger.warn('获取 QQ 头像失败:', e)
}
Expand Down

0 comments on commit f175155

Please sign in to comment.