An IRC XDCC download bot written in python with aiohttp and irc.py.
- join channels (auto-join on connect, with
also_joincascades) - send messages to channels or users
- NickServ authentication
- random nickname generation
- TLS/SSL server connections (with optional certificate verification bypass)
- DCC file transfer support (SEND / RESUME / SSEND)
- SSL DCC (SSEND) support
- passive DCC (incoming connections) with configurable listen IP and port range
- MIME type filtering for received files
- file size limits
- private IP filtering for DCC transfers
- transfer cancellation via API
- auto-disconnect from idle servers and channels
- MD5 verification of completed transfers
- incomplete file suffix support (auto-renamed on completion)
The bot can be configured by creating a config.json file in the current working
directory. The configuration file should contain a json object with the following
keys:
servers: a dictionary of servers the bot can connect to, keyed by server address. Each server is an object with the following keys:nick: the nickname to use when connecting to the server, default: dccbotnickserv_password: the password to use when connecting to the server, optionaluse_tls: a boolean indicating whether to use tls when connecting to the serververify_ssl: a boolean indicating whether to verify the server ssl certificaterandom_nick: a boolean indicating whether to use a random nickname when connecting to the serverport: the port to connect to, default: 6667channels: a list of channels to join when connecting to the server, optionalalso_join: a dictionary of channels to join if the specific channel is joinedrewrite_to_ssend: a list of channels to rewrite xdcc send to ssend for users in this channels
default_server_config: same asservers, used if the server connected to is not inserversdefault_download_path: the directory where the bot should download filesallowed_mimetypes: a list of mimetypes the bot should allow to be sent over dccmax_file_size: the maximum size of a file to be sent over dccchannel_idle_timeout: the number of seconds a channel can be idle before the bot will part the channelserver_idle_timeout: the number of seconds a server can be idle before the bot will disconnect from the serverresume_timeout: the number of seconds to wait for a resume response from the bot before aborting the transfertransfer_list_timeout: the number of seconds after a finished/aborted transfer is removed from the transfer list in /info responseauto_md5sum: a boolean indicating to verify the md5sum of the file if the bot sends the md5sum as message on start of transfer or after successful transferincomplete_suffix: a string that is appended to the filename while downloading. If file was transferred successfully this suffix is removed.ssend_map: a dictionary of users which support ssend (secure send).xdcc sendcommand is replaced withxdcc ssendfor these users. This tells the XDCC bot to use TLS-wrapped DCC (SDCC).rewrite_to_ssend: a list of channels wherexdcc sendis rewritten toxdcc ssend.allow_private_ips: a boolean indicating whether to allow private ips in dcc send commandpassive_dcc: A boolean indicating whether to accept passive DCC transfers (where the peer sendsport=0and a token, and the bot listens for an incoming connection). This option can also be set per-server.passive_dcc_listen_ip: The reachable IP address to bind and advertise the passive DCC listener on. If omitted, it defaults to the hostname's IP.0.0.0.0is treated as unset. This option can also be set per-server.passive_dcc_port_range: A list of two integers[min_port, max_port]defining the port range to try binding the listener to. If omitted, the OS assigns a port. This option can also be set per-server.passive_dcc_timeout: The number of seconds to wait for the peer to connect to the passive listener before aborting (default: 60). This option can also be set per-server.dcc_ssl_cert: Optional path to a PEM certificate file for SDCC (SSEND). If provided,dcc_ssl_keymust also be set.dcc_ssl_key: Optional path to the PEM private key fordcc_ssl_cert. If either is omitted, a self-signed certificate is generated and cached in~/.local/share/dccbot/.http: a dictionary with the following keys:socket: the path to the socket to use for the http server (instead of host and port)port: the port to bind the http server to, default: 8080host: the host to bind the http server to, default: localhost- legacy keys
bind_addrandbind_portare still accepted for compatibility
The bot can be controlled using a simple web interface. The web interface is
available at http://localhost:8080/ by default.
POST /join: join a channelPOST /part: part a channelPOST /msg: send a message to a channel or userPOST /cancel: cancel a running transferPOST /shutdown: shutdown the botGET /info: get information about the current status of the bot (networks, current transfers, finished transfers)GET /ws: WebSocket endpoint for live transfer updates and log streamingGET /swagger: interactive OpenAPI/Swagger UI documentationGET /static/: static web assets (unified web UI)
/: unified web UI with current transfers, live log output, and websocket command input.
In the browser command input, use:
/helpto show all websocket commands and signatures/help <command>to show usage and an example for a single command
Supported websocket commands:
/help [command]/join <server> <channel> [<channel> ...]/part <server> <channel> [<channel> ...]/msg <server> <target> <message>/msgjoin <server> <channel> <target> <message>/info
A Violentmonkey userscript is provided to add download buttons to popular XDCC search websites, making it easy to send download commands directly to your DCCBot.
- XDCC.eu
- NIBL
- xdcc.rocks
- xdcc.animk.info
- xdcc-search.com
- xdcc.info
- sunxdcc.com
- Install the Violentmonkey extension for your browser (open source and available for Chrome, Firefox, and other Chromium-based browsers)
- Click the following link to install the script: Install Script
- After installation, click on the Violentmonkey extension icon
- Open the installed
add-dccbot-btnscript's menu and choose "Set API Endpoint" - Enter your DCCBot API endpoint (e.g.,
http://localhost:8080)
- On supported sites (XDCC.eu, NIBL, xdcc.info, etc.), you'll see a "Down" button next to each search result
- Click the button to automatically send the download command to your DCCBot
- For NIBL, you can also select multiple items and use the "Download selected" button to batch download
-
One-click downloads from supported websites
-
Batch download support on NIBL
-
Customizable API endpoint
-
Lightweight and fast
The repository includes a full local development and testing setup:
- Makefile targets:
make test,make test-integration,make irc-up,make irc-down,make validate(format + lint + complexity + security + type-check + vulture) - Docker Compose:
docker compose up -d ircdstarts a local InspIRCd test server for integration tests - Dependabot: configured for pip (weekly) and GitHub Actions (monthly)

