1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee
tools/netease_music/manual-script/comment id segment generator.js

103 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2023-12-25 16:46:39 +08:00
// -- 查看需要爬取的 comment 的分布
// SELECT cast( FLOOR( song_id / 10000000 ) * 10000000 as UNSIGNED ) as s, count(*) as count
// FROM comment_progress
// WHERE current_status != 2
// GROUP BY s
// ORDER BY s DESC;
// 变量 a 为通过执行以上SQL获取的分段
let a = `2110000000
2100000000
2090000000
2080000000
2070000000
2060000000
2050000000
2040000000
2030000000
2020000000
2010000000
2000000000
1990000000
1980000000
1970000000
1960000000
1950000000
1940000000
1930000000
1920000000
1910000000
1900000000
1890000000
1880000000
1870000000
1860000000
1850000000
1840000000
1830000000
1820000000
1810000000
1800000000
1500000000
1490000000
1480000000
1470000000
1460000000
1450000000
1440000000
1430000000
1420000000
1410000000
1400000000
1390000000
1380000000
1370000000
1360000000
1350000000
1340000000
1330000000
1320000000
1310000000
1300000000
1290000000
860000000
570000000
560000000
550000000
540000000
530000000
520000000
510000000
500000000
490000000
480000000
470000000
460000000
450000000
440000000
430000000
420000000
410000000
400000000
390000000
30000000
20000000
10000000
0`
const splitCount = 1
const step = 10000000 / splitCount
let b = []
a.split('\n')
.map(i => Number(i))
.forEach(n => {
for (let i = splitCount; i > 0; i--) {
b.push(Number(n) + (i - 1) * step)
}
});
let content = b.join('\n')
// console.log(content)
const fs = require('fs')
fs.writeFileSync('comment id segment.txt', content, 'utf-8')