fix(together): x.com 埋め込みURLのトラッキングパラメータを除去してJina取得精度改善
This commit is contained in:
parent
e0c2211e0d
commit
9f0bb8eae7
|
|
@ -2594,6 +2594,13 @@ ${excerpt}
|
|||
|
||||
// fire-and-forget アーカイブ: Jina Reader → Gemini 要約(直列)
|
||||
async function archiveShare(shareId, url) {
|
||||
// x.com / twitter.com のトラッキングパラメータを除去(埋め込みURLの ?ref_src=twsrc... 等)
|
||||
try {
|
||||
const u = new URL(url);
|
||||
if (/^(x\.com|twitter\.com)$/.test(u.hostname.replace('www.', ''))) {
|
||||
url = `${u.origin}${u.pathname}`;
|
||||
}
|
||||
} catch (_) {}
|
||||
if (!url || !isSsrfSafe(url)) {
|
||||
await pool.query(`UPDATE together_shares SET archive_status='failed' WHERE id=$1`, [shareId]);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue