forked from zyronon/douyin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess.js
33 lines (31 loc) · 842 Bytes
/
process.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import fs from 'fs'
let read = './data/detail_comments_2024-03-29.json'
let video_ids = [
'7260749400622894336',
'7128686458763889956',
'7293100687989148943',
'6923214072347512068',
'7005490661592026405',
'7161000281575148800',
'7267478481213181238',
'6686589698707590411',
'7321200290739326262',
'7194815099381484860',
'6826943630775831812',
'7110263965858549003',
'7295697246132227343',
'7270431418822446370',
'6882368275695586568',
'7000587983069957383',
]
let saveFileStr = fs.readFileSync(read, 'utf8')
let data = JSON.parse(saveFileStr)
video_ids.map((v) => {
let video_comments = data.filter((a) => a.aweme_id == v)
console.log('v', v, 'c', video_comments.length)
fs.writeFileSync(
`./video_id_${v}.json`,
JSON.stringify(video_comments, null, 2),
)
})
console.log('data', data.length)