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

  1. Open the model download URL in a browser to verify what's actually being served.
  2. If the host requires auth (e.g. Hugging Face), generate an access token and configure it in the download service.
  3. Find an alternative/mirror URL for the same model that doesn't require authentication.
  4. Download the model manually in a browser and place it in the expected local models folder.
  5. 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

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


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/55085b6e170ffafa. Report an issue: GitHub.