diff options
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -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 () |