Skip to main content
The Preferences panel allows you to configure all application settings including paths, download behavior, and performance options.

Accessing Preferences

The Preferences panel is typically accessed through the application menu (Edit > Preferences) or from the main interface. The panel implements auto-loading of existing configuration on startup (PreferencesPanel.java:43-48):
public PreferencesPanel() {
    initComponents();
    loadConfig();
    setupEscapeKey();
    setupSpeedLimiter();
}

Configuration File

All preferences are stored in a local config.txt file in the application directory.

Config File Format

The configuration file uses a simple key-value format (PreferencesPanel.java:127-150):
path:"C:\\Tools\\yt-dlp.exe"
downloadDir:"C:\\Users\\YourName\\Downloads"
ffmpegPath:"C:\\Tools\\ffmpeg\\bin"
Each setting is on its own line with the format: key:"value"
The configuration file is automatically loaded when the Preferences panel initializes.

yt-dlp Location

The yt-dlp location setting specifies the path to the yt-dlp executable.

Setting yt-dlp Path

1

Click 'Change location'

Click the “Change location” button under the “yt-dlp location:” label (PreferencesPanel.java:196-201).
2

Select executable

A file chooser dialog opens filtered for executable files (PreferencesPanel.java:328-342):
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Select yt-dlp executable");
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
FileNameExtensionFilter filter = new FileNameExtensionFilter("Executable", "exe");
fileChooser.setFileFilter(filter);
3

Path displayed

The selected path is displayed in the label (lblYtdlpCurrentPath).Example: C:\\Tools\\yt-dlp.exe
4

Save configuration

Click the “Save” button to write the path to config.txt.

Current Path Display

The current yt-dlp path is displayed next to “yt-dlp location:” (PreferencesPanel.java:217):
  • Default: “Not configured”
  • After configuration: Full path to the executable
If yt-dlp is not configured, download attempts will fail with an error: “yt-dlp path not configured. Please go to Edit > Preferences to set the path.”

Download Directory

The download directory setting determines where media files are saved.

Configuring Download Directory

1

Click 'Change Download directory'

Click the “Change Download directory” button (PreferencesPanel.java:224-228).
2

Select folder

A directory chooser dialog opens (PreferencesPanel.java:372-384):
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Select download directory");
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
3

Path displayed

The selected path is displayed in lblDownloadDirectoryPath.Example: C:\\Users\\YourName\\Downloads
4

Save configuration

Click “Save” to persist the setting to config.txt.

Default Download Directory

If no download directory is configured (PreferencesPanel.java:222):
  • Label displays: “Default (where project is stored)”
  • Files download to the application’s working directory (user.dir)

Download Directory in config.txt

When saved, the download directory is written to config.txt (PreferencesPanel.java:360-362):
if (!downloadDirectoryPath.equals("Default (where project is stored)")) {
    writer.write("downloadDir:\"" + downloadDirectoryPath + "\"");
}
The default message is not written to the config file.

Speed Limiter Controls

The speed limiter allows you to cap download speeds to avoid saturating your network connection.

Speed Limiter Components

The speed limiter UI consists of three synchronized controls (PreferencesPanel.java:66-123):
  1. Text field (txtLimiter) - Displays current speed limit in “KB/s”
  2. Slider (sliderLimiter) - Visual control from 1 to 100,000 KB/s
  3. Toggle button (toggleLimiter) - Enables/disables the limiter

Enabling Speed Limiting

1

Click 'Limiter' toggle

Click the “Limiter” toggle button to enable speed limiting (PreferencesPanel.java:391-396).When enabled:
  • The slider becomes active
  • The text field becomes editable
  • limiterEnabled is set to true
2

Adjust speed limit

Set your desired speed limit using either:Slider: Drag the slider to set the limit visuallyText field: Type a number (e.g., “1000”) and it will automatically format to “1000 KB/s”
3

Limits apply on next download

The speed limit is applied when you start your next download.No need to save - the limiter settings are stored in memory.

Speed Limit Range

The speed limiter supports values from 1 KB/s to 100,000 KB/s (PreferencesPanel.java:71-73):
sliderLimiter.setMinimum(1);
sliderLimiter.setMaximum(100000);
sliderLimiter.setValue(1000);  // Default: 1000 KB/s

Slider and Text Field Synchronization

The slider and text field are kept in sync using listeners: Slider updates text (PreferencesPanel.java:79-87):
sliderLimiter.addChangeListener(new ChangeListener() {
    @Override
    public void stateChanged(ChangeEvent e) {
        if (!sliderLimiter.getValueIsAdjusting()) {
            speedLimitKBps = sliderLimiter.getValue();
            txtLimiter.setText(speedLimitKBps + " KB/s");
        }
    }
});
Text updates slider (PreferencesPanel.java:89-122):
txtLimiter.getDocument().addDocumentListener(new DocumentListener() {
    private void updateSliderFromText() {
        String text = txtLimiter.getText().trim();
        text = text.replaceAll("[^0-9]", "");  // Remove non-numeric chars
        
        int value = Integer.parseInt(text);
        value = Math.max(1, Math.min(100000, value));  // Clamp to range
        speedLimitKBps = value;
        
        if (sliderLimiter.getValue() != value) {
            sliderLimiter.setValue(value);
        }
    }
});
The text field automatically strips non-numeric characters, so you can type “1000 KB/s” or just “1000” and both will work.

Speed Limit Implementation

When enabled, the speed limit is passed to yt-dlp using the --limit-rate flag:
yt-dlp --limit-rate 1000K <url>
The MainPanel reads the limiter settings from PreferencesPanel (MainPanel.java:504-512):
final boolean limiterEnabled = preferencesPanel.isLimiterEnabled();
final int speedLimitKBps = preferencesPanel.getSpeedLimitKBps();

if (limiterEnabled) {
    command.add("--limit-rate");
    command.add(speedLimitKBps + "K");
}

M3U Playlist Settings

The M3U playlist option automatically creates .m3u playlist files for your downloads.

Enabling M3U Creation

1

Check 'Create m3u for playlists'

Check the “Create m3u for playlists” radio button (PreferencesPanel.java:235-240).
2

Setting takes effect immediately

The setting is stored in memory (PreferencesPanel.java:386-389):
createM3U = btnM3U.isSelected();
3

Playlists created on download

When enabled, a playlist.m3u file is automatically created in your download directory after each successful download.

M3U File Format

The generated M3U file follows the Extended M3U format (MainPanel.java:301-314):
#EXTM3U
Song 1.mp3
Song 2.mp3
Video.mp4
Files are listed relative to the playlist location.

Audio vs Video Filtering

M3U playlists are intelligently filtered based on download mode:
  • Audio-only downloads: Only includes .mp3, .m4a, .opus, .wav, .flac, .aac
  • Video downloads: Only includes .mp4, .webm, .mkv, .avi, .flv, .mov
M3U playlists are useful for:
  • Opening multiple files at once in media players like VLC
  • Creating auto-generated playlists from batch downloads
  • Organizing downloaded content

Saving Configuration

The “Save” button persists your yt-dlp path and download directory to config.txt (PreferencesPanel.java:345-369).

Save Process

1

Click Save button

Click the “Save” button in the bottom-right.
2

Validation

The application validates that yt-dlp path is configured (PreferencesPanel.java:350-353):
if (path.equals("Not configured")) {
    JOptionPane.showMessageDialog(this, 
        "Please select a yt-dlp location first", 
        "No Path Selected", 
        JOptionPane.WARNING_MESSAGE);
    return;
}
3

Write to config.txt

Settings are written to config.txt (PreferencesPanel.java:356-362):
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 + "\"");
    }
}
4

Success message

On success, you’ll see: “Configuration saved successfully!”
If you don’t click Save, your yt-dlp path and download directory changes will be lost when the application closes.

Settings That Don’t Require Saving

These settings are stored in memory and don’t need to be saved:
  • Speed limiter enabled/disabled
  • Speed limit value
  • M3U playlist creation
  • FFmpeg path (if manually configured in config.txt)

FFmpeg Path (Manual)

While not exposed in the UI, you can manually configure the FFmpeg path in config.txt (PreferencesPanel.java:141-145):
path:"C:\\Tools\\yt-dlp.exe"
downloadDir:"C:\\Users\\YourName\\Downloads"
ffmpegPath:"C:\\Tools\\ffmpeg\\bin"
The application will read this on startup and use it for audio extraction.
FFmpeg auto-detection is attempted first. The manual ffmpegPath setting is only used as a fallback.

Back Button

The “Back” button returns to the previous panel without saving changes (PreferencesPanel.java:319-324).

Keyboard Shortcuts

  • ESC - Go back to previous panel (PreferencesPanel.java:51-64)

Preferences API

Other panels can access preference values through public getter methods (PreferencesPanel.java:153-167):
public boolean isCreateM3UEnabled()    // M3U setting
public String getFfmpegPath()          // FFmpeg directory
public boolean isLimiterEnabled()      // Speed limiter on/off
public int getSpeedLimitKBps()         // Speed limit value
Example usage from MainPanel:
if (preferencesPanel != null) {
    limiterEnabled = preferencesPanel.isLimiterEnabled();
    speedLimitKBps = preferencesPanel.getSpeedLimitKBps();
}

Configuration Loading

Configuration is automatically loaded when the Preferences panel is created (PreferencesPanel.java:127-151):
private void loadConfig() {
    File configFile = new File("config.txt");
    if (configFile.exists()) {
        try (BufferedReader reader = new BufferedReader(new FileReader(configFile))) {
            String line;
            while ((line = reader.readLine()) != null) {
                if (line.startsWith("path:\"") && line.endsWith("\"")) {
                    String path = line.substring(6, line.length() - 1);
                    lblYtdlpCurrentPath.setText(path);
                } else if (line.startsWith("downloadDir:\"") && line.endsWith("\"")) {
                    String path = line.substring(13, line.length() - 1);
                    lblDownloadDirectoryPath.setText(path);
                } else if (line.startsWith("ffmpegPath:\"") && line.endsWith("\"")) {
                    String path = line.substring(12, line.length() - 1);
                    ffmpegPath = path;
                }
            }
        }
    }
}

Troubleshooting Configuration

Cause: Changes not saved before closing PreferencesSolution: Always click the Save button before leaving Preferences
Cause: yt-dlp path not set or config.txt not savedSolution:
  1. Open Preferences
  2. Click “Change location” and select yt-dlp.exe
  3. Click Save
  4. Verify config.txt exists in application directory
Cause: Limiter toggle is offSolution: Click the Limiter toggle button to enable it (it should appear pressed/selected)
Cause: FFmpeg not in yt-dlp directory and not manually configuredSolution:
  • Place ffmpeg.exe and ffprobe.exe in the same folder as yt-dlp
  • OR manually add ffmpegPath:"C:\\path\\to\\ffmpeg" to config.txt

Example Configuration

Here’s a complete example config.txt file:
path:"C:\\Tools\\yt-dlp.exe"
downloadDir:"D:\\Media\\Downloads"
ffmpegPath:"C:\\Tools\\ffmpeg\\bin"
This configuration:
  • Uses yt-dlp from C:\Tools\yt-dlp.exe
  • Downloads to D:\Media\Downloads
  • Uses FFmpeg from C:\Tools\ffmpeg\bin

Next Steps

Start Downloading

Configure your preferences and start downloading media

Audio Extraction

Learn about FFmpeg integration for audio extraction

Build docs developers (and LLMs) love