diff options
author | Thanos Apollo <[email protected]> | 2024-06-14 10:47:27 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-06-14 10:47:27 +0300 |
commit | 956a195978f1738b518f6c692e53cb98778618cc (patch) | |
tree | 63695638c89f136736bda53d92e7152531474754 | |
parent | c9721a295f4fd30a44e94b3424151fa8a14d22ae (diff) |
[fix] yeetube-download-videos: Refactor using cl-loop
-rw-r--r-- | yeetube.el | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -584,15 +584,13 @@ Open a Dired buffer and navigate where you want to download your videos, then run this command interactively. You can leave the name prompt blank to keep the default name." (interactive) - (let ((url "") - (name "") - (download-counter 1)) - (while (not (string= url "q")) - (setf url (read-string "Enter URL (q to quit): ")) - (unless (string= url "q") - (setf name (read-string (format "Custom name (download counter: %d) " download-counter))) - (setf download-counter (1+ download-counter)) - (yeetube-download--ytdlp url name yeetube-download-audio-format))))) + (let ((download-counter 1)) + (cl-loop + for url = (read-string "Enter URL (q to quit): ") + until (string= url "q") + do (let ((name (read-string (format "Custom name (download counter: %d) " download-counter)))) + (yeetube-download--ytdlp url name yeetube-download-audio-format) + (cl-incf download-counter))))) (defun yeetube-propertize-vector (content &rest fields-face-pairs) "Create a vector with each item propertized with its corresponding face. |