Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -180,6 +180,30 @@ const Index = () => {
|
||||
className="hidden"
|
||||
onChange={handleFileUpload} />
|
||||
|
||||
/**
|
||||
* Normaliza URLs comuns para apontar ao binário direto:
|
||||
* - Dropbox: dl=0 → dl=1
|
||||
* - OneDrive 1drv.ms / onedrive.live.com: força ?download=1
|
||||
* - Google Drive: aviso (não funciona via CORS)
|
||||
*/
|
||||
function normalizeCloudUrl(input: string): string {
|
||||
try {
|
||||
const u = new URL(input);
|
||||
// Dropbox
|
||||
if (/(^|\.)dropbox\.com$/.test(u.hostname)) {
|
||||
u.searchParams.set('dl', '1');
|
||||
return u.toString();
|
||||
}
|
||||
// OneDrive
|
||||
if (/(^|\.)1drv\.ms$|onedrive\.live\.com$/.test(u.hostname)) {
|
||||
u.searchParams.set('download', '1');
|
||||
return u.toString();
|
||||
}
|
||||
return input;
|
||||
} catch {
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
{/* Logo area */}
|
||||
<div className="mb-12 text-center">
|
||||
|
||||
Reference in New Issue
Block a user