https://github.com/refret28/convert-bot
The bot converts and downloads any video, and, if possible, its preview (cover) from YouTube, in mp3 format.
https://github.com/refret28/convert-bot
pytube requests telebot telegram-bot youtube-search-python
Last synced: 6 months ago
JSON representation
The bot converts and downloads any video, and, if possible, its preview (cover) from YouTube, in mp3 format.
- Host: GitHub
- URL: https://github.com/refret28/convert-bot
- Owner: Refret28
- Created: 2024-07-21T23:02:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-18T15:38:41.000Z (about 1 year ago)
- Last Synced: 2024-08-19T15:48:03.882Z (about 1 year ago)
- Topics: pytube, requests, telebot, telegram-bot, youtube-search-python
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YouTube Audio Downloading Telegram Bot
This bot allows users to search for YouTube videos and download audio, with the option to include a link to the original video. The bot uses the Aiogram framework and the yt_dlp library for extracting video information. FFmpeg is required for audio processing. Follow the instructions below for installation and setup.
**Features**
Start Command (/start): Initializes the bot and prompts the user to enter a video title to search on YouTube.
Stop Command (/stop): Stops the bot's interaction with the user.
Next Command (/next): Allows the user to search for another video.
Video Search & Audio Download: Users can search for a video by entering its full title. The bot provides options to download only the audio or the audio with a link to the video.
Error Handling: The bot handles common errors, such as network issues and file size limitations, providing relevant feedback to the user.
Session Management: The bot tracks user states to manage ongoing interactions and prevent duplicate entries.
## Installation and Setup
1) **Clone the Repository:**
```bash
git clone https://github.com/Refret28/convert-bot.git
```
```bash
cd convert-bot
```
2) **Install Dependencies:**
```bash
pip install -r requirements.txt
```
The requirements.txt file includes all necessary dependencies, including the yt_dlp library, which is used for extracting video information from YouTube. yt_dlp is a fork of youtube-dl with updated features for working with YouTube.
3) **Install FFmpeg:**
The bot uses FFmpeg for processing audio files. Install FFmpeg as follows:
Download FFmpeg from the official website: https://ffmpeg.org/download.html.
Extract the archive and add the FFmpeg path to your system's PATH environment variable.
Install FFmpeg via Homebrew:
```bash
brew install ffmpeg
```
Install FFmpeg using your system's package manager. For example, on Ubuntu:
```bash
sudo apt update
```
```bash
sudo apt install ffmpeg
```
4) **Configuration:**
Insert your Telegram Bot API token, path to bin and path to dir to remove residual files after downloading into the config.ini file under the [BOT TOKEN], [PATH TO BIN] and [PATH TO DIR] sections.
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your improvements.