Skip to content
/ ytgo Public

A Go program to find and watch YouTube videos from the terminal without requiring API keys.

License

Notifications You must be signed in to change notification settings

cybardev/ytgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yt.go

A Go program to play media from YouTube without needing API keys

Note

This is a Python -> Go translation of cybardev/ytpy which itself was a Shell -> Python translation of pystardust/ytfzf (before I rewrote it from scratch)

Go Reference Go Report Card Test Coverage Workflow Status

Table of Contents

Click to navigate.

Dependencies

Installation

Manual

  • Download the file from the Releases page: ytgo-{os}-{arch}

    • PS: Make sure to choose the right binary for your OS and architecture
  • Place it on your $PATH and make it executable.

With Go

Link to package: pkg.go.dev/github.com/cybardev/ytgo/v3

  • Run the following command:

    go install github.com/cybardev/ytgo/v3/cmd/ytgo@latest
  • Ensure $GOPATH/bin is added to $PATH. An easy way is to add this line to ~/.profile:

    export PATH="$(go env GOPATH)/bin:$PATH"

Important

The pkg.go.dev registry may have an outdated version. If you encounter bugs or feature disparity, please replace latest after @ with main, e.g. github.com/cybardev/ytgo/v3/cmd/ytgo@main, OR try the Manual installation method for the latest updates.

Usage

Output of ytgo -h:

Usage of ytgo:
  -d    Display URL only
  -i    Interactive selection
  -m    Play music only
  -n int
        Play nth media (default 1)
  -p    Prompt mode
  -u    Play from URL
  -v    Display version

HINT: Here's a list of mpv keyboard shortcuts for your convenience.

Examples

  • Play a video:

    ytgo rickroll

  • Play an audio:

    ytgo -m gurenge band cover

  • Play the third search result:

    ytgo -n 3 racing into the night

  • Play an audio from URL:

    ytgo -u -m "https://www.youtube.com/watch?v=y6120QOlsfU"

    • PS: The URL must be quoted to avoid parsing by the shell
  • Find the URL of a video:

    ytgo -d hotaru maiko fujita

  • Interactive selection mode:

    ytgo -i marmot scream meme

Credits