3

I've just updated Liquidsoap to 1.3.0 and now get_process_lines does not return anything.

def get_request() =
  # Get the URI
  lines = get_process_lines("curl http://localhost:3000/api/v1/liquidsoap/next/my-radio")
  log("liquidsoap curl returns #{lines}")
  uri = list.hd(default="",lines)
  log("liquidsoap will try and play #{uri}")
  # Create a request
  request.create(uri)
end

I read on the CHANGELOG

- Moved get_process_lines and get_process_output to utils.liq, added optional env parameter

Does it mean I have to do something to use utils.liq in my script now ?

The full script is as follows

set("log.file",false)
set("log.stdout",true)
set("log.level",3)

def apply_metadata(m) =
  title = m["title"]
  artist = m["artist"]
  log("Now playing: #{title} by #{artist}")
end

# Our custom request function
def get_request() =
  # Get the URI
  lines = get_process_lines("curl http://localhost:3000/api/v1/liquidsoap/next/my-radio")
  log("liquidsoap curl returns #{lines}")
  uri = list.hd(default="",lines)
  log("liquidsoap will try and play #{uri}")
  # Create a request
  request.create(uri)
end

def my_safe(s) =
  security = sine()
  fallback(track_sensitive=false,[s,security])
end

s = request.dynamic(id="s",get_request)

s = on_metadata(apply_metadata,s)

s = crossfade(s)

s = my_safe(s)

# We output the stream to an icecast
# server, in ogg/vorbis format.

log("liquidsoap starting")

output.icecast(
  %mp3(id3v2=true,bitrate=128,samplerate=44100),
  host = "localhost",
  port = 8000,
  password = "PASSWORD",
  mount = "myradio",
  genre="various",
  url="http://www.myradio.fr",
  description="My Radio",
  s
)

Of course the API is working

$ curl http://localhost:3000/api/v1/liquidsoap/next/my-radio
annotate:title="Chamakay",artist="Blood Orange",album="Cupid Deluxe":http://localhost/stream/3.mp3

A more simple example :

lines = get_process_lines("echo hi")
log("lines = #{lines}")
line = list.hd(default="",lines)
log("line = #{line}")

returns the following logs

2017/05/05 15:24:42 [lang:3] lines = []
2017/05/05 15:24:42 [lang:3] line = 

Many thanks in advance for your help !

geoffroy

0

1 Answer 1

0

The issue was fixed in liquidsoap 1.3.1

Fixed:

  • Fixed run_process, get_process_lines, get_process_output when compiling with OCaml <= 4.03 (#437, #439)

https://github.com/savonet/liquidsoap/blob/1.3.1/CHANGES#L12

Not the answer you're looking for? Browse other questions tagged or ask your own question.