diff options
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-ytdl.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-ytdl.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-ytdl.el b/emacs/.emacs.d/lisp/my/my-ytdl.el index 5676101..7cdda43 100644 --- a/emacs/.emacs.d/lisp/my/my-ytdl.el +++ b/emacs/.emacs.d/lisp/my/my-ytdl.el @@ -76,12 +76,19 @@ ('audio my-ytdl-audio-download-dir) ('music my-ytdl-music-download-dir) (_ (error "Unsupported type: %s" type))) - (apply 'my-start-process-with-torsocks - (append - (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))))) + (set-process-sentinel + (apply 'my-start-process-with-torsocks + (append + (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))) + (lambda (proc event) + (let ((status (process-exit-status proc))) + (if (eq status 0) + (progn + (message "ytdl-%s %s: DONE" type urls)) + (message "ytdl-%s %s FAILED: %s" type urls event))))))) (defun my-ytdl-video-info (url) "Given a video URL, return an alist of its properties." |