Skip to content

This Python script uses the `rich` library to search YouTube, display results in a formatted table, and play selected audio with user choice of media player (mpv, mplayer, vlc).

License

Notifications You must be signed in to change notification settings

dino1537/Youtube_Music

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube_Music

This Python script uses the rich library to search YouTube, display results in a formatted table, and play selected audio with user choice of media player (mpv, mplayer, vlc).

Code Description:

This Python script utilizes the rich, pytube, and youtubesearchpython libraries to create a user-friendly YouTube audio player. It enables users to search for YouTube videos, presents search results in a visually appealing table, and plays the selected audio with a choice of media players (mpv, mplayer, vlc).

Dependencies:

  1. rich library (for enhanced console output)
  2. pytube library (for YouTube video handling)
  3. youtubesearchpython library (for YouTube video search)
  4. Media players: mpv, mplayer, vlc (for audio playback)

Instructions:

  1. Installation:

    Ensure you have Python 3.x installed on your system.

    Install required Python libraries:

    pip install rich pytube youtubesearchpython
    

    Make sure you have one of the supported media players (mpv, mplayer, vlc) installed on your system.

  2. Running the Script:

    Save the script to a Python file (e.g., ytmusic.py).

    Open your terminal and navigate to the directory containing the script.

    Run the script using the following command:

    python ytmusic.py
    
  3. Using the Script:

    • Enter a YouTube search query to search for videos.
    • Results are displayed in a formatted table.
    • Select a video by entering its corresponding number.
    • Choose a media player (mpv, mplayer, vlc) for playback.
    • Enjoy streaming and listening to audio from YouTube videos.
    • Enter 'quit' to exit the script.

This script provides an interactive and visually appealing way to search for YouTube videos and play their audio content with your preferred media player.

yt_music output

yt_music1_2023-09-17_10:12:22

About

This Python script uses the `rich` library to search YouTube, display results in a formatted table, and play selected audio with user choice of media player (mpv, mplayer, vlc).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages