Create a mirror-img system and package
This commit is contained in:
parent
8cbb3e338d
commit
7c6eb4d19c
|
@ -0,0 +1,6 @@
|
|||
(defsystem "mirror-img"
|
||||
:version "0.1"
|
||||
:license "GPLv3"
|
||||
:author "Jaidyn Ann <jadedctrl@posteo.at>"
|
||||
:depends-on (lquery dexador split-sequence)
|
||||
:components ((:file "mirror-img")))
|
|
@ -13,14 +13,19 @@
|
|||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
(defpackage :mirror-img
|
||||
(:use :cl)
|
||||
(:export :mirror-img))
|
||||
|
||||
(in-package :mirror-img)
|
||||
|
||||
(defvar *src-tags* '("audio" "embed" "img" "input" "script" "source" "track" "video"))
|
||||
(defvar *href-tags* '("link"))
|
||||
|
||||
|
||||
|
||||
;;; Mirror-img
|
||||
;;; ————————————————————————————————————————
|
||||
(defun mirror-remote-urls (html-file base-dir &optional (tags '("img")))
|
||||
(defun mirror-img (html-file base-dir &optional (tags '("img")))
|
||||
"Attempt to mirror all remote HREF/SRC URLs of an HTML file’s tags,
|
||||
downloading them to base-dir. The remote URLs will be replaced with the
|
||||
local version, where downloading was successful.
|
||||
|
|
Ŝarĝante…
Reference in New Issue