Hi.

There is no handler for failed downloads. And there can't be one like
on_metadata cause download events are not part our streams. One solution
is to setup your own protocol, say "myhttp", using a script of yours
wrapping a call to wget plus whatever you want to do in case of failure.

add_protocol("myhttp",
  fun (arg,delay) -> get_process_output("mywrapper "^quote(arg)))

The only thing you will not be able to react on is a timeout. The (bad)
reason is that there is no function in our scripts which would allow you
to pass the delay (a float) to mywrapper in the string. 

Another (bad) limitation is that your request won't be marked as
temporary, so the downloaded files won't get erased after playing.

If you think you can do what you want with a wrapper and a new protocol,
let me know and I'll add the necessary stuff in liquidsoap -- that won't
take much time, I didn't do it previously only because I prefer to wait
for examples before bloating the API.

Hope that helps (otherwise, send more details).

David


Reply via email to