A Telegram bot for running and managing tasks on a Raspberry Pi. Mostly built for my use but you can modify the code to your liking.
- Runs common shell commands
- Automated subtitle downloading for torrents
- Automatic proxy management via site scraping (if Telegram is inaccessible in your location)
- Downloading audio from YouTube
- Remote code updating using
git pull - Modular design for further enhancements
- Independent configurations for easy integration
mdl: Download audio from YouTube and embed metadata using gTaggervdl: Download video from YouTuberms: Reboot MiniDLNA serverstatus: Check the status of the botreboot: Reboot the deviceupd: Update code (Pull from remote repo)lms: List the media available in media server directorypbd: Clear base directoryupx: Fetch a new proxyqbt: Download torrents using qBittorrent
- Adjust the settings in
config.tmpl.jsonfor your Pi and rename it toconfig.json. Setbot_tokento your bot's API token. Setmaster_chat_idto your primary chat that will receive uninitiated messages (e.g., torrent updates). - Instructions here. Only follow instructions for receiving your Chat ID and API token.
- Use any torrent client. I use qBittorrent with RSS feeds setup for automated downloading. Set your client to run
torrent_module.py <path-to your-download>when a torrent is finished downloading. It'll scan the download directory for video files and move them to your mediaserver location. - If the path to the file contains
subs_download_directory, it will also softcode subtitles into the video file before moving it to the server, after waiting forsubs_wait_periodseconds. - Anybody can send a command to the bot. The bot only sends uninitiated messages to
master_chat_id. - Set the
use_proxyflag if you want the bot to use a proxy. You can specify theproxy_urlor let the bot find one itself using theupxcommand or just call theupdate_proxymethod insideproxy_manager.py. base_directoryserves as the root folder where the bot will operate.media_server_directoryandsubs_download_directorywill be inside this folder.- Additionally, use gTagger to automatically embed metadata to music downloaded from YouTube. Set
genius_api_tokento your Genius.com API token.