MCPcopy Index your code
hub / github.com/caamer20/Telegram-Drive-ForVPNs

github.com/caamer20/Telegram-Drive-ForVPNs @v1.1.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.8 ↗ · + Follow
207 symbols 377 edges 56 files 14 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Telegram Drive (Optimized for VPNs)

Telegram Drive is an open-source, cross-platform desktop application that turns your Telegram account into an unlimited, secure cloud storage drive. Built with Tauri, Rust, and React.

This specific fork has been heavily optimized for users with low bandwith accessing the Telegram API through a VPN. It includes custom network polling, automatic multi-DC fallback, exponential backoff retries for high-latency connections, and deep API optimizations to minimize round trips.

License: MIT Platform

Auth Screen

What is Telegram Drive?

Telegram Drive leverages the Telegram API to allow you to upload, organize, and manage files directly on Telegram's servers. It treats your "Saved Messages" and created Channels as folders, giving you a familiar file explorer interface for your Telegram cloud.

Key Features

  • Unlimited Cloud Storage: Utilizing Telegram's generous cloud infrastructure.
  • High Performance Grid: Virtual scrolling handles folders with thousands of files instantly.
  • Auto-Updates: Seamless updates for Windows, macOS, and Linux.
  • Media Streaming: Stream video and audio files directly without downloading.
  • Drag & Drop: Intuitive drag-and-drop upload and file management.
  • Thumbnail Previews: Inline thumbnails for images and media files.
  • Folder Management: Create "Folders" (private Telegram Channels) to organize content.
  • Privacy Focused: API keys and data stay local. No third-party servers.
  • Cross-Platform: Native apps for macOS (Intel/ARM), Windows, and Linux.

VPN Optimizations

This version includes specific backend enhancements to handle the high latency, packet loss, and connection instability common when routing Telegram traffic through VPNs from China:

  • Multi-DC Network Checks: Attempts connections across 5 different Telegram Data Centers (DC1-DC5) to find the most stable route, rather than relying on a single hardcoded IP.
  • Latency-Tolerant Timeouts: TCP connection timeouts increased from 2s to 8s.
  • Exponential Backoff & Retries: Uploads and downloads are wrapped in a custom retry handler that automatically recovers from broken pipes and EOF errors typical of unstable tunnels.
  • Flood Wait Handling: Automatically detects and sleeps during Telegram API FLOOD_WAIT rate limits before transparently resuming operations.
  • O(1) Peer Resolution: Implements an in-memory HashMap cache for Telegram peers, eliminating the need to iterate through hundreds of dialogs (saving 30+ seconds of API round trips on each file operation).
  • Direct Message Fetching: Replaced O(n) message iteration with targeted get_messages_by_id calls for instant file downloads and thumbnail generation.
  • Adaptive Polling: Frontend network polling intelligently scales from 30s to 45s to reduce unnecessary VPN traffic while remaining responsive.
  • Resilient Authentication: Initial connections and get_me pings include retry loops to prevent accidental logouts on temporary network drops.

Screenshots

Dashboard File Preview
Dashboard Preview
Grid View Authentication
Dark Mode Login
Audio Playback Video Playback
Audio Playback Video Playback
Auth Code Screen Upload Example
Auth Code Screen Upload Example
Folder Creation Folder List View
Folder Creation Folder List View

Tech Stack

  • Frontend: React, TypeScript, TailwindCSS, Framer Motion
  • Backend: Rust (Tauri), Grammers (Telegram Client)
  • Build Tool: Vite

Getting Started

Prerequisites

  • Node.js (v18+): Download here
  • Rust (latest stable): Required to compile the Tauri backend. Install via rustup:
    • macOS/Linux: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    • Windows: Download and run rustup-init.exe from rustup.rs
    • Verify installation: run rustc --version and cargo --version in your terminal.
  • OS-Specific Build Tools for Tauri:
    • macOS: Xcode Command Line Tools (xcode-select --install).
    • Linux (Ubuntu/Debian): sudo apt update && sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
    • Windows (CRITICAL): You must install the Visual Studio Build Tools. During installation, select the "Desktop development with C++" workload. Without this, you will get a linker 'link.exe' not found error.
    • Windows (WebView2): Windows 10/11 users usually have this pre-installed. If not, download the WebView2 Runtime.
    • Reference: See the official Tauri v2 Prerequisites Guide for detailed instructions.
  • Telegram API Credentials: You need your own API ID and API Hash to communicate with Telegram's servers.
    1. Log into my.telegram.org.
    2. Go to "API development tools" and create a new application to get your api_id and api_hash.

[!NOTE]
First-run Compile Time: The initial build (npm run tauri dev or npm run tauri build) will download and compile over 300 Rust crates. This process can take 5 to 15 minutes depending on your hardware. Subsequent builds will be much faster.

[!TIP] NPM Vulnerabilities: You may see vulnerability warnings during npm install. These are usually related to build tools and dev dependencies. You can optionally run npm audit fix, but it is not strictly required to run the app.

Installation

  1. Clone the repository bash git clone https://github.com/caamer20/Telegram-Drive-ForVPNs cd Telegram-Drive-ForVPNs

  2. Install Dependencies bash cd app npm install

  3. Run in Development Mode bash npm run tauri dev

  4. Build/Compile bash npm run tauri build

Open Source & License

This project is Free and Open Source Software. You are free to use, modify, and distribute it.

Licensed under the MIT License.


Disclaimer: This application is not affiliated with Telegram FZ-LLC. Use responsibly and in accordance with Telegram's Terms of Service.

<a href="https://www.paypal.me/Caamer20">
  <img src="https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png" alt="Donate with PayPal" width="200">
</a>

paypal.me/Caamer20

<a href="https://github.com/caamer20/Telegram-Drive-ForVPNs/raw/v1.1.8/litecoin:ltc1q6wkr5ac4u0pxx4hx7xgwn0gsaku25ws0df73rp">
  <img src="https://img.shields.io/badge/Donate-LTC-345D9D?style=for-the-badge&logo=litecoin&logoColor=white" alt="Donate LTC">
</a>



  ltc1q6wkr5ac4u0pxx4hx7xgwn0gsaku25ws0df73rp











<a href="https://github.com/caamer20/Telegram-Drive-ForVPNs/raw/v1.1.8/bitcoin:bc1q5pt7m2fk6w0dzsnf6vvd5k6nw5k44785286ujy">
  <img src="https://img.shields.io/badge/Donate-BTC-F7931A?style=for-the-badge&logo=bitcoin&logoColor=white" alt="Donate BTC">
</a>



  bc1q5pt7m2fk6w0dzsnf6vvd5k6nw5k44785286ujy

Extension points exported contracts — how you extend this code

DropZoneContextType (Interface)
* DropZoneContext - Minimal context for future extensibility * * With dragDropEnabled: false, we don't need position-
app/src/contexts/DropZoneContext.tsx
TelegramFile (Interface)
(no doc)
app/src/types.ts
FileMetadataRaw (Interface)
(no doc)
app/src/types.ts
FilePage (Interface)
(no doc)
app/src/types.ts
TelegramFolder (Interface)
(no doc)
app/src/types.ts

Core symbols most depended-on inside this repo

createExtensionSet
called by 10
app/src/utils/fileExtensions.ts
resolve_peer
called by 10
app/src-tauri/src/commands/utils.rs
handleSort
called by 6
app/src/components/dashboard/FileExplorer.tsx
confirm
called by 5
app/src/context/ConfirmContext.tsx
useTheme
called by 4
app/src/context/ThemeContext.tsx
check_and_reset
called by 4
app/src-tauri/src/bandwidth.rs
setInternalDragFileId
called by 3
app/src/components/Dashboard.tsx
render
called by 3
app/src/components/ErrorBoundary.tsx

Shape

Function 149
Interface 32
Method 13
Class 11
Enum 2

Languages

TypeScript71%
Rust29%

Modules by API surface

app/src-tauri/src/bandwidth.rs11 symbols
app/src-tauri/src/commands/fs.rs10 symbols
app/src/hooks/useTelegramConnection.ts9 symbols
app/src/components/ErrorBoundary.tsx8 symbols
app/src/components/AuthWizard.tsx8 symbols
app/src-tauri/src/server.rs8 symbols
app/src-tauri/src/commands/auth.rs8 symbols
app/src/types.ts7 symbols
app/src/hooks/useFileOperations.ts7 symbols
app/src/context/ThemeContext.tsx7 symbols
app/src/context/ConfirmContext.tsx7 symbols
app/src/components/dashboard/PdfViewer.tsx7 symbols

For agents

$ claude mcp add Telegram-Drive-ForVPNs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page