From bc902ff38e16ac861e3c4937439f041921fec31f Mon Sep 17 00:00:00 2001
From: Case Duckworth
Date: Mon, 27 Sep 2021 23:08:20 -0500
Subject: Add ytel

---
 init.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/init.el b/init.el
index 3948557..0e0be3c 100644
--- a/init.el
+++ b/init.el
@@ -2373,6 +2373,22 @@ If used with a numeric prefix argument N, N backticks will be inserted."
 
 (setup (:straight xr))
 
+(setup (:straight-if ytel
+                     (executable-find "mpv"))
+  ;; This might need to be changed depending on whether the instance goes down.
+  (:option ytel-invidious-api-url "https://invidious.snopyta.org")
+  (:bind "y"
+         (defun ytel-watch ()           ; This could possibly use `browse-url'.
+           "Stream video at point in mpv."
+           (interactive)
+           (let* ((video (ytel-get-current-video))
+                  (id (ytel-video-id video)))
+             (start-process "ytel mpv" nil
+                            "mpv"
+                            (concat "https://www.youtube.com/watch?v=" id)
+                            "--ytdl-format=bestvideo[height<=?720]+bestaudio/best")
+             (message "Starting streaming...")))))
+
 (setup (:straight zzz-to-char)
 
   (:global "M-z"
-- 
cgit 1.4.1-21-gabe81