diff options
author | Thanos Apollo <[email protected]> | 2024-02-25 11:54:22 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-02-25 11:54:22 +0200 |
commit | 30fec227afc484a92444441b70668c3a2fbbec6c (patch) | |
tree | 6bed1fa82deb3f04856048a0274c04fd9c19e21c | |
parent | 3d75f432e184494f29efaca3e09e5ee4ad4c6152 (diff) |
yeetube-get-thumbnails: Download only when yeetube-display-thumbnail
-rw-r--r-- | yeetube.el | 33 |
1 files changed, 17 insertions, 16 deletions
@@ -291,22 +291,23 @@ WHERE indicates where in the buffer the update should happen." This is used to download thumbnails from `yeetube-content', within `yeetube-search'. We can't as of now use images with tabulated-list." (interactive) - (let ((wget-exec (executable-find "wget")) - (default-directory temporary-file-directory)) - (unless wget-exec - (error "Please install `wget', to download thumbnails")) - (cl-loop for item in content - do (let ((thumbnail (plist-get item :thumbnail))) - (call-process-shell-command - (format "%s %s %s %s" wget-exec - (shell-quote-argument thumbnail) - "-O" - (concat (replace-regexp-in-string - "\\(.*\\)\\(\\(.\\{10\\}\\)\\)$" - "\\2" - thumbnail) - ".jpg")) - nil 0))))) + (when yeetube-display-thumbnails + (let ((wget-exec (executable-find "wget")) + (default-directory temporary-file-directory)) + (unless wget-exec + (error "Please install `wget', to download thumbnails")) + (cl-loop for item in content + do (let ((thumbnail (plist-get item :thumbnail))) + (call-process-shell-command + (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 '(("Relevance" . "EgIQAQ%253D%253D") |