Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 2.54 KB

README.md

File metadata and controls

58 lines (44 loc) · 2.54 KB

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:
      git clone https://github.com/Refret28/convert-bot.git
      cd convert-bot
    1. Install Dependencies:
      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.

    1. Install FFmpeg:

    The bot uses FFmpeg for processing audio files. Install FFmpeg as follows:

  • For Windows:

  • 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.

  • For macOS:

  • Install FFmpeg via Homebrew:

      brew install ffmpeg 
  • For Linux:

  • Install FFmpeg using your system's package manager. For example, on Ubuntu:

      sudo apt update
      sudo apt install ffmpeg
    1. 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.