summaryrefslogtreecommitdiff
path: root/emacs.org
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-03 23:10:32 +0300
committerThanos Apollo <[email protected]>2023-08-03 23:10:32 +0300
commitee544ef72c7c11cde339f0cecc4c294f93dccad5 (patch)
tree09382b0fe293f7facedd8917f3d87384000d478d /emacs.org
parentea94542415a37eb090a1ca2edc25633a9e8378e9 (diff)
emacs: update yeetube keybindings
Diffstat (limited to 'emacs.org')
-rwxr-xr-xemacs.org38
1 files changed, 36 insertions, 2 deletions
diff --git a/emacs.org b/emacs.org
index 8babf90..acf1d2d 100755
--- a/emacs.org
+++ b/emacs.org
@@ -1246,17 +1246,51 @@ Set aliases for emacs functions and ~PATH~
(load-file "~/Developer/emacs-projects/yeetube.el/yeetube.el"))
(require 'yeetube)
- (setq yeetube-results-limit 15
- yeetube-display-info-keys nil)
+ (setq yeetube-results-limit 15)
(define-prefix-command 'thanos/yeetube)
(global-set-key (kbd "C-c y") 'thanos/yeetube)
(define-key thanos/yeetube (kbd "s") 'yeetube-search)
+ (define-key thanos/yeetube (kbd "b") 'yeetube-play-saved-video)
(define-key thanos/yeetube (kbd "d") 'yeetube-download-videos)
(define-key thanos/yeetube (kbd "p") 'yeetube-toggle-pause-mpv)
+ (define-key thanos/yeetube (kbd "C-p") 'yeetube-toggle-video-mpv)
+ (define-key thanos/yeetube (kbd "k") 'yeetube-remove-saved-video)
(define-key yeetube-mode-map (kbd "c") 'yeetube-switch-mpv)
#+end_src
+** download via ffmpeg
+#+begin_src emacs-lisp
+ (defun yeetube-download-videos-ffmpeg ()
+ "Download one or multiple videos using yt-dlp.
+ This command is not meant to be used in the *Yeetube Search* buffer.
+
+ Usage Example:
+ Open a Dired buffer and navigate where you want to download your videos,
+ then run this command interactively. You can leave the 'Custom name:'
+ prompt blank to keep the default name."
+ (interactive)
+ (let ((url "")
+ (name "")
+ (download-counter 1)
+ (stored-contents nil))
+ ;; Read links and names until "q" is entered
+ (while (not (string= url "q"))
+ (setq url (read-string "Enter URL (q to quit): "))
+ (unless (string= url "q")
+ (setq name (read-string (format "Custom name (download counter: %d) " download-counter)))
+ (push (cons url name) stored-contents)
+ (setq download-counter (1+ download-counter))))
+ ;; Process the collected links and names
+ (dolist (pair stored-contents)
+ (let ((url (car pair))
+ (name (cdr pair)))
+ (call-process-shell-command
+ (format
+ "ffmpeg -protocol_whitelist file,crypto,data,https,tls,tcp -stats -i '%s' -codec copy '%s.mp4'"
+ url
+ (shell-quote-argument name)))))))
+#+end_src
* Ement
#+begin_src emacs-lisp
(defun ement-login ()