aboutsummaryrefslogtreecommitdiffstats
path: root/yeetube.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-06-14 10:47:27 +0300
committerThanos Apollo <[email protected]>2024-06-14 10:47:27 +0300
commit956a195978f1738b518f6c692e53cb98778618cc (patch)
tree63695638c89f136736bda53d92e7152531474754 /yeetube.el
parentc9721a295f4fd30a44e94b3424151fa8a14d22ae (diff)
[fix] yeetube-download-videos: Refactor using cl-loop
Diffstat (limited to 'yeetube.el')
-rw-r--r--yeetube.el16
1 files changed, 7 insertions, 9 deletions
diff --git a/yeetube.el b/yeetube.el
index 2015b19..b6828d0 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -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.