telegram bot usage - panuozzo77/StreamingCommunity GitHub Wiki
This document explains how to set up and use the Telegram bot integration with StreamingCommunity, allowing you to control and monitor downloads remotely from your Telegram app.
The StreamingCommunity Telegram bot provides a convenient way to search for and download content without needing direct access to the terminal. Each download runs within a screen session, enabling multiple downloads to run simultaneously.
Before using the Telegram bot, ensure you have:
- A Telegram account
- The StreamingCommunity application installed
- Screen utility installed on your system (for Linux/macOS)
First, you need to create a Telegram bot:
- Open Telegram and search for "BotFather"
- Start a chat with BotFather and send the command
/newbot
- Follow the prompts to create your bot
- Once created, BotFather will provide a token (keep this secure)
To restrict bot access to only yourself:
- Search for "userinfobot" on Telegram
- Start a chat with this bot
- It will reply with your user ID
Create a .env
file in the StreamingCommunity directory with the following content:
TOKEN_TELEGRAM=YourTelegramBotToken
AUTHORIZED_USER_ID=YourTelegramUserID
DEBUG=False
Replace YourTelegramBotToken
with the token provided by BotFather and YourTelegramUserID
with your Telegram user ID.
Edit your config.json
file to enable the Telegram bot:
{
"DEFAULT": {
"telegram_bot": true
}
}
Navigate to the StreamingCommunity/TelegramHelp directory and run:
python3 telegram_bot.py
For persistent operation, it's recommended to run the bot inside a screen session:
screen -S streamingbot
python3 telegram_bot.py
Press Ctrl + A
, followed by D
to detach from the screen session without stopping the bot.
Navigate to the StreamingCommunity\TelegramHelp directory and run:
python telegram_bot.py
For persistent operation on Windows, you might want to create a service or use a tool like NSSM (Non-Sucking Service Manager).
The bot supports the following commands:
-
/start
– Initiates a new search for content to download -
/list
– Displays the status of active downloads -
/stop <ID>
– Stops a download with the specified ID -
/screen <ID>
– Views the real-time output of a download with the specified ID
- Send
/start
to the bot - The bot will present a list of available streaming sites
- Select a site by sending its corresponding number
- Enter your search terms
- The bot will display search results
- Select content by sending its corresponding number
- Follow the prompts to select season, episode, and download options
- The download will start in a separate screen session
- Send
/list
to the bot - The bot will display all active downloads with their IDs
- To view the output of a specific download, send
/screen <ID>
- To stop a download, send
/stop <ID>
You: /start
Bot: Categorie:
anime | film_serie | film | serie | other
Inserisci il sito:
0: Altadefinizione
1: Animeunity
2: Animeworld
3: Streamingcommunity
You: 3
Bot: Inserisci i termini di ricerca:
You: stranger things
Bot: Risultati per "stranger things":
1. Stranger Things (2016)
2. Stranger Things: Stagione 4 (2022)
You: 1
Bot: Seleziona la stagione:
1. Stagione 1
2. Stagione 2
3. Stagione 3
4. Stagione 4
You: 1
Bot: Seleziona gli episodi (1-8) o "all" per tutti:
You: all
Bot: Download avviato con ID: 12345
Usa /screen 12345 per vedere l'output
Usa /stop 12345 per interrompere il download
You: /list
Bot: Download attivi:
ID: 12345 - Stranger Things S01 - In corso
You: /screen 12345
Bot: [Output del download in tempo reale]
You: /stop 12345
Bot: Download 12345 interrotto
The bot allows running multiple downloads simultaneously, each in its own screen session. Simply start a new download with /start
while others are running.
On Linux/macOS, you can manually check screen sessions:
screen -ls
To reattach to a screen session:
screen -r session_id
If a download is interrupted, incomplete files may remain in the folder specified in config.json
. These files must be deleted manually to avoid storage or management issues.
-
Bot Not Responding
- Verify the bot is running
- Check the TOKEN_TELEGRAM value in your .env file
- Ensure you're using the correct bot in Telegram
-
Unauthorized Access
- Verify your AUTHORIZED_USER_ID in the .env file
- Only the authorized user can interact with the bot
-
Download Failures
- Check the screen output with
/screen <ID>
- Verify your internet connection
- Check if the source site is accessible
- Check the screen output with
If you encounter issues, you can enable debug mode by setting DEBUG=True
in your .env file. This will provide more detailed logs.
- Command Line Arguments - Learn about all available command line options
- Global Search - Learn about searching across multiple sites simultaneously
- Download Options - Learn about options for downloading content