Skip to content

A Python automation tool that monitors multiple sources for new SHiFT codes for Borderlands 4, automatically attempts to redeem them, and sends notifications for updates and results.

License

klept0/SHiFT-Code-Watcher

Repository files navigation

SHiFT-Code-Watcher

Version 1.0

Python CI License: MIT

A Python automation tool that monitors multiple sources for new SHiFT codes for Borderlands 4, automatically attempts to redeem them, and sends notifications for updates and results.

Disclaimer: I'm not affiliated with Gearbox Software at all - just a passionate fan who built this so I don't miss SHiFT code drops while trying to adult responsibly. Because who has time to manually check websites when you could be automating your loot addiction?

⚠️ Security Notice

This tool requires storing SHiFT login credentials and session cookies. Use at your own risk and ensure you understand the security implications. The tool is provided "as is" without any warranties.

Security Features:

  • Optional cookie encryption using Fernet symmetric encryption
  • Secure key derivation using PBKDF2 with 100,000 iterations
  • Environment variable-based configuration for sensitive data

Features

  • Scrapes multiple official and community sources for SHiFT codes.
  • Monitors Reddit RSS feed for real-time SHiFT code discovery (every 3-5 minutes).
  • Handles login and session management with Playwright for manual cookie refresh.
  • Rate-limited automation to mimic human-like code redemption timing.
  • Sends notifications using Apprise (supports Telegram, etc.).
  • Real-time console updates with colored status output and progress bar.
  • Modular, extensible Python codebase.

Requirements

  • Python 3.10+ (tested with Python 3.13)
  • Playwright (with installed browsers)
  • Requests, Colorama, tqdm, python-dotenv, apprise, cryptography Python packages

Installation

Clone this repository:

git clone https://github.com/klept0/SHiFT-Code-Watcher.git
cd SHiFT-Code-Watcher

Create a Python virtual environment (recommended):

python -m venv venv
source venv/bin/activate  # Linux/macOS
venv\Scripts\activate     # Windows

Install dependencies:

pip install -r requirements.txt

Install Playwright browsers:

playwright install

Copy .env.example to .env and update your APPRISE_URL for notifications:

cp .env.example .env
# Then edit .env to add your Apprise URL

Usage

Run the watcher script to start monitoring and redeeming codes:

python shift_watcher.py

For verbose output with detailed logging and browser inspection (useful for debugging):

python shift_watcher.py --verbose

For Reddit RSS monitoring mode (checks Reddit every 3-5 minutes for new SHiFT codes):

python shift_watcher.py --reddit

Combine with verbose mode for detailed Reddit monitoring output:

python shift_watcher.py --reddit --verbose

The script runs continuously, checking for new codes every hour by default (or every 3-5 minutes in Reddit mode), and provides live progress updates.

Note: The script will automatically check for required dependencies on startup and provide helpful error messages if any modules are missing.

Configuration

  • Modify SCAN_INTERVAL in config.py to change how often the script runs.
  • Add or remove URLs in the SOURCES list in config.py to customize code sources.
  • Store login session cookies securely; the script uses Playwright to refresh cookies when needed.
  • Configure Apprise notification endpoints via the .env file.
  • Optionally set the SHIFT_PLATFORM environment variable (xbox, playstation, steam, etc.) to auto-select a platform when redemption offers multiple choices.

Troubleshooting

Common Issues

  • Login fails: Ensure your SHiFT account credentials are correct and cookies are fresh
  • No codes found: Check your internet connection and verify the sources are accessible
  • Playwright errors: Run playwright install to ensure browsers are installed
  • Rate limiting: The tool includes built-in delays; avoid running multiple instances

Getting Help

  • Check the console output for detailed error messages
  • Verify your .env file contains the correct APPRISE_URL
  • Ensure all dependencies are installed: pip install -r requirements.txt

Contributing

Contributions are welcome! Please:

  • Fork the repository.
  • Create feature branches.
  • Submit pull requests with clear descriptions.
  • Follow the existing code style and modular structure.

Support

If you find this tool helpful and want to support its development, consider buying me a coffee! ☕

ko-fi

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Python automation tool that monitors multiple sources for new SHiFT codes for Borderlands 4, automatically attempts to redeem them, and sends notifications for updates and results.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages