From 60d73d1ec7347f9b409965c2721d2e75adfb9889 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 2 Apr 2024 15:46:04 +1100 Subject: [emacs] add renaming to dired rename files by mtime also a new command to use ytdl without tor --- emacs/.emacs.d/lisp/my/my-ytdl.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-ytdl.el') diff --git a/emacs/.emacs.d/lisp/my/my-ytdl.el b/emacs/.emacs.d/lisp/my/my-ytdl.el index e902722..721b299 100644 --- a/emacs/.emacs.d/lisp/my/my-ytdl.el +++ b/emacs/.emacs.d/lisp/my/my-ytdl.el @@ -65,13 +65,13 @@ (defvar my-ytdl-audio-download-dir "~/Downloads" "Directory for ytdl to download audios to.") -(defun my-ytdl-internal (urls type &optional cut-segments) +(defun my-ytdl-internal (urls type &optional no-tor) (my-with-default-directory (if (eq type 'video) - my-ytdl-video-download-dir - my-ytdl-audio-download-dir) + my-ytdl-video-download-dir + my-ytdl-audio-download-dir) (apply 'my-start-process-with-torsocks (append - (list nil (format "ytdl-%s" urls) (format "*ytdl-%s*" urls) + (list no-tor (format "ytdl-%s" urls) (format "*ytdl-%s*" urls) my-ytdl-program) (if (eq type 'video) my-ytdl-video-args my-ytdl-audio-args) (split-string urls))))) @@ -87,5 +87,11 @@ (interactive "sURL(s): ") (my-ytdl-internal urls 'audio)) +;;; fixme: autoload +(defun my-ytdl-video-no-tor (urls) + "Download videos with ytdl." + (interactive "sURL(s): ") + (my-ytdl-internal urls 'video t)) + (provide 'my-ytdl) ;;; my-ytdl.el ends here -- cgit v1.2.3