aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-08 09:25:18 +0200
committerThanos Apollo <[email protected]>2024-02-08 09:25:18 +0200
commit28b603bfc57788e25f8016a7771cedf372e5f3b5 (patch)
treea250497719d1313930fe142415a047d8c5c4a174
parentc9120bb0558ec0863780e4664749a4885ba44487 (diff)
parentbc6e3f72e1b57151d3b7fa91ea0e4eb259583432 (diff)
Merge branch '2.1.1-dev'
- Add support for torsocks
-rw-r--r--yeetube-mpv.el23
-rw-r--r--yeetube.el3
2 files changed, 23 insertions, 3 deletions
diff --git a/yeetube-mpv.el b/yeetube-mpv.el
index f1655ff..474b88f 100644
--- a/yeetube-mpv.el
+++ b/yeetube-mpv.el
@@ -31,9 +31,24 @@
:type 'boolean
:group 'yeetube)
+(defcustom yeetube-mpv-enable-torsocks nil
+ "Enable torsocks.")
+
(defvar yeetube-mpv-path (executable-find "mpv")
"Path for mpv executable.")
+(defvar yeetube-mpv-torsocks (executable-find "torsocks")
+ "Path to torsocks executable.")
+
+(defun yeetube-mpv-toggle-torsocks ()
+ "Toggle torsocks."
+ (interactive)
+ (pcase yeetube-mpv-torsocks
+ ('t (setf yeetube-mpv-torsocks nil)
+ (message "yeetube: Torsocks disabled"))
+ ('nil (setf yeetube-mpv-torsocks t)
+ (message "yeetube: Torsocks enabled"))))
+
(defun yeetube-mpv-check ()
"Check if mpv and yt-dlp is installed."
(unless (and (executable-find "mpv")
@@ -58,10 +73,14 @@
This function is not specific to just playing urls. Feel free to use
to play local files."
(yeetube-mpv-process
- (concat yeetube-mpv-path " "
+ (concat (when yeetube-mpv-enable-torsocks
+ (concat yeetube-mpv-torsocks " "))
+ yeetube-mpv-path " "
(shell-quote-argument input)
(when yeetube-mpv-disable-video " --no-video")))
- (message "yeetube: starting mpv process"))
+ (message (if yeetube-mpv-enable-torsocks
+ "yeetube: Starting mpv process (using torsocks)"
+ "yeetube: Starting mpv process")))
(defun yeetube-mpv-toggle-no-video-flag ()
"Toggle no video flag for mpv player."
diff --git a/yeetube.el b/yeetube.el
index 20951b5..0ec9d97 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -5,7 +5,7 @@
;; Author: Thanos Apollo <[email protected]>
;; Keywords: extensions youtube videos
;; URL: https://git.thanosapollo.org/yeetube
-;; Version: 2.1.0
+;; Version: 2.1.1
;; Package-Requires: ((emacs "27.2") (compat "29.1.4.2"))
@@ -471,6 +471,7 @@ FIELDS-FACE-PAIRS is a list of fields and faces."
"P" #'yeetube-play-saved-video
"r" #'yeetube-replay
"t" #'yeetube-view-thumbnail
+ "T" #'yeetube-mpv-toggle-torsocks
"q" #'quit-window)
(define-derived-mode yeetube-mode tabulated-list-mode "Yeetube"