Skip to main content
Nicotine+ allows you to share folders with different permission levels. The share scanner indexes your files and makes them searchable on the Soulseek network.

Share Permission Levels

Nicotine+ supports three permission levels for shared folders:
1

Public Shares

Accessible by all users on the network.
2

Buddy Shares

Only accessible to users on your buddy list.
3

Trusted Shares

Only accessible to trusted buddies (marked as trusted in buddy list).
Each share is a tuple: (virtual_name, folder_path)The virtual name is what other users see. The folder path is the actual location on your system.

Adding Shared Folders

Via Configuration File

Manually edit the config file:
After modifying shares in the config file, you must rescan for changes to take effect.

Share Naming Rules

  • Cannot contain forward slashes (/)
  • Cannot contain backslashes (\)
  • Leading/trailing spaces and quotes are stripped
  • Empty names default to “Shared”
  • Duplicate names are automatically numbered: Music, Music1, Music2
  • Cannot share the same folder path twice
  • Cannot use the same virtual name twice
  • Duplicates are automatically skipped during scanning
Paths are normalized using os.path.normpath():

Share Scanning

Automatic Scanning

Daily rescanning runs at the specified hour (e.g., rescan_shares_hour = 3 runs at 3:00 AM).

Manual Scanning

Via Command Line:
From Python:
Rescan:
  • Updates modified files
  • Adds new files
  • Removes deleted files
  • Preserves unchanged file metadata
  • Faster
Rebuild:
  • Deletes all share databases
  • Rescans everything from scratch
  • Re-extracts all file metadata
  • Slower but fixes corrupted databases

Scan Process

1

Initialization

Scanner process launches and loads existing share databases (if available).
2

Directory Traversal

Each shared folder is recursively scanned:
  • Hidden files/folders are skipped (Windows)
  • Filtered files/folders are skipped
  • File metadata is extracted
3

Metadata Extraction

For audio files:
  • Duration
  • Bitrate (VBR detection)
  • Sample rate
  • Bit depth
Uses TinyTag library for metadata parsing.
4

Database Creation

Creates multiple database files:
  • publicfiles.dbn - Public file index
  • publicstreams.dbn - Compressed folder contents
  • words.dbn - Search word index
  • Similar files for buddy and trusted shares
5

Completion

Emits shares-ready event and displays folder count:

Share Filters

Exclude Files and Folders

Prevent specific files or folders from being shared:
Filters use wildcard patterns:
  • * matches any characters
  • Trailing \ indicates a folder filter
  • Filters are case-insensitive

Filter Examples

Share Databases

Database Files

Shares are stored in custom .dbn database files:
Do not manually edit .dbn files. They are binary databases managed by Nicotine+.

Database Format

Custom key-value format optimized for shares:
  • Signature: DBN+
  • Version: 3
  • Protocol: Pickle (v5)
  • Security: RestrictedUnpickler (prevents code execution)
If databases become corrupted:
  1. Automatic recovery: Nicotine+ detects corruption and rescans
  2. Manual recovery: Delete .dbn files and rescan:
  3. Version mismatch: Upgrading Nicotine+ may require database rebuild

Database Operations

File Metadata

Supported Audio Formats

Extracted Metadata

For each audio file:
Metadata extraction is skipped for files smaller than 128 bytes (assumed empty/invalid).

File Types

See shares.py FileTypes class for complete list.

Share Visibility

Reveal Buddy/Trusted Shares

Control whether buddy/trusted shares count towards public share statistics:
Enabling these options makes your buddy/trusted share counts visible to all users, potentially revealing private collection size.

User Permission Checking

Nicotine+ determines access based on:
1

Ban Check

User is banned → deny access
2

Buddy Check

User is trusted buddy → grant trusted accessUser is buddy → grant buddy access
3

Geo-Block Check

If enabled, check user’s country code:
4

Default Access

Grant public access

Share Management

Add Share Programmatically

Remove Share

Backslash Handling

Soulseek uses backslashes (\) as path separators. This conflicts with Unix systems where backslashes are valid filename characters.

Backslash Sentinel

Nicotine+ substitutes backslashes in filenames:
This happens automatically and transparently.

Troubleshooting

Shares Not Visible

Ensure scanning completed successfully:
If 0 folders, check:
  • Folder paths exist and are readable
  • No permission errors in logs
  • Filters aren’t excluding everything
After connecting to server, verify share count:
Windows hidden files/folders are automatically excluded:
Unhide folders to share them:

Slow Scanning

Scanning is CPU and I/O intensive:
  • 10,000 files: ~1-2 minutes
  • 100,000 files: ~10-20 minutes
  • 1,000,000 files: ~2-3 hours
Progress is shown during scanning.
Scanning network drives is significantly slower:
  • Use local drives when possible
  • Consider selective sharing
  • Mount network drives locally for better performance

Database Errors

Nicotine+ automatically rebuilds shares when database version changes.
Corrupted database. Delete and rescan:
Check logs for specific errors:
  • Permission denied on folders
  • Invalid characters in paths
  • Filesystem errors
Delete databases and retry:

Best Practices

Organize Your Shares:
  • Use descriptive virtual names
  • Group similar content
  • Separate public/private content using permission levels
  • Use filters to exclude system files
Optimize Scanning:
  • Enable daily rescanning during off-hours
  • Use rescanonstartup = False for very large collections
  • Manually rescan after adding significant content
  • Don’t share folders with millions of tiny files
Protect Privacy:
  • Use buddy/trusted shares for private content
  • Review share filters to exclude personal files
  • Disable reveal_buddy_shares and reveal_trusted_shares
  • Check shared content before rescanning