Skip to content

Copyright-News/cuhibot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

148 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ€– Cuhi

Premium Media Archival Ecosystem (Telegram Bot, Mini App & Native Android App)

Cuhi is a self-hosted premium media archival ecosystem featuring a Telegram bot, an iOS-inspired Telegram Mini App, and a fully optimized Native Android App. Archiving content from Instagram, TikTok, Facebook, and X (Twitter) has never been this seamless β€” delivered directly to your Telegram channels, local documents, or phone gallery.

v2.1.0 Β· Stable Release Β· Production Hardened


✨ Why Cuhi?

Most downloaders are black boxes. You don't know who has your cookies or where your data goes. Cuhi is different:

  • Self-Hosted β€” You own the code. Your cookies and sessions live on your server, not ours.
  • Async Native β€” Full non-blocking I/O with a dedicated thread pool. Stays responsive under heavy multi-user load.
  • Mini App Dashboard β€” A native iOS-style control panel built right inside Telegram. Manage sources, trigger downloads, view history β€” all without leaving the app.
  • Standalone Android Companion β€” Packageable as a high-fidelity native app featuring robust offline local saving, fluid layouts, and persistent media gallery integration.
  • Production Hardened β€” OS-level file locking, atomic writes, executor-backed async I/O, and zero bare exceptions.
  • Set & Forget β€” Designed to run 24/7 with automatic schedule recovery after restarts.

πŸ“± Mini App

The Cuhi Mini App is a full-featured dashboard that runs natively inside Telegram. Built with an iOS-inspired design language.


πŸ€– Standalone Android Native App

Cuhi is fully integrated and optimized to run as a native mobile application via Capacitor.

Native Mobile Enhancements:

  • Interactive Google OAuth Selector: Features a gorgeous, Google-designed Account Selector modal that mimics authentic OAuth flows. Easily switch between cached suggested profiles or add new custom emails seamlessly.
  • Responsive Keyboard Viewport Integration: Re-engineered with top-aligned flex-start structures and dynamic scroll calculations. When the virtual keyboard is shown, input fields and headers adjust gracefully with zero layout squashing or overlapping glitches.
  • Lenient Scoped Storage Permission Handlers: Engineered specifically for modern Android 11+ and 13+ Scoped Storage guidelines. The app requests media permissions but never halts the sync loop if optional gallery permissions are disabled, writing files natively to your device's standard Documents/Cuhi folder.
  • Adaptive Native Settings Panel: Dynamically hides Telegram-specific forward channels and Cron server schedulers, keeping the mobile interface clean, responsive, and tailored for standalone on-device archival.

Features

Feature Description
Dashboard Real-time stats β€” sources, files sent, data used, history count, and disk usage
Account Page View your Telegram profile photo, name, username, ID, and premium status
Sources Manager Add and remove profiles across all platforms with one tap
Download Control Choose media type, toggle stories/highlights/force refresh, start/stop downloads
History Browse recent downloads with clear-all support
Settings Configure output channel, schedule, cookies, and appearance
Theme System Dark, Light, and Auto (follows your Telegram theme)
Animations Spring-physics transitions, staggered content entrance, animated counters

Design

  • iOS-authentic border radii (10px groups, 12px cards)
  • Glassmorphic nav bar and tab bar with backdrop-filter blur
  • Gradient stat card accents (blue, green, orange, purple)
  • Apple Color Emoji font stack for consistent icons across platforms
  • Haptic feedback on all interactions via Telegram WebApp API

⚑ What it Does

  • πŸ“Έ Multi-Platform β€” Instagram, TikTok, Facebook, and X/Twitter
  • 🎬 Everything Included β€” Photos, videos, stories, highlights β€” packaged into 10-item media groups
  • πŸ“‘ Auto-Forwarding β€” Send media to your private channels or groups automatically
  • ⏱️ Scheduled Downloads β€” Set 6h / 12h / 24h intervals with restart recovery
  • πŸͺ Cookie Support β€” Upload your own cookies for private and age-restricted content
  • πŸ—‚οΈ Smart Archive β€” Remembers what was downloaded to avoid duplicates
  • πŸ”— Instant Links β€” Use /link <url> for one-off downloads
  • πŸ“€ Import/Export β€” Move your sources between instances
  • πŸ”’ Secure β€” Admin system, user allowlists, rate limiting, and URL validation

πŸš€ Getting Started

We recommend Railway for the easiest setup, but it runs anywhere with Python 3.11+.

Railway (Recommended)

  1. Fork this repo
  2. Connect it to a new Railway project
  3. Add a persistent volume mounted at /app/data
  4. Set environment variables:
    • BOT_TOKEN β€” from @BotFather
    • ALLOWED_USERS β€” comma-separated Telegram user IDs
    • ADMIN_IDS β€” your Telegram ID
  5. Deploy

Manual

git clone https://github.com/Copyright-News/cuhibot.git
cd cuhibot
pip install -r requirements.txt
export BOT_TOKEN="your-token-here"
python bot.py

πŸ“ Configuration

Variable Description Default
BOT_TOKEN Telegram bot token from @BotFather Required
ALLOWED_USERS Comma-separated list of allowed user IDs All users
ADMIN_IDS Admin user IDs for /admin panel None
DATA_ROOT Path for archives, history, and user data ./data
COOKIES_ROOT Path for cookie storage ./cookies
RAILWAY_PUBLIC_DOMAIN Auto-set by Railway for Mini App hosting Auto

πŸ—οΈ Architecture

bot.py       β€” Main bot: handlers, download engine, scheduler, persistence
server.py    β€” FastAPI backend for Mini App (runs in daemon thread)
app.html     β€” Mini App frontend (single-file, zero dependencies)

Key internals:

  • ThreadPoolExecutor for non-blocking file I/O
  • asyncio.Queue for Mini App β†’ Bot download communication
  • PTB JobQueue with post_init recovery for scheduled tasks
  • HMAC-verified initData authentication for all Mini App API calls

πŸ‘₯ The Team

We are a small group of developers passionate about open-source tools.

ebnycuhie Β Β Β Β  sayfalse

ebnycuhie & sayfalse
Lead Maintainers @ Copyright News


🏒 Organization

Copyright News
Copyright News
Open Source for Content Archival
πŸ“§ mintdmca@gmail.com


🀝 Community & Support

  • πŸ“‹ Changelog: See CHANGELOG.md for version history
  • πŸ—ΊοΈ Roadmap: Check out ROADMAP.md to see what's next
  • πŸ›‘οΈ Security: Read SECURITY.md before reporting vulnerabilities
  • πŸ“’ Updates: Join @copyrightnews on Telegram
  • βš–οΈ License: MIT β€” free to use, free to fork

Made with ❀️ for the Open Source Community

About

Cuhi Bot - A production-hardened, self-hosted Telegram bot for downloading & forwarding media from Instagram, TikTok, Facebook, and X.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages