     (if (file-directory-p fpath)
         fpath)))
 
+(defun elfeed-show-enclosure-filename-remote (_entry url-enclosure)
+  "Returns the remote filename as local filename for an enclosure."
+  (file-name-nondirectory
+   (url-unhex-string
+    (car (url-path-and-query (url-generic-parse-url
+                              url-enclosure))))))
+
 (defun elfeed-show-save-enclosure-single (&optional entry enclosure-index)
   "Save enclosure number ENCLOSURE-INDEX from ENTRY.
 If ENTRY is nil use the elfeed-show-entry variable.

  :type 'boolean
  :group 'elfeed)

(defun elfeed--download-enclosure (url path)
  "Download asynchronously the enclosure from URL to PATH."
  (if (require 'async nil :noerror)

          (dolist (enclosure-index attachnums)
            (let* ((url-enclosure
                    (aref (elfeed-entry-enclosures entry) enclosure-index))
                   (fname
                    (funcall elfeed-show-enclosure-filename-function
                             entry url-enclosure))
                   (retry t))
              (while retry
                (setf fpath (expand-file-name (concat attachdir fname) path)
