From 6b2ad1fffe759494075793ccb53c17ca2dc2cb33 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 25 Feb 2024 04:31:56 +0200 Subject: Refactor yeetube-get-thumbnails --- yeetube.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'yeetube.el') 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 -- cgit v1.2.3