Skip to content

Elias-Gill/yt_player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YT Player

A simple wrapper for the YouTube API and MPV player. This tool allows you to effortlessly search for and list YouTube videos, and play them directly using MPV.

NOTE: Windows NOT SUPPORTED

Demo

Important Note

To use this application, you will need a valid YouTube API key. Follow the instructions below to obtain one.

1. Obtain a YouTube API Key

  1. Navigate to the Google Cloud Console.
  2. Create a new project and enable the YouTube Data API v3 for that project.
  3. Go to the API Credentials page and generate an API key.

2. Provide the API Key

You can provide your API key in one of two ways:

  • With a Command Line Flag:
yt_player --key=<your_api_key>
  • As an Environment Variable:
# Linux and macOS
export YT_PLAYER_KEY=<your_api_key>

Dependencies

This program relies on the following dependencies:

  • MPV Player: A versatile media player that supports a wide range of formats.
  • yt-dlp: A command-line program to download videos from YouTube and other sites.

Installation Instructions

Linux and macOS

Most distributions provide the necessary dependencies, which can be installed using your package manager.

  • Debian/Ubuntu:
    sudo apt install mpv yt-dlp
  • macOS (Homebrew):
    brew install mpv yt-dlp

Installation

Pre-compiled Binaries

We now provide pre-compiled binaries for Windows, macOS, and Linux on the Releases page. Simply download the appropriate binary for your platform and run it.

Building from Source

If you prefer to build the project from source, you can install it using Go's package manager:

go install github.com/elias-gill/yt_player@latest

Alternatively, you can clone the repository and build it locally:

git clone https://github.com/elias-gill/yt_player.git
cd yt_player
go install .

Features

  • Search and Play: Quickly search for YouTube videos and play them using MPV.
  • User-Friendly Interface: Simple command-line interface for easy navigation and playback.
  • Detach mode: You can detach and reattach to the player. Very usefull when you want to quickly open and close tmux floating windows or pannels to control your music.

To see available command line flags use the "--help" flag.

Future Plans

  • Support for listing and playing YouTube playlists.
  • A playback queue for continuous video playback.
  • Custom playlists for saving and managing favorite videos.

Contributing

We welcome contributions! If you have suggestions for improvements or new features, feel free to:

  • Open an issue on GitHub.
  • Submit a pull request with your changes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Simple tui wrapper for the youtube API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages