summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--browse.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/modules/bd--browse.el')
-rw-r--r--.config/emacs/modules/bd--browse.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/.config/emacs/modules/bd--browse.el b/.config/emacs/modules/bd--browse.el
index 6a5d2ef..531c7b2 100644
--- a/.config/emacs/modules/bd--browse.el
+++ b/.config/emacs/modules/bd--browse.el
@@ -53,11 +53,18 @@ icecat, or eww."
(list (bd/selector-bookmarks)
(bd/selector-search)))))
+(defun rip (url)
+ "Play URL (or search string) in mpv."
+ (interactive "sURL or search string: ")
+ (message "Ludu %s" url)
+ (start-process "rip" nil
+ "mpv" (concat (if (string-match "https://.*" url)
+ "ytdl://"
+ "ytdl://ytsearch:") url)))
+
(setopt browse-url-handlers
`((,(regexp-opt '("youtube.com" "youtu.be")) .
- (lambda (url &rest _)
- (message "Ludu %s" url)
- (start-process-shell-command "rip-video" nil (concat "rip-video " url)))))
+ (lambda (url &rest _) (rip url))))
url-privacy-level '(email os emacs lastloc cookies))
(use-package shr
@@ -98,8 +105,8 @@ icecat, or eww."
(t (funcall original url new-window))))
(advice-add 'eww :around 'bd/elpher)
:custom
- (elpher-use-tls t)
(elpher-default-url-type "gemini")
+ (elpher-connection-timeout 120)
(elpher-gemini-max-fill-width 85)
(elpher-use-emacs-bookmark-menu t))