diff --git a/pugongying/xhs-pgy-export.user.js b/pugongying/xhs-pgy-export.user.js index 58bdb36..8f491f8 100644 --- a/pugongying/xhs-pgy-export.user.js +++ b/pugongying/xhs-pgy-export.user.js @@ -243,10 +243,19 @@ return; } GM_xmlhttpRequest({ - method: "HEAD", + method: "GET", url, onload(res) { - resolve(res.finalUrl || url); + if (res.finalUrl && res.finalUrl !== url) { + resolve(res.finalUrl); + return; + } + const match = res.responseText && res.responseText.match(/href="([^"]+)"/); + if (match) { + resolve(match[1].replace(/&/g, "&")); + } else { + resolve(url); + } }, onerror() { resolve(url);