Skip to main content

Configuration File

MegaDownloader stores all settings in a local configuration file named config.txt located in the application’s root directory. This file is automatically created when you save settings through the Preferences panel.
The configuration file uses a simple key-value format with values enclosed in double quotes.

Configuration Format

The config.txt file uses the following format:
key:"value"
Each setting appears on a separate line with no spaces between the key, colon, and quoted value.

Available Configuration Keys

MegaDownloader supports the following configuration options:
Key: pathDescription: Specifies the absolute path to the yt-dlp executable.Required: YesExample:
path:"C:\Tools\yt-dlp\yt-dlp.exe"
The application cannot download videos without a valid yt-dlp path. You must configure this before your first download.
Key: downloadDirDescription: Sets the default directory where downloaded files will be saved.Required: No (defaults to project directory)Example:
downloadDir:"C:\Users\YourName\Downloads\Videos"
If not specified, files are saved in the same directory where the application is running.
Key: ffmpegPathDescription: Manual path to the FFmpeg directory (optional if FFmpeg is in the yt-dlp directory).Required: No (auto-detected if in yt-dlp directory)Example:
ffmpegPath:"C:\Tools\ffmpeg\bin"
This setting is only needed if FFmpeg is not in the same directory as yt-dlp. See the FFmpeg setup guide for more details.

Example Configuration

A complete config.txt file might look like this:
path:"C:\Tools\yt-dlp\yt-dlp.exe"
downloadDir:"C:\Users\YourName\Videos"
ffmpegPath:"C:\Tools\ffmpeg\bin"

Managing Settings via GUI

You can configure all settings through the Preferences panel without manually editing the config file.
1

Open Preferences

Navigate to Edit > Preferences from the menu bar.
2

Configure yt-dlp Path

Click Change location and select your yt-dlp.exe file.The current path will display as “Not configured” if no path has been set.
3

Set Download Directory (Optional)

Click Change Download directory to select where files should be saved.Default: “Default (where project is stored)”
4

Configure Additional Options

  • Create M3U for playlists: Enable to automatically generate playlist files
  • Download Speed: Set speed limits using the slider and toggle
5

Save Configuration

Click Save to write all settings to config.txt.
You must click Save for changes to take effect. Settings are not applied automatically.

Speed Limiter Configuration

The speed limiter is configured through the Preferences panel and is stored in memory (not persisted to config.txt).

Speed Limiter Controls

  • Range: 1 KB/s to 100,000 KB/s
  • Default: 1000 KB/s
  • Controls: Both slider and text field update synchronously
  • Toggle: Enable/disable the limiter with the “Limiter” button
The speed limiter uses yt-dlp’s --limit-rate parameter, specified in kilobytes per second (KB/s).

Configuration Persistence

How Settings Are Loaded

When the application starts, it reads config.txt from the working directory:
private void loadConfig() {
    File configFile = new File("config.txt");
    if (configFile.exists()) {
        // Read line by line
        // Parse each key:"value" pair
        // Update UI with loaded values
    }
}
From PreferencesPanel.java (lines 127-151)

How Settings Are Saved

When you click Save in Preferences, the application writes to config.txt:
private void btnSaveActionPerformed() {
    try (BufferedWriter writer = new BufferedWriter(new FileWriter("config.txt"))) {
        writer.write("path:\"" + path + "\"");
        writer.newLine();
        if (!downloadDirectoryPath.equals("Default (where project is stored)")) {
            writer.write("downloadDir:\"" + downloadDirectoryPath + "\"");
        }
    }
}
From PreferencesPanel.java (lines 345-369)

Validation

The application validates that you’ve selected a path before allowing you to save:
  • If the path shows “Not configured”, saving is blocked
  • A warning dialog appears: “Please select a yt-dlp location first”
When selecting the yt-dlp executable:
  • File chooser filters for .exe files
  • Accepts all files if needed
  • Only accepts files (not directories) for executables

Troubleshooting Configuration

Configuration Not Loading

Ensure config.txt is in the same directory where you run the application.
Common causes:
  • File is in the wrong directory
  • File encoding is incorrect (should be plain text)
  • Incorrect format (missing quotes or wrong syntax)

Settings Not Saving

Check for:
  • Write permissions in the application directory
  • Antivirus blocking file writes
  • File is not marked as read-only

Invalid Paths

Symptoms:
  • “yt-dlp path not configured” error on download
  • “FFmpeg not found” warning
Solutions:
  • Verify paths exist and are accessible
  • Use absolute paths (not relative paths)
  • Ensure proper escaping of backslashes in Windows paths

Next Steps

FFmpeg Setup

Learn about the hybrid FFmpeg detection system

Troubleshooting

Solve common configuration issues

Build docs developers (and LLMs) love