Automatic movie scrobbling for Simkl
Project description
🎬 Simkl Scrobbler
A powerful Windows-based automatic scrobbler for Simkl that seamlessly tracks your movie watching progress across multiple media players. Zero configuration required - it just works!
📋 Table of Contents
- Quick Start
- Features
- Supported Media Players
- Installation
- Usage
- Advanced Configuration
- How It Works
- Testing
- Troubleshooting
- License
- Acknowledgments
- Contributing
- Roadmap
⚡ Quick Start
# Install with pip (standard)
pip install simkl-scrobbler
# Or install with pipx (isolates dependencies)
# pipx install simkl-scrobbler
# Initialize the tracker
simkl-scrobbler init
# Start tracking your movies
simkl-scrobbler start
🚀 Features
- Zero Configuration - Works with most Windows media players out of the box
- Smart Detection - Intelligent movie recognition using guessit library
- Background Operation - Runs silently in the background without a GUI
- Progress Tracking - Monitors viewing progress across sessions
- Automatic Scrobbling - Marks movies as watched after 80% completion
- Offline Support - Maintains sync backlog when offline
- Resource Efficient - Minimal CPU and memory footprint
- Runtime Detection - Uses actual movie runtime from Simkl API
- Multi-Window Monitoring - Can detect and track movies even in non-active windows
- Enhanced Position Tracking - Monitors actual player position for better completion detection
- Comprehensive Logging - Detailed playback events for debugging and analysis
🎥 Supported Media Players
The following media players are supported on Windows:
| Media Player | Support Status | Position Detection |
|---|---|---|
| VLC Media Player | ✅ Fully Supported | ✅ (with web interface) |
| MPC-HC/BE | ✅ Fully Supported | ✅ (with web interface) |
| Windows Media Player | ✅ Fully Supported | ⚠️ Title only |
| MPV Player | ✅ Fully Supported | ⚠️ Title only |
| PotPlayer | ✅ Fully Supported | ⚠️ Title only |
| SMPlayer | ✅ Fully Supported | ⚠️ Title only |
| KMPlayer | ✅ Fully Supported | ⚠️ Title only |
| GOM Player | ✅ Fully Supported | ⚠️ Title only |
The scrobbler monitors the window titles of these players to detect media files currently being played. For VLC and MPC-HC/BE with web interfaces enabled, it can also get precise playback position information.
📥 Installation
Standard Installation (Recommended)
-
Ensure you have Python 3.7 or higher installed, and
pipis available. Check by runningpython --versionandpip --version. -
Install using pip:
pip install simkl-scrobbler
This will make the
simkl-scrobblercommand available globally. -
Initialize SIMKL Scrobbler:
simkl-scrobbler initFollow the prompts to authorize the application with your Simkl account using the PIN method.
-
Start tracking:
simkl-scrobbler start
Installation with pipx (Alternative)
pipx installs packages into isolated environments.
-
Install pipx:
python -m pip install --user pipx python -m pipx ensurepath
(Restart your terminal after running
ensurepath) -
Install SIMKL Scrobbler with pipx:
pipx install simkl-scrobbler
-
Initialize and start as above.
Installing as a Windows Service (Optional)
To have SIMKL Scrobbler start automatically with Windows:
simkl-scrobbler install-service
Follow the on-screen instructions.
Development Installation (Using Poetry)
If you want to contribute or run from the source code:
-
Ensure Python 3.7+ and Poetry are installed.
-
Clone the repository:
git clone https://github.com/kavinthangavel/simkl-scrobbler.git cd simkl-scrobbler
-
Install dependencies using Poetry:
poetry install --with dev
This installs the main package and development dependencies (like
pytest,flake8). -
Run commands using
poetry run:poetry run simkl-scrobbler init poetry run simkl-scrobbler start # To run tests (see Testing section) poetry run python tests/master_test.py --test-mode
🎮 Usage
The tracker runs silently in the background, automatically detecting and tracking movie playback in supported media players. Basic commands:
# Initialize the tracker (first-time setup)
simkl-scrobbler init
# Start tracking in the foreground
simkl-scrobbler start
# Install as a Windows service
simkl-scrobbler install-service
# Show help
simkl-scrobbler --help
Monitoring and Logs
# Monitor log file
type simkl_scrobbler.log
# Check detailed playback events
type simkl_scrobbler\playback_log.jsonl
⚙️ Advanced Configuration
Key settings in media_tracker.py:
DEFAULT_POLL_INTERVAL = 10 # Player check interval (seconds)
COMPLETION_THRESHOLD = 80 # Mark as watched threshold (percent)
VIDEO_PLAYER_EXECUTABLES = ['vlc.exe', 'mpc-hc64.exe', ...] # Supported players
Player Web Interface Setup (for position tracking)
For enhanced position tracking with VLC and MPC-HC/BE:
VLC Media Player:
- Go to Tools > Preferences
- Select "All" settings mode (bottom left)
- Navigate to Interface > Main interfaces
- Check "Web" option
MPC-HC/BE:
- Go to View > Options > Player > Web Interface
- Check "Listen on port:" (default 13579)
🔍 How It Works
graph LR
A[Monitor Windows] --> B[Detect Player]
B --> C[Extract Filename]
C --> D[Parse with guessit]
D --> E[Match Movie]
E --> F[Track Progress]
F --> G{>80% Complete?}
G -->|Yes| H[Mark Watched]
G -->|No| F
- Window Detection: Uses Windows API to monitor active and non-active windows for supported media players
- Title Extraction: Parses window title for filename/movie info
- Smart Parsing: Uses guessit library to intelligently extract movie title and year
- Movie Matching: Queries Simkl API to identify the movie
- Progress Tracking: Monitors playback position directly from player (when available) or estimates based on time
- Auto-marking: Updates Simkl when 80% threshold reached
- Offline Handling: Queues failed updates in backlog for future retry
🧪 Testing
SIMKL Scrobbler includes a comprehensive test suite to ensure reliability and functionality:
# Ensure development dependencies are installed (poetry install --with dev)
# Run the full test suite with mock API responses
poetry run python tests/master_test.py --test-mode
# Run specific test categories
poetry run python tests/master_test.py --test-mode --skip-api-errors --skip-offline
# Run tests with a real video file
poetry run python tests/master_test.py --test-mode --test-real-playback --video-file "path/to/movie.mp4"
# Get test help and options
poetry run python tests/master_test.py --help
Test Suite Features:
- Interactive Visual Output: Modern colorized terminal display with progress bars and structured results
- API Integration Tests: Verifies Simkl API interactions work correctly
- Error Handling Tests: Ensures graceful handling of API and network failures
- Offline Mode Testing: Validates offline tracking and backlog sync capabilities
- Movie Completion Tests: Confirms proper threshold detection and marking behavior
- Cache and Parsing Tests: Validates movie title extraction from window titles
- Media Player Interface Tests: Verifies connectivity with player web interfaces
- Real Playback Tests: End-to-end testing with actual media player launch
- Comprehensive Results: Summary of all tests with timing and detailed error reporting
- Export to JSON: Test results saved to
test_results.jsonfor analysis
Test Command Options:
| Option | Description |
|---|---|
--test-mode |
Run with mock API responses (no actual API calls) |
--movie-title TITLE |
Test with specific movie title |
--video-file PATH |
Path to video file for real playback testing |
--test-real-playback |
Run real playback test with media player |
--skip-api |
Skip API integration tests |
--skip-api-errors |
Skip API error handling tests |
--skip-offline |
Skip offline tracking tests |
--skip-completion |
Skip movie completion tests |
--skip-cache |
Skip cache functionality tests |
--skip-title-parsing |
Skip title parsing tests |
--verbose |
Show more detailed test information |
--show-version |
Show test suite version and exit |
The master test suite automatically discovers and configures media players installed on your system, and sets up their web interfaces for enhanced position tracking when available.
🔧 Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
| Movie not detected | Ensure media player shows filename in window title |
| No auto-marking | Check simkl_scrobbler.log for API errors |
| Incorrect movie | Include year in filename: "Movie (2023).mp4" |
| Player not detected | Verify player is in supported list |
| Windows permission error | Run as administrator |
| Movie title parsing failed | Use standard naming: "Movie.Name.2023.mp4" |
| Position tracking not working | Enable web interface in VLC or MPC-HC/BE |
| Test fails to connect to MPC-HC | Restart MPC-HC after enabling web interface settings |
| Test output has encoding issues | Make sure terminal supports UTF-8 encoding |
Logs and Debugging
# Check main application log
type simkl_scrobbler.log
# Check detailed playback events
type simkl_scrobbler\playback_log.jsonl
# Run tests with verbose output
python tests/master_test.py --test-mode --verbose
Diagnostic Commands
If you're having issues, these commands can help diagnose problems:
# Check Python version
python --version
# Verify installed dependencies (using Poetry)
poetry show
# Check network connectivity to Simkl API
# (Using PowerShell's Invoke-WebRequest as curl might not be available)
Invoke-WebRequest -Uri https://api.simkl.com/ -Method Head
# List running media player processes
tasklist | findstr "vlc mpc wmplayer"
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👏 Acknowledgments
- Simkl for their excellent API
- iamkroot's Trakt Scrobbler for inspiration
- guessit for powerful video filename parsing
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
📝 Roadmap
- Add Linux support
- Add macOS support
- Create native Windows installer
- Add real-time position tracking for supported players
- Implement multi-window monitoring
- Create automated playback tests
- Enhance test suite with visual output and comprehensive coverage
- Add support for more media players
- Create GUI configuration tool
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simkl_scrobbler-1.0.0.tar.gz.
File metadata
- Download URL: simkl_scrobbler-1.0.0.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0657f5776f91313a7e2d0a192cfc65322232214f1520c3420a2ae73d3d37ab0d
|
|
| MD5 |
6210e47812a4170471ccd6b5509b5ed3
|
|
| BLAKE2b-256 |
62f8c784ad4390d4d9f2da4b30df37b46a8d5d2af45decb99b8fba2b5336f150
|
Provenance
The following attestation bundles were made for simkl_scrobbler-1.0.0.tar.gz:
Publisher:
publish.yml on kavinthangavel/simkl-scrobbler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simkl_scrobbler-1.0.0.tar.gz -
Subject digest:
0657f5776f91313a7e2d0a192cfc65322232214f1520c3420a2ae73d3d37ab0d - Sigstore transparency entry: 199675242
- Sigstore integration time:
-
Permalink:
kavinthangavel/simkl-scrobbler@0a172f26276eeb1ad641a13efa068d370f391b91 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/kavinthangavel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a172f26276eeb1ad641a13efa068d370f391b91 -
Trigger Event:
push
-
Statement type:
File details
Details for the file simkl_scrobbler-1.0.0-py3-none-any.whl.
File metadata
- Download URL: simkl_scrobbler-1.0.0-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e7b8e18db3045fccd4c50bec99e6122f189a571ea74fc0fb6c54d9ca3793724
|
|
| MD5 |
2823bd8509abb55e15e4ed06e710ac06
|
|
| BLAKE2b-256 |
a73803033161c9412ecbbfa213b3f45e551ca8055394706d5b7f6a21bc40fca3
|
Provenance
The following attestation bundles were made for simkl_scrobbler-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on kavinthangavel/simkl-scrobbler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simkl_scrobbler-1.0.0-py3-none-any.whl -
Subject digest:
4e7b8e18db3045fccd4c50bec99e6122f189a571ea74fc0fb6c54d9ca3793724 - Sigstore transparency entry: 199675243
- Sigstore integration time:
-
Permalink:
kavinthangavel/simkl-scrobbler@0a172f26276eeb1ad641a13efa068d370f391b91 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/kavinthangavel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a172f26276eeb1ad641a13efa068d370f391b91 -
Trigger Event:
push
-
Statement type: