diff options
Diffstat (limited to 'emacs/.emacs.d')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-media-segment.el | 6 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-utils.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-ytdl.el | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-media-segment.el b/emacs/.emacs.d/lisp/my/my-media-segment.el index 0cef817..f222316 100644 --- a/emacs/.emacs.d/lisp/my/my-media-segment.el +++ b/emacs/.emacs.d/lisp/my/my-media-segment.el @@ -63,6 +63,7 @@ Uses `my-media-segment-max-inflight' to limit number of inflight tasks." (insert-file-contents desc-file-name) (buffer-string)))) (total (length info)) + (pad (1+ (floor (log10 total)))) (idx 0) (thunk)) (dolist (media info) @@ -74,8 +75,9 @@ Uses `my-media-segment-max-inflight' to limit number of inflight tasks." (args (append (list "-ss" start) (when end (list "-to" end)) (list "-i" (expand-file-name media-file-name) - (format "%s/%s.%s" dir title - (file-name-extension media-file-name)))))) + (format + (format "%%s/%%0%dd-%%s.%%s" pad) dir idx title + (file-name-extension media-file-name)))))) (setq thunk (lambda () (message "Cutting %s-%s to %s (%d/%d)..." diff --git a/emacs/.emacs.d/lisp/my/my-utils.el b/emacs/.emacs.d/lisp/my/my-utils.el index c64c9ac..bc200c2 100644 --- a/emacs/.emacs.d/lisp/my/my-utils.el +++ b/emacs/.emacs.d/lisp/my/my-utils.el @@ -321,7 +321,7 @@ Example: (format-time-string ... (my-time-from-epoch 1698582504))" (defvar my-extension-types '((audio . ("asf" "cue" "flac" "m4a" "m4r" "mid" "mp3" "ogg" "opus" - "wav" "wma")) + "wav" "wma" "spc")) (video . ("avi" "m4v" "mkv" "mp4" "mpg" "ogg" "ogv" "rmvb" "webm" "wmv")))) ;;; files diff --git a/emacs/.emacs.d/lisp/my/my-ytdl.el b/emacs/.emacs.d/lisp/my/my-ytdl.el index 721b299..9118493 100644 --- a/emacs/.emacs.d/lisp/my/my-ytdl.el +++ b/emacs/.emacs.d/lisp/my/my-ytdl.el @@ -87,6 +87,11 @@ (interactive "sURL(s): ") (my-ytdl-internal urls 'audio)) +(defun my-ytdl-audio-no-tor (urls) + "Download audio with ytdl." + (interactive "sURL(s): ") + (my-ytdl-internal urls 'audio t)) + ;;; fixme: autoload (defun my-ytdl-video-no-tor (urls) "Download videos with ytdl." |