api: support new xiaohongshu links, add fallbacks to getRedirectingURL
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run service tests / test service functionality (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run

closes #1394
Co-authored-by: wukko <me@wukko.me>
This commit is contained in:
KwiatekMiki
2025-07-12 15:10:08 +02:00
committed by wukko
parent b9042a94e9
commit 3f785e7cbe
6 changed files with 33 additions and 17 deletions

View File

@@ -6,13 +6,13 @@ const https = (url) => {
return url.replace(/^http:/i, 'https:');
}
export default async function ({ id, token, shareId, h265, isAudioOnly, dispatcher }) {
export default async function ({ id, token, shareType, shareId, h265, isAudioOnly, dispatcher }) {
let noteId = id;
let xsecToken = token;
if (!noteId) {
const patternMatch = await resolveRedirectingURL(
`https://xhslink.com/a/${shareId}`,
`https://xhslink.com/${shareType}/${shareId}`,
dispatcher
);