api/xiaohongshu: update initial state extraction regex

Co-authored-by: jj <log@riseup.net>
This commit is contained in:
wukko 2025-01-20 19:35:53 +06:00 committed by GitHub
parent de5eca19a5
commit 3cbed87c3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,7 +43,7 @@ export default async function ({ id, token, shareId, h265, isAudioOnly, dispatch
const initialState = html
.split('<script>window.__INITIAL_STATE__=')[1]
.split('</script>')[0]
.replace(/:undefined/g, ":null");
.replace(/:\s*undefined/g, ":null");
const data = JSON.parse(initialState);