💾 Archived View for frrobert.net › log › googler-2021-03-29-1510.gmi captured on 2021-11-30 at 20:18:30. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

---

Title: YouTube Search or How I found Googler

Published: 2021-03-29 15:10

Author: Rev. Fr. Robert Bower

Tag:

layout: blog

---

YouTube Search or How I found Googler

There have been many blog posts and videos about how to view YouTube videos from the command line. But what if you want to search for YouTube videos from the command line. The only dedicated utility I know is MPS-youtube.

https://github.com/mps-youtube/mps-youtube

You may find it fits your needs. I always had trouble with it. I think most of the issues were probably me.

I have been using YouTube-dl to download videos for many years and using mpv to stream and watch YouTube videos. I was always looking for a search component. Today I found it. I came across two utilities, googler and ddgr. Googler is a utility that lets you search Google from the command line and ddgr lets you search Duck Duck Go from the command line.

https://github.com/jarun/googler

https://github.com/jarun/ddgr

I downloaded googler since I wanted to search for YouTube videos. Google is not my search engine of choice but it does make sense to search a Google site with Google.

Now, with a one line script I can search for videos and watch videos from the command line.

#!/bin/bash
~/bin/googler -w youtube.com --url-handler mpv $@

The -w option tells googler to only search YouTube and the --url-handler option tells it to pass the selected search result to mpv. $@ tells googler to use what ever I type for arguments use as the search parameters.

Zettelkasten ID **googler-2021-03-29-1510**