Skip to content

nzbgetcom/Extension-RemoveSamples

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RemoveSamples - NZBGet Extension

Tests Prospector Manifest Check

Modern NZBGet extension for intelligent sample file detection and removal. Automatically cleans sample files and directories before Sonarr/Radarr/Lidarr/Prowlarr processing.

πŸ”„ Replaces the legacy DeleteSamples.py script with modern extension format and advanced detection algorithms.

πŸš€ Quick Start

πŸ“– Complete Documentation | πŸš€ Installation Guide | βš™οΈ Configuration Reference

✨ Key Features

  • 🎯 Smart Detection: Advanced pattern matching with word boundary detection
  • πŸ“ Directory Cleanup: Removes entire sample directories (samples/, SAMPLE/)
  • 🎬 Video Support: Configurable size thresholds for different quality levels
  • 🎡 Audio Support: Separate detection logic for audio samples
  • βš™οΈ Modern Interface: GUI dropdown configuration (no file editing!)
  • 🐳 Docker Ready: Works with all popular NZBGet Docker containers
  • πŸ”§ Flexible: Independent control over file and directory removal
  • πŸ›‘οΈ Enterprise-Grade: Automated security scanning and dependency monitoring

πŸ†š Why Choose RemoveSamples?

vs DeleteSamples.py (Legacy Script)

Feature DeleteSamples.py RemoveSamples
Configuration ❌ Manual file editing βœ… Modern dropdown interface
Directory Removal ❌ Files only βœ… Files AND directories
Extension Format ❌ Legacy script βœ… Modern NZBGet extension
Pattern Detection ❌ Basic substring βœ… Advanced pattern matching
Audio Support ❌ Limited βœ… Full configurable support
Maintenance ❌ Abandoned (6+ years) βœ… Active development

See detailed comparison β†’

πŸ“¦ Installation

Method 1: Extension Manager (Recommended)

  1. Open NZBGet web interface
  2. Go to Settings β†’ Extension Manager
  3. Find "RemoveSamples" in the list
  4. Click Install

Method 2: Manual Installation

# Download and extract to NZBGet scripts directory
mkdir -p /path/to/nzbget/scripts/RemoveSamples/
# Copy main.py and manifest.json
chmod 755 main.py && chmod 644 manifest.json

Method 3: Docker/Unraid

# For Unraid NZBGet containers
cd /mnt/user/appdata/nzbget/scripts/
mkdir -p RemoveSamples
# Download files and set permissions for nobody:users

πŸ“– Detailed installation instructions for all platforms β†’

βš™οΈ Configuration

Basic Settings (Dropdown Interface)

Remove Directories: Yes    # Delete sample directories
Remove Files: Yes          # Delete sample files  
Debug: No                  # Enable for troubleshooting

Advanced Thresholds

Video Size Threshold: 150 MB    # 720p: 50MB, 1080p: 100MB, 4K: 300MB+
Audio Size Threshold: 2 MB      # ~30 seconds of 320kbps MP3

Recommended Settings by Use Case

Conservative (New Users)

Video: 300 MB | Audio: 5 MB | Debug: Yes

Balanced (Most Users)

Video: 150 MB | Audio: 2 MB | Debug: No

Aggressive (High Volume)

Video: 50 MB | Audio: 1 MB | Debug: No

πŸ“– Complete configuration guide β†’

πŸ”„ Workflow Integration

Recommended Script Order

1. PasswordDetector (if used)
2. FakeDetector (if used)
3. RemoveSamples ← Place here
4. Clean (if used)
5. Other scripts

Media Manager Integration

  • Sonarr: Cleaner TV episode imports, no sample episodes
  • Radarr: No trailer/sample files in movie folders
  • Lidarr: No 30-second preview tracks in albums
  • Prowlarr: Consistent cleanup across all content types

πŸ“– Complete workflow integration guide β†’

πŸ“Š Sample Detection Examples

βœ… Will Be Removed

Movie.Name.2023.sample.mkv      # Pattern + size match
sample.mp4                      # Clear sample file
preview_sample.avi              # Sample pattern
samples/                        # Sample directory
Small.video.under.150MB.mkv     # Size-based detection

❌ Will Be Preserved

Movie.Name.2023.1080p.mkv       # Normal size, no pattern
soundtrack.mp3                  # No sample pattern
behind-the-scenes.mp4           # Above size threshold
Movie.Title.SAMPLE.2023.mkv     # If "SAMPLE" in original title

πŸ” Detection Logic

Pattern Matching

  • Word boundary detection: \bsample\b prevents false positives
  • Multiple separators: .sample., _sample., -sample.
  • Directory patterns: Comprehensive sample directory detection

Size-Based Detection

  • Separate thresholds for video/audio files
  • Configurable extensions for each media type
  • Smart combination of pattern and size detection

πŸ“– Complete detection logic documentation β†’

🐳 Docker & Container Support

Fully compatible with popular Docker containers:

  • βœ… linuxserver/nzbget (Recommended)
  • βœ… nzbget/nzbget (Official)
  • βœ… Unraid Community Applications NZBGet
  • βœ… Custom Docker Compose setups

Container-specific installation guides available in documentation.

🚨 Troubleshooting

Quick Diagnostics

# Enable debug mode
Settings β†’ Extension Manager β†’ RemoveSamples β†’ Debug: Yes

# Check logs
Settings β†’ Logging β†’ Messages

# Verify installation
ls -la /path/to/scripts/RemoveSamples/
# Should show: main.py (executable) and manifest.json

Common Issues

  • Extension not appearing: Check file permissions and restart NZBGet
  • Files not removed: Verify thresholds and enable debug mode
  • Docker permissions: Use container-appropriate user/group

πŸ“– Complete troubleshooting guide β†’

πŸ“ž Support & Documentation

πŸ›‘οΈ Security & Quality

RemoveSamples is built with enterprise-grade practices:

  • Automated security scanning with CodeQL
  • Dependency vulnerability monitoring with Dependabot
  • Comprehensive test coverage with automated CI/CD
  • Professional code review workflow

πŸ† Official Recognition

πŸŽ‰ RemoveSamples is now officially available in the NZBGet Extension Manager!

RemoveSamples has been accepted by the NZBGet team and is available for one-click installation through the official Extension Manager.

πŸ“‹ Requirements

  • NZBGet: Version 14.0 or later (21.0+ recommended)
  • Python: 3.8+ installed on your system
  • Permissions: Execute permission on main.py

πŸ”§ Development

Running Tests

python -m unittest tests.py -v

Code Quality Checks

pip install prospector
prospector main.py

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes with tests
  4. Ensure all tests pass: python -m unittest tests.py -v
  5. Submit a pull request

πŸ“– Development documentation β†’

πŸ“„ License

GNU General Public License v2.0 - see LICENSE file for details.

πŸ“ˆ Changelog

v1.0.1 - Official Release

  • βœ… Official NZBGet adoption - Available in Extension Manager
  • βœ… Modern NZBGet extension format with manifest.json
  • βœ… GUI dropdown configuration interface
  • βœ… Advanced pattern matching with word boundaries
  • βœ… Comprehensive sample detection (files + directories)
  • βœ… Configurable video/audio size thresholds
  • βœ… Full test coverage with automated CI/CD
  • βœ… Docker and Unraid compatibility
  • βœ… Enterprise-grade security practices
  • βœ… Complete documentation wiki

Ready to get started? β†’ Installation Guide
Need help? β†’ FAQ | Troubleshooting

About

NZBGet extension to remove sample files and directories

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%