From 3394d74ed564ac0e0fe9e66112b04e87c21a75a3 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 09:21:47 +0200 Subject: Add yeetube-mpv-enable-torsocks --- yeetube-mpv.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yeetube-mpv.el b/yeetube-mpv.el index f1655ff..ae46005 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -31,6 +31,9 @@ :type 'boolean :group 'yeetube) +(defcustom yeetube-mpv-enable-torsocks nil + "Enable torsocks.") + (defvar yeetube-mpv-path (executable-find "mpv") "Path for mpv executable.") -- cgit v1.2.3 From 059300a2e0303e325332c4486f8b97396748184e Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 09:22:26 +0200 Subject: Add yeetube-mpv-torsocks --- yeetube-mpv.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yeetube-mpv.el b/yeetube-mpv.el index ae46005..f0c7881 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -37,6 +37,9 @@ (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-check () "Check if mpv and yt-dlp is installed." (unless (and (executable-find "mpv") -- cgit v1.2.3 From 039c3c6665cf047adac061d9569df9dfc90c719b Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 09:22:45 +0200 Subject: Add yeetube-mpv-toggle-torsocks --- yeetube-mpv.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yeetube-mpv.el b/yeetube-mpv.el index f0c7881..4eb0096 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -40,6 +40,15 @@ (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") -- cgit v1.2.3 From d807063fdb457ddaf918e5d18117c75171cccd9a Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 09:23:03 +0200 Subject: yeetube-mpv-play: Use torsocks, when enabled --- yeetube-mpv.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yeetube-mpv.el b/yeetube-mpv.el index 4eb0096..474b88f 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -73,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." -- cgit v1.2.3 From e0d71e9e95015eeba73c83305df2c5e12690977c Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 09:23:27 +0200 Subject: yeetube-mode-map: Add yeetube-mpv-toggle-torsocks --- yeetube.el | 1 + 1 file changed, 1 insertion(+) diff --git a/yeetube.el b/yeetube.el index 20951b5..f28d9fb 100644 --- a/yeetube.el +++ b/yeetube.el @@ -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" -- cgit v1.2.3 From bc6e3f72e1b57151d3b7fa91ea0e4eb259583432 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 09:24:52 +0200 Subject: Version bump 2.1.1 --- yeetube.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index f28d9fb..0ec9d97 100644 --- a/yeetube.el +++ b/yeetube.el @@ -5,7 +5,7 @@ ;; Author: Thanos Apollo ;; 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")) -- cgit v1.2.3