Coder Social home page Coder Social logo

gappeah / youtube-to-audio Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 48 KB

This is a simple application that allows users to convert YouTube videos to MP3 audio files.

Python 100.00%
python youtube-downloader music music-downloader youtube-to-mp3 youtube-to-mp3-converter

youtube-to-audio's Introduction

YouTube-To-Audio

YouTube-to-Mp3

A subset of the YouTube Downloader script. This Python script allows you to download audio from YouTube videos and convert them to MP3 format in 32 kbit/s, 96 kbit/s, 128 kbit/s, 192 kbit/s, 256 kbit/s and 320 kbit/s

image

Features:

  • Validates YouTube video URLs.
  • Extracts video title and removes non-alphabetical characters.
  • Checks for video availability.
  • Downloads the audio stream in MP4 format.
  • Converts the MP4 audio to MP3 format.
  • Cleans up by removing the downloaded MP4 file.

Usage:

  1. Ensure you have the following libraries installed: requests, pytube, os, pydub, re, urllib.parse. You can install them using pip install requests pytube os pydub re urllib.parse.
  2. Make sure you have FFmpeg installed on your system (https://github.com/BtbN/FFmpeg-Builds/releases) and the ffmpeg.exe, ffplay.exe, ffprobe.exe files in your project folder.
  3. Save the code as youtube_mp3.py.
  4. Run the script: python youtube_mp3.py.
  5. Paste the YouTube video URL when prompted.
  6. The script will download the audio, convert it to MP3, and save it in the same directory as the script.

Note:

  • This script is for educational purposes only and should not be used for downloading copyrighted material without permission.
  • This is a work in progress and may have bugs or limitations.

Updates:

  • Direct MP4 to MP3 conversion has been achieved.
  • Both www.youtube.com or youtu.be are accepted.
  • Added new standard sample rate 48 khz.
  • Added new bitrate options 32 kbit/s – generally acceptable only for speech, 96 kbit/s – generally used for speech or low-quality streaming, 128 kbit/s – mid-range bitrate quality, 192 kbit/s – medium-quality bitrate, 256 kbit/s – a commonly used high-quality bitrate and 320 kbit/s – highest level supported by the MP3 standard.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.