stripping source identifier for IG

This commit is contained in:
2026-07-18 13:54:04 +02:00
parent 568555eab8
commit d3f8c87317

View File

@@ -336,7 +336,16 @@ export default router => {
}
}
const url = inputUrl.trim();
let url = inputUrl.trim();
try {
const parsed = new URL(url);
if (parsed.searchParams.has('igsh')) {
parsed.searchParams.delete('igsh');
url = parsed.toString();
}
} catch (e) {
// Ignore malformed URL, keep original string
}
const ytRegex = /(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\/?\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})/i;
const ytMatch = url.match(ytRegex);