提交修改
Some checks failed
Deploy Gitee Pages / deploy (push) Has been cancelled
Deploy Github Pages / deploy (push) Has been cancelled

This commit is contained in:
2026-04-09 20:46:40 +08:00
commit 66582616f0
2316 changed files with 637536 additions and 0 deletions

File diff suppressed because it is too large Load Diff

33
node/comment/process.js Normal file
View File

@@ -0,0 +1,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)

17985
node/input.json Normal file

File diff suppressed because it is too large Load Diff

2890
node/ouput.json Normal file

File diff suppressed because it is too large Load Diff

19
node/package.json Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"post-img": "cd post && node process-post-img.js",
"post-list": "node process-post-list.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.6.7",
"nanoid": "^5.0.6",
"request": "^2.88.2"
}
}

520
node/pnpm-lock.yaml generated Normal file
View File

@@ -0,0 +1,520 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
axios:
specifier: ^1.6.7
version: 1.12.0
nanoid:
specifier: ^5.0.6
version: 5.0.9
request:
specifier: ^2.88.2
version: 2.88.2
packages:
ajv@6.12.6:
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
asn1@0.2.6:
resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==}
assert-plus@1.0.0:
resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
engines: {node: '>=0.8'}
asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
aws-sign2@0.7.0:
resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==}
aws4@1.12.0:
resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==}
axios@1.12.0:
resolution: {integrity: sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==}
bcrypt-pbkdf@1.0.2:
resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}
call-bind-apply-helpers@1.0.2:
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
engines: {node: '>= 0.4'}
caseless@0.12.0:
resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
core-util-is@1.0.2:
resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
dashdash@1.14.1:
resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}
engines: {node: '>=0.10'}
delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dunder-proto@1.0.1:
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
engines: {node: '>= 0.4'}
ecc-jsbn@0.1.2:
resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==}
es-define-property@1.0.1:
resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
engines: {node: '>= 0.4'}
es-errors@1.3.0:
resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
engines: {node: '>= 0.4'}
es-object-atoms@1.1.1:
resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
engines: {node: '>= 0.4'}
es-set-tostringtag@2.1.0:
resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
engines: {node: '>= 0.4'}
extend@3.0.2:
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
extsprintf@1.3.0:
resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==}
engines: {'0': node >=0.6.0}
fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
fast-json-stable-stringify@2.1.0:
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
follow-redirects@1.15.11:
resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
forever-agent@0.6.1:
resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==}
form-data@2.3.3:
resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==}
engines: {node: '>= 0.12'}
form-data@4.0.4:
resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==}
engines: {node: '>= 6'}
function-bind@1.1.2:
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
get-intrinsic@1.3.0:
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
engines: {node: '>= 0.4'}
get-proto@1.0.1:
resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
engines: {node: '>= 0.4'}
getpass@0.1.7:
resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==}
gopd@1.2.0:
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
engines: {node: '>= 0.4'}
har-schema@2.0.0:
resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==}
engines: {node: '>=4'}
har-validator@5.1.5:
resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==}
engines: {node: '>=6'}
deprecated: this library is no longer supported
has-symbols@1.1.0:
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
engines: {node: '>= 0.4'}
has-tostringtag@1.0.2:
resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
engines: {node: '>= 0.4'}
hasown@2.0.2:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
http-signature@1.2.0:
resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}
engines: {node: '>=0.8', npm: '>=1.3.7'}
is-typedarray@1.0.0:
resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==}
isstream@0.1.2:
resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}
jsbn@0.1.1:
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
json-schema-traverse@0.4.1:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
json-schema@0.4.0:
resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
json-stringify-safe@5.0.1:
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
jsprim@1.4.2:
resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==}
engines: {node: '>=0.6.0'}
math-intrinsics@1.1.0:
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
engines: {node: '>= 0.4'}
mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
nanoid@5.0.9:
resolution: {integrity: sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==}
engines: {node: ^18 || >=20}
hasBin: true
oauth-sign@0.9.0:
resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==}
performance-now@2.1.0:
resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
psl@1.9.0:
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
punycode@2.3.1:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
qs@6.5.3:
resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==}
engines: {node: '>=0.6'}
request@2.88.2:
resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==}
engines: {node: '>= 6'}
deprecated: request has been deprecated, see https://github.com/request/request/issues/3142
safe-buffer@5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
sshpk@1.18.0:
resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==}
engines: {node: '>=0.10.0'}
hasBin: true
tough-cookie@2.5.0:
resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==}
engines: {node: '>=0.8'}
tunnel-agent@0.6.0:
resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
tweetnacl@0.14.5:
resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}
uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
uuid@3.4.0:
resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}
deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
hasBin: true
verror@1.10.0:
resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==}
engines: {'0': node >=0.6.0}
snapshots:
ajv@6.12.6:
dependencies:
fast-deep-equal: 3.1.3
fast-json-stable-stringify: 2.1.0
json-schema-traverse: 0.4.1
uri-js: 4.4.1
asn1@0.2.6:
dependencies:
safer-buffer: 2.1.2
assert-plus@1.0.0: {}
asynckit@0.4.0: {}
aws-sign2@0.7.0: {}
aws4@1.12.0: {}
axios@1.12.0:
dependencies:
follow-redirects: 1.15.11
form-data: 4.0.4
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
bcrypt-pbkdf@1.0.2:
dependencies:
tweetnacl: 0.14.5
call-bind-apply-helpers@1.0.2:
dependencies:
es-errors: 1.3.0
function-bind: 1.1.2
caseless@0.12.0: {}
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
core-util-is@1.0.2: {}
dashdash@1.14.1:
dependencies:
assert-plus: 1.0.0
delayed-stream@1.0.0: {}
dunder-proto@1.0.1:
dependencies:
call-bind-apply-helpers: 1.0.2
es-errors: 1.3.0
gopd: 1.2.0
ecc-jsbn@0.1.2:
dependencies:
jsbn: 0.1.1
safer-buffer: 2.1.2
es-define-property@1.0.1: {}
es-errors@1.3.0: {}
es-object-atoms@1.1.1:
dependencies:
es-errors: 1.3.0
es-set-tostringtag@2.1.0:
dependencies:
es-errors: 1.3.0
get-intrinsic: 1.3.0
has-tostringtag: 1.0.2
hasown: 2.0.2
extend@3.0.2: {}
extsprintf@1.3.0: {}
fast-deep-equal@3.1.3: {}
fast-json-stable-stringify@2.1.0: {}
follow-redirects@1.15.11: {}
forever-agent@0.6.1: {}
form-data@2.3.3:
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
form-data@4.0.4:
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
es-set-tostringtag: 2.1.0
hasown: 2.0.2
mime-types: 2.1.35
function-bind@1.1.2: {}
get-intrinsic@1.3.0:
dependencies:
call-bind-apply-helpers: 1.0.2
es-define-property: 1.0.1
es-errors: 1.3.0
es-object-atoms: 1.1.1
function-bind: 1.1.2
get-proto: 1.0.1
gopd: 1.2.0
has-symbols: 1.1.0
hasown: 2.0.2
math-intrinsics: 1.1.0
get-proto@1.0.1:
dependencies:
dunder-proto: 1.0.1
es-object-atoms: 1.1.1
getpass@0.1.7:
dependencies:
assert-plus: 1.0.0
gopd@1.2.0: {}
har-schema@2.0.0: {}
har-validator@5.1.5:
dependencies:
ajv: 6.12.6
har-schema: 2.0.0
has-symbols@1.1.0: {}
has-tostringtag@1.0.2:
dependencies:
has-symbols: 1.1.0
hasown@2.0.2:
dependencies:
function-bind: 1.1.2
http-signature@1.2.0:
dependencies:
assert-plus: 1.0.0
jsprim: 1.4.2
sshpk: 1.18.0
is-typedarray@1.0.0: {}
isstream@0.1.2: {}
jsbn@0.1.1: {}
json-schema-traverse@0.4.1: {}
json-schema@0.4.0: {}
json-stringify-safe@5.0.1: {}
jsprim@1.4.2:
dependencies:
assert-plus: 1.0.0
extsprintf: 1.3.0
json-schema: 0.4.0
verror: 1.10.0
math-intrinsics@1.1.0: {}
mime-db@1.52.0: {}
mime-types@2.1.35:
dependencies:
mime-db: 1.52.0
nanoid@5.0.9: {}
oauth-sign@0.9.0: {}
performance-now@2.1.0: {}
proxy-from-env@1.1.0: {}
psl@1.9.0: {}
punycode@2.3.1: {}
qs@6.5.3: {}
request@2.88.2:
dependencies:
aws-sign2: 0.7.0
aws4: 1.12.0
caseless: 0.12.0
combined-stream: 1.0.8
extend: 3.0.2
forever-agent: 0.6.1
form-data: 2.3.3
har-validator: 5.1.5
http-signature: 1.2.0
is-typedarray: 1.0.0
isstream: 0.1.2
json-stringify-safe: 5.0.1
mime-types: 2.1.35
oauth-sign: 0.9.0
performance-now: 2.1.0
qs: 6.5.3
safe-buffer: 5.2.1
tough-cookie: 2.5.0
tunnel-agent: 0.6.0
uuid: 3.4.0
safe-buffer@5.2.1: {}
safer-buffer@2.1.2: {}
sshpk@1.18.0:
dependencies:
asn1: 0.2.6
assert-plus: 1.0.0
bcrypt-pbkdf: 1.0.2
dashdash: 1.14.1
ecc-jsbn: 0.1.2
getpass: 0.1.7
jsbn: 0.1.1
safer-buffer: 2.1.2
tweetnacl: 0.14.5
tough-cookie@2.5.0:
dependencies:
psl: 1.9.0
punycode: 2.3.1
tunnel-agent@0.6.0:
dependencies:
safe-buffer: 5.2.1
tweetnacl@0.14.5: {}
uri-js@4.4.1:
dependencies:
punycode: 2.3.1
uuid@3.4.0: {}
verror@1.10.0:
dependencies:
assert-plus: 1.0.0
core-util-is: 1.0.2
extsprintf: 1.3.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
import fs from 'fs'
import request from 'request'
import { nanoid } from 'nanoid'
let fileName = './data/user-SUNMENG333.json'
let saveFileStr = fs.readFileSync(fileName, 'utf8')
let inputData = JSON.parse(saveFileStr)
let saveFilePath = './imgs/'
const downloadImage = async (src, dest) => {
console.log('下载:', src)
return new Promise((resolve) => {
request.head(src, (err) => {
if (err) {
console.log(err)
return
}
src &&
request(src)
.pipe(fs.createWriteStream(dest))
.on('close', () => {
setTimeout(() => resolve(true), 1500)
})
})
})
}
async function test3(list) {
let url = list.pop()
if (url.includes('http')) {
let name = nanoid() + '.png'
await downloadImage(url, saveFilePath + name)
return [name]
}
return [url]
// fs.writeFileSync(fileName, JSON.stringify(inputData, null, 2));
}
inputData = inputData.slice(0, 70)
console.log(inputData.length)
for (let i = 0; i < inputData.length; i++) {
let v = inputData[i]
console.log(`处理:第${i}个视频:`, v.desc)
if (v.video?.play_addr?.url_list) {
v.video.play_addr.url_list = [v.video.play_addr.url_list.pop()]
}
try {
if (v.video?.cover?.url_list) {
v.video.cover.url_list = await test3(v.video?.cover?.url_list)
}
if (v.video?.animated_cover) {
delete v.video.animated_cover
}
fs.writeFileSync(fileName, JSON.stringify(inputData, null, 2))
} catch (e) {
console.log('出错了', e)
}
}

84
node/post/process-post.js Normal file
View File

@@ -0,0 +1,84 @@
import fs from 'fs'
let fileName = './post/user-81069823274.json'
const str = fs.readFileSync('./input.json', 'utf8')
let inputData = JSON.parse(str)
const saveFileStr = fs.readFileSync(fileName, 'utf8')
let saveFileData = JSON.parse(saveFileStr)
// console.log('list', inputData.has_more)
// console.log('f', fs)
inputData.aweme_list.map((v) => {
Object.keys(v).map((k) => {
if (
![
'aweme_id',
'desc',
'create_time',
'music',
'video',
'share_url',
'statistics',
'status',
'text_extra',
'is_top',
'share_info',
'duration',
'image_infos',
'risk_infos',
'position',
'author_user_id',
'prevent_download',
'long_video',
'aweme_control',
'images',
'suggest_words',
].includes(k)
) {
delete v[k]
}
})
Object.keys(v.music).map((k) => {
if (
![
'id',
'title',
'author',
'cover_medium',
'cover_thumb',
'play_url',
'duration',
'user_count',
'owner_id',
'owner_nickname',
'is_original',
].includes(k)
) {
delete v.music[k]
}
})
Object.keys(v.video).map((k) => {
if (
![
'play_addr',
'cover',
'height',
'width',
'ratio',
'use_static_cover',
'duration',
'horizontal_type',
'animated_cover',
].includes(k)
) {
delete v.video[k]
}
})
})
saveFileData = saveFileData.concat(inputData.aweme_list)
fs.writeFileSync('./ouput.json', JSON.stringify(inputData.aweme_list, null, 2))
fs.writeFileSync(fileName, JSON.stringify(saveFileData, null, 2))

47
node/process-post-list.js Normal file
View File

@@ -0,0 +1,47 @@
import fs from 'fs'
import { users } from './user/data.js'
let read = './post/data/'
let max = 0
let map = []
//判断是不是目录
const dirs = fs.readdirSync(read)
dirs.forEach((dictName) => {
formatDict(read, dictName)
})
function formatDict(dir, name) {
let filePath = dir + name
let saveFileStr = fs.readFileSync(filePath, 'utf8')
let inputData = JSON.parse(saveFileStr)
map.push({
userId: name,
list: inputData,
})
if (max < inputData.length) max = inputData.length
}
let newList = []
// max = 5
for (let i = 0; i < max; i++) {
map.map((v) => {
if (v.list.length > i) {
let data = v.list[i]
newList.push(data)
}
})
}
// console.log(newList)
let data = newList.slice(0, 6)
data.map((v) => {
let u = users.find((a) => a.uid == v.author_user_id)
if (u) {
v.author = u
}
})
fs.writeFileSync('./posts6.json', JSON.stringify(data, null, 2))
fs.writeFileSync('./posts.json', JSON.stringify(newList.slice(6), null, 2))

33
node/remove-dist-json.js Normal file
View File

@@ -0,0 +1,33 @@
import fs from 'fs'
import path from 'path'
let read = 'dist/data'
function deleteFile(url, name) {
var files = []
if (fs.existsSync(url)) {
//判断给定的路径是否存在
files = fs.readdirSync(url) //返回文件和子目录的数组
files.forEach(function (file) {
var curPath = path.join(url, file)
if (fs.statSync(curPath).isDirectory()) {
//同步读取文件夹文件,如果是文件夹,则函数回调
deleteFile(curPath, name)
} else {
if (file.indexOf(name) > -1) {
//是指定文件,则删除
fs.unlinkSync(curPath)
console.log('删除文件:' + curPath)
}
}
})
} else {
console.log('给定的路径不存在!')
}
}
deleteFile(read, '.json')

14
node/rename.js Normal file
View File

@@ -0,0 +1,14 @@
import fs from 'fs'
let read = './xhs/imgs/'
let save = './xhs/imgs2/'
const dirs = fs.readdirSync(read)
dirs.forEach((dictName) => {
formatDict(read, dictName)
})
function formatDict(dir, name) {
let filePath = dir + name
fs.copyFile(filePath, save + name.replace('.jpg', '.png'), () => {})
}

1750
node/user/data.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
import fs from 'fs'
import request from 'request'
import { nanoid } from 'nanoid'
let fileName = './user.json'
let saveFileStr = fs.readFileSync(fileName, 'utf8')
let inputData = JSON.parse(saveFileStr)
const downloadImage = async (src, dest, callback) => {
console.log('下载:', src, dest, Date.now())
return new Promise((resolve) => {
request.head(src, (err) => {
if (err) {
console.log(err)
return
}
src &&
request(src)
.pipe(fs.createWriteStream(dest))
.on('close', () => {
setTimeout(resolve, 1000)
callback && callback(null, dest)
})
})
})
}
let saveFilePath = './user-imgs/'
async function test(list) {
for (let j = 0; j < list.length; j++) {
let a = list[j]
let coverUrl = a.url_list[a.url_list.length - 1]
a.url_list = [coverUrl]
if (coverUrl.includes('http')) {
let name = nanoid() + '.png'
await downloadImage(coverUrl, saveFilePath + name, () => {
// console.log('close', name)
a.url_list = [name]
fs.writeFileSync(fileName, JSON.stringify(inputData, null, 2))
})
}
}
}
async function test2(list) {
for (let j = 0; j < list.length; j++) {
let coverUrl = list[list.length - 1]
if (coverUrl.includes('http')) {
let name = nanoid() + '.png'
await downloadImage(coverUrl, saveFilePath + name, () => {
// console.log('close', name)
fs.writeFileSync(fileName, JSON.stringify(inputData, null, 2))
})
return [name]
}
return []
}
}
for (let i = 0; i < inputData.slice(0, 1111).length; i++) {
let v = inputData[i]
await test(v.cover_url)
await test(v.white_cover_url)
delete v.cover_and_head_image_info
fs.writeFileSync(fileName, JSON.stringify(inputData, null, 2))
if (v.share_info && v.share_info.share_image_url && v.share_info.share_image_url.url_list) {
let r = await test2(v.share_info.share_image_url.url_list)
if (r.length) {
v.share_info.share_image_url.url_list = r
fs.writeFileSync(fileName, JSON.stringify(inputData, null, 2))
}
}
}

64
node/user/process-user.js Normal file
View File

@@ -0,0 +1,64 @@
import fs from 'fs'
let fileName = './data.json'
let saveFileStr = fs.readFileSync(fileName, 'utf8')
let inputData = JSON.parse(saveFileStr)
inputData.map((v) => {
Object.keys(v).map((k) => {
if (
![
'avatar_168x168',
'avatar_300x300',
'aweme_count',
'birthday_hide_level',
'can_show_group_card',
'commerce_user_level',
'province',
'city',
'country',
'district',
'favoriting_count',
'follow_status',
'follower_count',
'follower_request_status',
'follower_status',
'following_count',
'forward_count',
'public_collects_count',
'share_info',
'mplatform_followers_count',
'nickname',
'max_follower_count',
'gender',
'cover_colour',
'cover_url',
'commerce_info',
'commerce_user_info',
'short_id',
'signature',
'total_favorited',
'uid',
'unique_id',
'user_age',
'white_cover_url',
'card_entries',
'cover_and_head_image_info',
'ip_location',
].includes(k)
) {
delete v[k]
}
})
})
// saveFileData = saveFileData.concat(inputData.aweme_list)
// fs.writeFileSync(
// "./ouput.json",
// JSON.stringify(inputData.aweme_list, null, 2)
// );
fs.writeFileSync(
// fileName,
'./data.json',
JSON.stringify(inputData, null, 2),
)

1698
node/user/user.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,92 @@
import fs from 'fs'
import request from 'request'
import { nanoid } from 'nanoid'
let fileName = './xhs.json'
let savefileName = './xhs-save.json'
let saveFileStr = fs.readFileSync(fileName, 'utf8')
let inputData = JSON.parse(saveFileStr)
const downloadImage = async (src, dest, callback) => {
console.log('下载:', src, dest, Date.now())
return new Promise((resolve) => {
request.head(src, (err) => {
if (err) {
console.log(err)
return
}
src &&
request(src)
.pipe(fs.createWriteStream(dest))
.on('close', () => {
setTimeout(resolve, 1500)
callback && callback(null, dest)
})
})
})
}
let saveFilePath = './imgs/'
let imgList = []
async function test(list) {
for (let j = 0; j < list.length; j++) {
let a = list[j]
let coverUrl = a.info_list[0].url
let rIndex = imgList.findIndex((v) => v.url === coverUrl)
if (rIndex === -1) {
if (coverUrl.includes('http')) {
let name = nanoid() + '.png'
imgList.push({
name,
url: coverUrl
})
await downloadImage(coverUrl, saveFilePath + name, () => {
// console.log('close', name)
list[j] = {
info_list: [
{
url: name
}
]
}
fs.writeFileSync(savefileName, JSON.stringify(inputData, null, 2))
})
}
} else {
list[j] = {
info_list: [
{
url: imgList[rIndex].name
}
]
}
console.log('重复')
fs.writeFileSync(savefileName, JSON.stringify(inputData, null, 2))
}
}
}
for (let i = 0; i < inputData.slice(0, 111111).length; i++) {
let v = inputData[i]
if (v.note_card?.cover) {
let url = v.note_card?.cover?.url_default
let name = nanoid() + '.png'
imgList.push({
name,
url: url
})
await downloadImage(url, saveFilePath + name, () => {
// console.log('close', name)
v.note_card.cover = { url_default: name }
fs.writeFileSync(savefileName, JSON.stringify(inputData, null, 2))
})
}
if (v.note_card?.image_list) {
await test(v.note_card.image_list)
}
}

3105
node/xhs/xhs-save.json Normal file

File diff suppressed because it is too large Load Diff

4976
node/xhs/xhs.json Normal file

File diff suppressed because it is too large Load Diff