Documentation Index
Fetch the complete documentation index at: https://mintlify.com/avikekk/JackettSearchBot/llms.txt
Use this file to discover all available pages before exploring further.
Configuration File
JackettSearchBot uses aconfig.env file for all configuration. Create it from the provided template:
config.env with your actual values.
Configuration Overview
The bot configuration is loaded fromconfig.env on startup and validated by the BotConfig class in jackett_bot/config.py. Missing required values will cause the bot to exit with a clear error message.
Environment Variables
Telegram Bot Configuration
These variables configure the Telegram bot connection:Your Telegram bot token from @BotFather.Example:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyzHow to obtain:- Message @BotFather on Telegram
- Send
/newbotand follow the instructions - Copy the token provided
Your Telegram API ID from my.telegram.org.Example:
123456How to obtain:- Go to my.telegram.org
- Log in with your phone number
- Navigate to “API development tools”
- Create an application if you haven’t already
- Copy the
api_idvalue
Your Telegram API hash from my.telegram.org.Example:
abcdef1234567890abcdef1234567890How to obtain: Same process as API_ID above, copy the api_hash value.Jackett Configuration
These variables connect the bot to your Jackett instance:Your Jackett API key for authentication.Example:
abcdefghijklmnopqrstuvwxyz123456How to obtain:- Open your Jackett web interface
- The API key is displayed at the top of the dashboard
- Click the copy icon to copy it
The base URL where your Jackett instance is running.Example:
http://localhost:9117Notes:- Include the protocol (
http://orhttps://) - Do not include a trailing slash
- If Jackett is on another machine, use that machine’s IP or hostname
- Ensure the bot can reach this URL from its host
Authorization
Control who can use the bot:Comma-separated list of Telegram chat IDs that are permanently authorized to use the bot.Example:
123456789,987654321,555555555Notes:- Optional - can be left empty
- These IDs are loaded on startup and persist across restarts
- Chat IDs can be for individual users or group chats
- To find your chat ID, use bots like @userinfobot
- The owner (OWNER_ID) is always authorized regardless of this list
config.py:111-121The Telegram user ID of the bot owner. This user has full access and can manage authorizations.Example:
123456789Notes:- Must be a valid Telegram user ID (positive integer)
- The owner can use
/authand/unauthcommands - The owner has access even if not in AUTHORIZED_CHAT_IDS
- To find your user ID, use bots like @userinfobot
Bot Behavior
Customize how the bot behaves:Maximum number of results to display per page in search results.Example:
10Notes:- Must be a positive integer
- Higher values show more results per page but create longer messages
- Recommended range: 5-20
- Used in pagination for the
/releasecommand
Number of seconds before search results are automatically redacted (hidden).Example:
300 (5 minutes)Notes:- Must be at least 1
- Helps keep sensitive search results from staying visible indefinitely
- Set to a higher value if you want results to stay visible longer
- After redaction, the message content is replaced with a notice
config.py:86-90Logging
Configure logging behavior:Path where log files are written.Example:
logs/jackett_bot.logNotes:- Can be relative or absolute path
- Parent directories are created automatically if they don’t exist
- Uses rotating file handler (10MB per file, 5 backup files)
- Total log storage: up to 60MB (6 files × 10MB)
Log level for console (stdout) output.Example:
INFOValid values: DEBUG, INFO, WARNING, ERROR, CRITICALNotes:- Case-insensitive
INFOis recommended for productionDEBUGshows very detailed information, useful for troubleshootingWARNINGor higher reduces console noise
Log level for file output.Example:
DEBUGValid values: DEBUG, INFO, WARNING, ERROR, CRITICALNotes:- Case-insensitive
DEBUGis recommended for file logs to aid in troubleshooting- File logs include more context (filename, line number, function name)
- Does not impact performance significantly due to async I/O
app.py:143-146Complete Example Configuration
Here’s a completeconfig.env file with all variables:
Configuration Validation
The bot validates all configuration on startup using theBotConfig class. If any issues are found, the bot will exit with a clear error message.
Validation Rules
Fromconfig.py:53-60:
TELEGRAM_TOKENAPI_IDAPI_HASHJACKETT_API_KEYJACKETT_URLOWNER_ID
Error Handling
Frommain.py:4-9, configuration errors are caught on startup:
Security Best Practices
- Never commit secrets - Keep
config.envout of version control - Restrict file permissions - Set
config.envto be readable only by the bot user - Rotate credentials immediately if they are ever exposed
- Use HTTPS for Jackett when possible, especially over public networks
- Limit authorized users - Only add trusted chat IDs to AUTHORIZED_CHAT_IDS
- Monitor logs - Regularly check logs for suspicious activity
- Keep dependencies updated - Run
uv syncperiodically to get security updates
Testing Configuration
After configuring, test that the bot can start successfully:Troubleshooting
Missing Required Variables
If you see an error like:config.env with valid values (not empty or placeholder text).
Invalid Integer Values
If you see:API_ID, OWNER_ID, and MAX_RESULTS contain only numbers.
Invalid Log Level
If you see:Next Steps
Once configured, you’re ready to:- Run the Bot - Start and manage your bot
- Learn Commands - Understand available bot commands