A free, self-hosted alternative to premium debrid services like Real-Debrid, AllDebrid, and Premiumize.
Stream torrents and direct downloads (1fichier, MediaFire, etc.) through Kodi without paying monthly fees. Everything runs locally using free services.
This project was thinked to use with Palantir 3, but its known that works with other similar plugins.
After returning to this project, I noticed that the account connection flow was incomplete. Existing API keys from previous installations continue to work, but new accounts could not be paired correctly.
Self-Debrid now includes a complete local pairing workflow: Kodi displays a short code, you approve it in the Self-Debrid page, and the addon receives its API key automatically. No manual API-key copy and paste is required.
I've noticed that this repository is getting a few stars; there are some known issues that I think I can fix easily. One of the most important ones is the need to restart the API to refresh the JDownloader session. If I have time, I'll fix a few bugs and improve the project!
- π§² Torrent support via qBittorrent - Download and stream torrents
- π₯ Direct downloads via JDownloader - Support for 1fichier, MediaFire, Uptobox, and 100+ hosters
- π¬ Live streaming - Start watching while downloading (no waiting for completion)
- πΎ Smart caching - Reuses downloaded files automatically
- π No duplicate downloads - Intelligent file tracking by unique ID
- π HTTPS API - Drop-in replacement for AllDebrid/Real-Debrid addons in Kodi
- π° 100% Free - Uses only free services (no premium accounts needed)
- Python 3.10+ - Download
- qBittorrent - Download (for torrents)
- JDownloader 2 - Download (for direct downloads - highly recommended)
This project is intended to use with Kodi and specific specific plugin that almost always uses 1fichier, this hoster in the free tier has a very slow download and high timeout, using JDownloader, the speed of the download is incredible (100MB/s) and the cooldown between downloads are shorts (5 to 10 minutes), this is more than enough to stream a movie or TV episode.
# Clone the repository
git clone https://github.com/an0mal1a/self-debrid.git
cd self-debrid
# Install Python packages
python3 -m .venv venv
source .venv/bin/activate # LINUX
.venv/Scripts/Activate.ps1 # WINDOWS
pip install -r requirements.txt- Install and open qBittorrent
- Go to Tools β Options β User Interface
- Enable "Web Interface"
- Set username:
admin - Set password:
adminadmin(or your choice) - Port:
8080(default)
- Create a free account at my.jdownloader.org
- Install JDownloader 2
- Open JDownloader β Settings β My.JDownloader
- Log in with your account
- Note your device name (e.g., "JDownloader@yourusername")
Self-Debrid uses HTTPS to be compatible with Kodi streaming addon.
# Create cert directory
mkdir cert
# Generate self-signed certificate (valid for 1 year)
openssl req -x509 -newkey rsa:4096 -nodes -out cert/cert.pem -keyout cert/key.pem -days 365When prompted, you can press Enter for all fields or fill them as you like.
Copy the example configuration:
cp .env.example .envEdit .env with your settings.
python main.pyYou should see:
============================================================
π SELF-DEBRID
============================================================
π‘ API: https://0.0.0.0:443
π¬ Stream: http://0.0.0.0:8081
πΎ Cache: <carpeta temporal del sistema>
π§ qBittorrent: β
Connected
π₯ JDownloader: β
Connected
============================================================
In order to allow the plugin Palantir on Kodi works with self-debrid we need to modify our hosts file
- Linux:
echo '127.0.0.1 api.alldebrid.com' | sudo tee -a /etc/hosts' - Windows
- Open this file as admin "C:\Windows\System32\drivers\etc\hosts"
- In a new line add the following text: 127.0.0.1 api.alldebrid.com
Palantir 3 supports AllDebrid and Real-Debrid. Self-Debrid uses the AllDebrid-compatible option.
- In Kodi, open Palantir 3 β Settings β Accounts.
- Enable and select AllDebrid.
- Start the account authorization process. Kodi will display a four-character code.
- On a browser that can access your Self-Debrid server, open
https://api.alldebrid.com/pin/. - Enter the code displayed in Kodi and select Authorize device.
- Once the confirmation page is shown, return to Kodi. The account is linked and Kodi saves the generated local API key automatically.
The code expires after 10 minutes. If the browser is on a different device, set PIN_BASE_URL to a reachable HTTPS address for this server before starting Self-Debrid. Kodi will display that address during pairing; its certificate must be trusted by the browser.
1. Kodi addon finds a 1fichier link
2. Sends to Self-Debrid API
3. Self-Debrid passes link to JDownloader
4. JDownloader starts downloading
5. Self-Debrid begins streaming immediately (as soon as 5MB downloaded)
6. You start watching while download continues in background
Free 1fichier & JDownloader Limitations:
- 1 download every 5-10 minutes
- This is perfect for streaming - by the time you finish one episode, the cooldown is over
- No speed limits (downloads at full speed)
1. Kodi addon finds a magnet/torrent
2. Sends to Self-Debrid API
3. Self-Debrid adds to qBittorrent
4. Downloads largest file (the video)
5. Streams to Kodi while downloading
Self-Debrid remembers downloaded files:
- Each file gets a unique ID (based on the 1fichier file ID or torrent hash)
- If you request the same file again, it streams from cache instantly
- Old files are automatically deleted when cache is full
If ports 443 or 8081 are in use (in case of using this with other plugin):
API_PORT=8443 # Use 8443 instead of 443
STREAM_PORT=8082 # Use 8082 instead of 8081Don't forget to update the API URL in Kodi!
MAX_CACHE_SIZE_GB=100 # Store up to 100GB of filesSelf-Debrid can serve multiple Kodi devices on your network simultaneously.
Problem: JDownloader hasn't started the download yet.
Solution:
- Wait 10-15 seconds and retry
- Check JDownloader is running and connected
- Verify MyJDownloader credentials in
.env
Problem: Self-Debrid can't reach qBittorrent.
Solution:
- Verify qBittorrent Web UI is enabled
- Check username/password in
.envmatch qBittorrent settings - Ensure port 8080 is correct
JDownloader Not Connected (MyJDownloader) (If you have dont use in the config this is not a problem)
Problem: Can't connect to remote JDownloader.
Solution:
- Verify email/password are correct
- Check device name matches exactly (case-sensitive)
- Make sure JDownloader is running and logged into MyJDownloader
- Try local mode: leave
JD_EMAILandJD_PASSWORDempty in.env
Problem: File in download queue but not starting.
Solution:
- 1fichier cooldown - wait 5-10 minutes
- Right-click download in JD β Force Download
- Some hosters may require premium (try another source)
- β 1fichier (most common)
- β MediaFire
- β Uptobox
- β Mega
- β RapidGator (free limits)
- β 100+ other hosters
- β All magnet links
- β .torrent files
- β Any public/private tracker
π₯οΈ Platform-Specific Notes
Windows
- Run Command Prompt or PowerShell as Administrator when editing hosts file
- Windows Defender may flag the SSL certificate generation - this is safe to allow
- Firewall may prompt for network access - allow for both private and public networks
macOS
- Use sudo when editing hosts file or installing system-wide packages
- macOS may require allowing the app in Security & Privacy settings
- OpenSSL is pre-installed on most macOS versions
Linux
- Most distributions include Python 3 by default
- OpenSSL is typically pre-installed
- Use your package manager to install qBittorrent: sudo apt install qbittorrent (Debian/Ubuntu)
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Improve documentation
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for personal use only.
- Only download content you have the right to access
- Respect copyright laws in your country
- The developers are not responsible for how you use this software
- Use of this software is at your own risk
- Inspired by the need for a free alternative to premium debrid services
- Thanks to the developers of qBittorrent and JDownloader
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Enjoy streaming without monthly fees! π