Skip to content

DevAyu-Codes/TeleStorage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Telegram Turbo Storage Uploader 🚀

A high-performance, automated daemon for Linux that turns a Telegram Group into unlimited, organized cloud storage.

Unlike standard bots, this tool uses a real User Client (MTProto) with Custom Parallel Uploading, allowing it to maximize your internet bandwidth (tested: 12MB file in 6 seconds).

✨ Features

  • ⚡ Turbo Speed: Uses custom multi-threaded workers (4 parallel connections) to bypass single-thread speed limits.
  • 📂 Folder-to-Topic Mapping: Drops a file in ~/Storage/Personal -> Uploads to the "Personal" Topic in Telegram.
  • 🛡️ Smart Stability: Waits for file copying to finish before touching the file.
  • 🔄 Auto-Retry: Handles internet dropouts and Telegram "FloodWait" errors automatically.
  • 🧹 Zero-Trace: Deletes the local file immediately after a successful upload to save disk space.
  • 📝 Robust Logging: Keeps a detailed log of all transfers in telegram_upload.log.

🛠️ Prerequisites

To enable the high-speed cryptographic engine (cryptg) and fast event loop (uvloop), you must install system build tools before installing the Python libraries.

1. System Dependencies

Ubuntu / Debian / Linux Mint / Kali / Pop!_OS:

sudo apt update
sudo apt install python3-pip python3-dev build-essential

Fedora / RHEL / CentOS:

sudo dnf groupinstall "Development Tools"
sudo dnf install python3-devel gcc

Arch Linux / Manjaro:

sudo pacman -S base-devel python-pip

2. Python Dependencies

Run this command on all systems:

pip3 install telethon watchdog hachoir cryptg uvloop
  • telethon: The Telegram client.
  • watchdog: To monitor folders for new files.
  • cryptg: (Critical) C-accelerated encryption for speed.
  • uvloop: (Critical) Ultra-fast event loop replacement.

⚙️ Configuration

  1. Open telegram_sync.py in your text editor.
  2. Edit the CONFIGURATION section at the top:
API_ID = 12345678           # From my.telegram.org
API_HASH = 'your_hash_here' # From my.telegram.org
TARGET_GROUP_ID = -100xxxxxxxx  # Your Private Group ID
BASE_STORAGE_DIR = "/home/user/Storage" # Absolute path to monitor

➕ How to Add/Customize Topics

The script uses a simple dictionary to map Folder Names to Topic IDs.

  1. Create the folder on your computer inside your storage directory (e.g., Movies).
  2. Go to your Telegram Group, right-click the Topic you want to link, and copy its link (e.g., https://t.me/c/123456789/55).
  3. The number at the end (55) is your Topic ID.
  4. Add it to the TOPIC_MAPPING list in the script:
TOPIC_MAPPING = {
    "Personal": 2,       # Existing Topic
    "Development": 44,   # Existing Topic
    "Movies": 55,        # <--- NEW ADDITION
    "Backups": 102       # <--- NEW ADDITION
}

Note: Folder names are case-sensitive!


🚀 Usage

Step 1: First Run (Login)

Run the script manually once to authenticate with Telegram.

python3 telegram_sync.py
  • Enter your phone number and OTP code.
  • Check the output: It should say 🚀 SPEED BOOST: ACTIVE. If it says "Warning", check your prerequisites.
  • Press Ctrl+C to stop it.

Step 2: Setup Background Service (Systemd)

To make it run automatically on boot:

  1. Create the service file:

    sudo nano /etc/systemd/system/telegram-uploader.service
  2. Paste this configuration (Change User and paths to match your system):

    [Unit]
    Description=Telegram Turbo Uploader
    After=network-online.target
    
    [Service]
    User=yourusername
    Group=yourusername
    WorkingDirectory=/home/yourusername/scripts/
    ExecStart=/usr/bin/python3 /home/yourusername/scripts/telegram_sync.py
    Restart=always
    RestartSec=10
    Environment=PYTHONUNBUFFERED=1
    
    [Install]
    WantedBy=multi-user.target
  3. Enable and Start:

    sudo systemctl daemon-reload
    sudo systemctl enable telegram-uploader.service
    sudo systemctl start telegram-uploader.service

🔍 Troubleshooting

How do I check if it's running?

sudo systemctl status telegram-uploader.service

How do I see the logs?

tail -f ~/scripts/telegram_upload.log

It says "Unit telegram-uploader.service not found" This means you skipped Step 2 above. You must create the .service file in /etc/systemd/system/ before you can start it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%