common lisp - Trying to get a binary file -
i automate torrent downloading, attempts drakma failed. can please me out?
the code goes follows:
(with-open-file (file "/tmp/test.torrent" :direction :output :if-exists :supersede :if-does-not-exist :create) (write-string (flexi-stream:octets-to-string (drakma:http-request "https://sukebei.nyaa.se/?page=download&tid=2265388")) file))
aside typo in package name flexi-streams
(plural), “works me.”
however, returns primary value sea of binary junk; personally, i'd return filename or something.
nb. useful files small enough fit memory @ go; you're reading entire remote stream, converting string, writing disc.
Comments
Post a Comment