Discussion:
[Savonet-users] custom protocol
Tony Miller
2017-06-14 01:09:05 UTC
Permalink
Hi,

I'd like to create a custom protocol that is exactly the same as the
http,https protocols, but leaves the files in /tmp and reuses them
(caching) if they are already downloaded. Is this possible? I know caching
is not a simple issue.

I was looking through scripts/protocols.liq, but I couldn't quite figure
out what exactly controls the somewhat random looking output filenames
(/tmp/liq02469a.mp3, etc).

It looks like there is a file.exists function as well, so seems like this
could be possible. I'm sure there are lots of edge cases though, as is per
the course with any sort of caching.

Thanks!
--
-Tony Miller
github.com/mcfiredrill
@freedrull
freedrool.us
Tony Miller
2017-06-14 07:14:45 UTC
Permalink
Date: June 14, 2017 10:09:05 GMT+9
Subject: custom protocol
Hi,
I'd like to create a custom protocol that is exactly the same as the http,https protocols, but leaves the files in /tmp and reuses them (caching) if they are already downloaded. Is this possible? I know caching is not a simple issue.
I was looking through scripts/protocols.liq, but I couldn't quite figure out what exactly controls the somewhat random looking output filenames (/tmp/liq02469a.mp3, etc).
It looks like there is a file.exists function as well, so seems like this could be possible. I'm sure there are lots of edge cases though, as is per the course with any sort of caching.
Thanks!
--
-Tony Miller
github.com/mcfiredrill
@freedrull
freedrool.us
Romain Beauxis
2017-06-16 20:55:37 UTC
Permalink
Hi Tony,

The most simple way, I believe, would be to alter the download protocol
code to first download the file in a caching directory of your choosing and
then copying it to the destination requested by the protocol handler.

Does that make sense?
Romain
Post by Tony Miller
Hi,
I'd like to create a custom protocol that is exactly the same as the
http,https protocols, but leaves the files in /tmp and reuses them
(caching) if they are already downloaded. Is this possible? I know caching
is not a simple issue.
I was looking through scripts/protocols.liq, but I couldn't quite figure
out what exactly controls the somewhat random looking output filenames
(/tmp/liq02469a.mp3, etc).
It looks like there is a file.exists function as well, so seems like this
could be possible. I'm sure there are lots of edge cases though, as is per
the course with any sort of caching.
Thanks!
--
-Tony Miller
github.com/mcfiredrill
@freedrull
freedrool.us
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
Continue reading on narkive:
Loading...