Skip to content

eshanhasitha/Media-Assist

Repository files navigation

Media-Assist Bot

A Telegram bot for downloading media from YouTube, Facebook, and Instagram.

Built with aiogram 3.x - a modern, fast, and fully asynchronous Python framework for Telegram Bot API.

Features

  • 📹 Download YouTube videos or audio
  • 🎵 Convert videos to MP3
  • 📱 Support for Instagram and Facebook media
  • 🤖 Simple Telegram interface
  • ⚡ Asynchronous processing for better performance

Deployment on Railway (Recommended)

Prerequisites

  • GitHub account
  • Railway account (sign up at railway.app)

Step 1: Push to GitHub

git add .
git commit -m "Prepare for Railway deployment"
git push origin main

Step 2: Deploy on Railway

  1. Go to railway.app and sign in with GitHub
  2. Click "New Project""Deploy from GitHub repo"
  3. Select your Media-Assist repository
  4. Railway will automatically detect it's a Python project

Step 3: Configure Environment Variables

  1. In your Railway project dashboard, go to "Variables" tab
  2. Add the following variable:
    • Key: BOT_TOKEN
    • Value: your-bot-token
  3. Click "Add"

Step 4: Deploy

Railway will automatically:

  • Install dependencies from requirements.txt
  • Install FFmpeg (for video processing)
  • Deploy your bot
  • Keep it running 24/7

Step 5: Monitor Your Bot

  • View Logs: Click on your project → "Deployments" → Select latest deployment
  • Check Status: Green indicator means bot is running
  • Redeploy: Push to GitHub and Railway auto-deploys

Why Railway?

$5 free credit/month - Enough for small to medium bots
Auto-deploy from GitHub - Push code, it deploys automatically
FFmpeg included - Video processing works out of the box
Simple setup - No CLI installation needed
Great logs - Easy debugging
Automatic SSL and custom domains

Alternative Options

Fly.io (Requires Credit Card)

  • Free tier available
  • CLI-based deployment
  • See Fly.io docs

Render.com (No Credit Card for Free Tier)

  • 750 hours/month free
  • Similar to Railway
  • May need FFmpeg setup

Local Development

# Install dependencies
pip install -r requirements.txt

# Run the bot
python main.py

Important Security Note

⚠️ Your bot token is exposed in this code. After deploying:

  1. The token is set as a secret environment variable on Fly.io
  2. Consider removing the hardcoded fallback value from bot.py

Troubleshooting

  • Bot not responding? Check logs: flyctl logs
  • Deployment failed? Ensure Fly CLI is installed and you're logged in
  • Out of memory? Fly free tier has 256MB RAM per VM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages