Python script using Telegram-client API for generation RSS feed from Telegram channels.
Examples:
- to get RSS feed from the public channel: http://localhost:8091/channel/name.
- to get RSS feed from the private channel: http://localhost:8091/channel/joinchatAAAAAAXXXXXXXXXX (without '/' in inviting link). The user should NOT be joined to the private channel. The private channel will be joined automatically.
git clone https://github.com/mtrineyev/tgtorss.git
cd tgtorss
cp config.ini.example config.ini
nano config.ini
and set the variables as described in the commentssudo apt-get install python3-dev
sudo apt-get install python3-venv
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python connect.py
and enter your phone and the code you will recievenano tgtorss.sh
and copy the code below
#!/bin/bash
cd /home/USER/tgtorss
source venv/bin/activate
python main.py
deactivate
chmod +x tgtorss.sh
~/tgtorss/tgtorss.sh
IMPORTANT:
- Do not make more than 30 requests per seconds to a new channels, otherwise your ID may be banned to several hours. When a channel has been accessed first time its information hashed and next requests to the channel are safe. You can work with the hash file using the tool
hash.py
. - If you will delete
*.session
file you should also deletehash.pickle
file and re-connect to the Telegram.
curl http://localhost:8091/channel/bbcukrainian
connect.py
- creates new connection to Telegram client or shows information about active connection, if anyhash.py
- hash file viewing/keys deleting tool. Note: you may delete keys only when the server is switched off.
The script is free software written by Maksym Trineyev ([email protected]).
It comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.