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
$PATH
and 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/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.
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.
-
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
- 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 = ({.*?});