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)
Click to navigate.
-
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
$PATHand make it executable.
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/binis 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.
Output of ytgo -h:
Usage of ytgo:
-d Display URL only
-f string
Play from playlist file
-i Interactive selection
-m Play music only
-n int
Play nth media (default 1)
-p Prompt mode
-u Play from URL
-v Display versionHINT: Here's a list of mpv keyboard shortcuts for your convenience.
-
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 -
Playlist mode:
ytgo -f playlist.txt- If file exists, items will be played; else file is created and user is prompted to add items.
- File is a plaintext list of valid Video IDs, one per line. Generate one and view it for an example.
- pystardust's ytfzf
- This article I found during my quest to implement a simplified version of ytfzf in Python3
- StackOverflow answer used for the regex
var ytInitialData = ({.*?});

