Hi,

I made a little script in python to fetch my files from my nextcloud share.
I add a add_protocol function to fetch them in liquidsoap.
So far it doesn't work in liquidsoap but the command works in a shell.

Below the code made for testing purpose:

def nextcloud(~rlog,~maxtime,arg) =
  extname = file.extension(dir_sep="/",arg)
  [process_uri(extname=extname,"/usr/bin/python3 /work/get_file.py '#{arg}'
$(output)")]
end
add_protocol("nc",nextcloud,doc="Fetch files from nextcloud",
syntax="nc://uri")

default = single("default/single.mp3")
genre1 = playlist("nc://genre1/playlist1.txt")
day     = genre1
night   = genre1
radio = fallback([ request.queue(id="request"),
                    switch([({ 6h-22h }, day),
                            ({ 22h-6h }, night)]),
                    default])
output.alsa(radio)

Content of the playlist1.txt file:
nc://genre1/file1.mp3
nc://genre1/file2.mp3

The log file:

2018/09/16 16:41:08 [playlist1(dot)txt:3] Loading playlist...
2018/09/16 16:41:28 [protocol.process:3] Failed to execute /usr/bin/python3
/work/get_file.py '//genre1/playlist1.txt' "/tmp/liq-process3ceb08..txt":
("timeout","19.9620351791")
2018/09/16 16:41:28 [playlist1(dot)txt:2] Failed when resolving playlist
URI "nc://genre1/playlist1.txt"!
2018/09/16 16:41:28 [playlist1(dot)txt:3] Successfully loaded a playlist of
0 tracks.
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to