mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
d7c8a38d88
fixed #20
28 lines
739 B
TypeScript
28 lines
739 B
TypeScript
interface Res {
|
|
data: {
|
|
word_list: {
|
|
sentence_id: string
|
|
word: string
|
|
event_time: string
|
|
hot_value: string
|
|
}[]
|
|
}
|
|
}
|
|
|
|
export default defineSource(async () => {
|
|
const url = "https://www.douyin.com/aweme/v1/web/hot/search/list/?device_platform=webapp&aid=6383&channel=channel_pc_web&detail_list=1"
|
|
const cookie = (await $fetch.raw("https://www.douyin.com/passport/general/login_guiding_strategy/?aid=6383")).headers.getSetCookie()
|
|
const res: Res = await myFetch(url, {
|
|
headers: {
|
|
cookie: cookie.join("; "),
|
|
},
|
|
})
|
|
return res.data.word_list.map((k) => {
|
|
return {
|
|
id: k.sentence_id,
|
|
title: k.word,
|
|
url: `https://www.douyin.com/hot/${k.sentence_id}`,
|
|
}
|
|
})
|
|
})
|