An open API service indexing awesome lists of open source software.

https://github.com/mlibre/linkmagicbot

LinkMagicBot: Download YouTube, Instagram, or any links effortlessly! 😎🌟
https://github.com/mlibre/linkmagicbot

download telegram youtube

Last synced: 11 months ago
JSON representation

LinkMagicBot: Download YouTube, Instagram, or any links effortlessly! 😎🌟

Awesome Lists containing this project

README

          

# LinkMagicBot 🚀

`LinkMagicBot` is a Telegram bot that makes link downloading a breeze! This bot can grab videos and files from various platforms, including YouTube and Instagram.

## Features 🌟

- Download videos from YouTube 🎥
- Download videos from Instagram 📸
- Download any other file links 📦

## How to Use 🤖

1. Start a chat with `LinkMagicBot` on Telegram.
2. Send a link you want to download using the `/d` command for videos or `/y` for YouTube videos.
3. Sit back and relax as `LinkMagicBot` does the heavy lifting for you! 🪄
4. The bot will send you the downloaded file.

## Commands 📝

- `/d [link]`: Download videos from various sources
- `/y [link]`: Download YouTube videos

## Permissions 🔐

To use the bot, make sure you're an allowed user. The bot owner can grant permissions to specific users

## Requirements 🛠️

Make sure you have the following tools installed:

- [yt-dlp](https://github.com/yt-dlp/yt-dlp) for downloading YouTube videos
- [instaloader](https://instaloader.github.io/) for downloading Instagram videos
- [aria2c](https://aria2.github.io/) for downloading other files
- [ffmpeg](https://ffmpeg.org/) for converting videos and audio files

```bash
sudo apt install python3-pip aria2 ffmpeg
pip3 install -U "yt-dlp[default]"
pip3 install instaloader
```

## Installation 🚚

Clone this repository and install the required dependencies:

```bash
git clone https://github.com/mlibre/LinkMagicBot.git
cd LinkMagicBot
npm install
```

## Configuration ⚙️

You can set environment variables to configure the bot in `shell` or create a `.env` file in the project directory:

To set environment variables in shell simply set `process.env.TELEGRAM_BOT_TOKEN` environment variable and if needed `process.env.ALLOWED_USERS` environment variable.

To use `.env` file, simply rename the `.env.example` file to `.env` and fill in the values:

```bash
mv .env.example .env
```

```bash
TELEGRAM_BOT_TOKEN=YOUR_TELEGRAM_BOT_TOKEN_HERE
ALLOWED_USERS=comma,separated,usernames,if,needed
YT_MAX_FILESIZE=49M
YT_SPLIT_CHAPTERS=true
```

## Running the Bot 🏃

To run the bot, execute the following command in your terminal:

```bash
node --env-file=.env bot.js
```

## Run using pm2

To run the bot using pm2 process manager, install pm2 globally:

```bash
npm install pm2 -g
pm2 startup
systemctl enable pm2-root
pm2 start bot.js --node-args="--env-file=.env"
pm2 save
pm2 logs 0
```

## Usage Examples 🚀

### Download a Video (Non-YouTube)

To download a video from a any sources, simply send the link using the `/d` command. For example:

```bash
/d https://example.com/video.mp4
```

### Download a YouTube Video

To download a YouTube video, use the `/y` command followed by the YouTube video link. For example:

```bash
/y https://www.youtube.com/watch?v=YOUR_VIDEO_ID_HERE
```

## Local bot server

Local bot server is a simple way to run the bot without using the Telegram bot API.
You can then upload files up to 2000mg

### Create a new application

Open [my.telegram](https://my.telegram.org/auth?to=apps). while adBlockers and firefox protectors are disabled.

Create a new application using the following parameters:

- App title: TestApp1
- Short name: testapp1
- URL: N/A (Fill nothings here)
- Platform: Desktop
- Description: N/A (Fill nothings here)

### Install on your server

```bash
apt install cmake libssl-dev gperf ffmpeg g++ zlib1g-dev
git clone --recursive https://github.com/tdlib/telegram-bot-api.git
cd telegram-bot-api
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target install
./telegram-bot-api --api-id ID --api-hash HASH --local
```

## Contributing 🤝

We welcome contributions from the community! Feel free to fork this repository, make improvements, and create pull requests.

## License 📄

This project is licensed under the MIT License.

Happy downloading! 🚀📥