SubtitleEdit/subtitleedit · error · Exception
Unable to download file - Invalid username or password! (Per
Error message
Unable to download file - Invalid username or password! (Perhaps file has a new location)
What it means
Thrown when the downloaded content of a speech-to-text model file contains the string 'Invalid username or password.' This indicates the download URL redirected to a login page or returned an HTML error page instead of the binary model, typically from a host requiring authentication.
Source
Thrown at src/ui/Features/Video/SpeechToText/DownloadSpeechToTextModelsViewModel.cs:265
{
var text = FileUtil.ReadAllTextShared(downloadFileName, Encoding.UTF8);
if (text.StartsWith("Entry not found", StringComparison.OrdinalIgnoreCase))
{
try
{
File.Delete(downloadFileName);
}
catch
{
// ignore
}
return;
}
if (text.Contains("Invalid username or password."))
{
throw new Exception("Unable to download file - Invalid username or password! (Perhaps file has a new location)");
}
}
var newFileName = downloadFileName.Replace(TemporaryFileExtension, string.Empty);
if (File.Exists(newFileName))
{
File.Delete(newFileName);
}
File.Move(downloadFileName, newFileName);
_downloadFileName = string.Empty;
}
private void Close()
{
Dispatcher.UIThread.Post(() =>
{View on GitHub (pinned to 17a9f07487)
Solutions
- Open the model download URL in a browser to verify what's actually being served.
- If the host requires auth (e.g. Hugging Face), generate an access token and configure it in the download service.
- Find an alternative/mirror URL for the same model that doesn't require authentication.
- Download the model manually in a browser and place it in the expected local models folder.
- Check if the model has been relocated — search for the new download location.
Defensive patterns
Strategy: validation
Validate before calling
// Check the first bytes of the download to detect an HTML auth page
var firstBytes = new byte[512];
using var probeStream = new MemoryStream();
await httpClient.GetByteArrayAsync(url, ct).ContinueWith(t => { /* check content type */ });
// Or after download:
var preview = Encoding.ASCII.GetString(downloadBuffer, 0, Math.Min(512, downloadBuffer.Length));
if (preview.Contains("<html") || preview.Contains("Invalid username"))
throw new InvalidOperationException("Download URL returned an authentication page, not a model file."); Try / catch
try { await DownloadModel(url, path, ct); }
catch (Exception ex) when (ex.Message.Contains("Invalid username or password"))
{ /* prompt for credentials/token, find alternative URL, or manual download */ } Prevention
- Verify model download URLs are publicly accessible before queuing them.
- If using Hugging Face, ensure gated models have an accepted token configured.
- Provide manual download instructions as a fallback when automated download hits auth.
- Check the model host's URL scheme hasn't changed.
When it happens
Trigger: The model download URL points to a host (e.g. Hugging Face, GitHub release behind auth, or a private mirror) that requires login; the URL has moved and the old location returns an auth page; the download was intercepted by a captive portal or proxy auth page.
Common situations: The model URL was correct at time of coding but the host later added authentication; a Hugging Face gated model requiring token acceptance; a GitHub release that was made private; a corporate proxy returning its own login page; the model host changed its URL scheme.
Related errors
- DashScope upload-policy request failed ({(int)policyResponse
- Zonos TTS (CrispASR) model {fileName} failed integrity check
- Baidu API credentials not configured. Please set App ID and
- CrispASR MADLAD model not found - please use the 'Download'
- Forbidden! {resultContent}
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/55085b6e170ffafa.
Report an issue: GitHub.