summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-25 04:31:56 +0200
committerThanos Apollo <[email protected]>2024-02-25 04:31:56 +0200
commit6b2ad1fffe759494075793ccb53c17ca2dc2cb33 (patch)
treebf72e1be882971da453916b42209f8e6106d59f8
parent6c17c33b76c2db5d14bee5a03c5bf47ce4cf8250 (diff)
Refactor yeetube-get-thumbnails
-rw-r--r--yeetube.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/yeetube.el b/yeetube.el
index 434be23..b17acee 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -294,10 +294,16 @@ This is used to download thumbnails from `yeetube-content', within
(unless wget-exec
(error "Please install `wget', to download thumbnails"))
(cl-loop for item in content
- do (let ((title (plist-get item :title))
- (thumbnail (plist-get item :thumbnail)))
+ do (let ((thumbnail (plist-get item :thumbnail)))
(call-process-shell-command
- (concat "wget " (shell-quote-argument thumbnail) " -O" (shell-quote-argument title))
+ (format "%s %s %s %s" wget-exec
+ (shell-quote-argument thumbnail)
+ "-O"
+ (concat (replace-regexp-in-string
+ "\\(.*\\)\\(\\(.\\{10\\}\\)\\)$"
+ "\\2"
+ thumbnail)
+ ".jpg"))
nil 0)))))
(defvar yeetube-filter-code-alist