]> njoseph.me Git - blog.git/blobdiff - content/posts/youtube-adventures.md
youtube: Add emacs section
[blog.git] / content / posts / youtube-adventures.md
index e10516b6443f66bf8741f6f4b7bd035df547849a..3ccf06d1bf2f42f1e0886b4c0eb3cf82215519d2 100644 (file)
@@ -1,8 +1,8 @@
 ---
 title: "Adventures with YouTube"
 date: 2020-08-02T05:40:09+05:30
-lastmod: 2019-11-04T15:40:09+05:30
-tags : [ "free-software", "YouTube", "privacy", "MPV", "NimCoon" ]
+lastmod: 2020-08-06T20:40:09+05:30
+tags : [ "free-software", "YouTube", "privacy", "MPV", "NimCoon", "emacs" ]
 categories : [ "free-software", "privacy" ]
 layout: post
 type:  "post"
@@ -122,7 +122,7 @@ After:
 There isn't much else to do in the RSS feed reader and the browser. Any
 improvements that I make to this setup will be in NimCoon.
 
-## What else?
+## Using Emacs
 
 While I was on this journey, many people recommended that I use elfeed in emacs
 for YouTube subscriptions and use MPV to play the videos. If I had taken that
@@ -131,6 +131,27 @@ the Nim language. Using a self-hosted RSS feed reader gives me the advantage of
 being able to use it from multiple devices. Also, I was already using TT-RSS
 well before I had heard of elfeed. ¯\\_(ツ)_/¯
 
+If you use elfeed or something else to get your YouTube links into an emacs
+buffer, you can still use NimCoon to play the videos. Add the following code
+snippets to your emacs init file.
+
+```elisp
+(defun nimcoon-play-url (url &rest args)
+  "Play a URL using nimcoon"
+  (interactive)
+  (start-process "nimcoon" nil "nimcoon" url))
+
+(setq browse-url-browser-function
+      (quote
+       (("youtu\\.?be" . nimcoon-play-url)
+        ("." . browse-url-default-browser))))
+```
+
+Only YouTube URLs will be picked up by NimCoon and the rest will be opened by
+your default browser.
+
+## Looking for more?
+
 If you're interested in finding out what other tools I use for reasons of
 privacy and digital minimalism, please check out my [Privacy
 Stack](https://njoseph.me/mediawiki/Privacy_Stack).