Thanks a lot to zeremy and you for the tutorial, I just tried and it works well in a station test, but for the usual streams I would like to record, I have the following issue in the log :
2024/09/14 21:19:51 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
Here is an example stream link I would like to record is like the following (I intentionally hide the real numbers by xxxx) : http://prem2.di.fm/deepprogressivehouse_hi?xxxxxxxxxxxxxxxxx
Any idea ?
Maybe it's the script 'record.liq' which is not compatible with user auth pass ? could it be implemented maybe ? (that would be great)
Could you change line 77 in record.liq to #split_url and see if it works?
Thanks for your reply, I just tried and still fails, here is the log (on which I replaced as always by 'xxxx' about my personal API key) :
2024/09/15 08:40:11 >>> LOG START
2024/09/15 08:40:08 [ffmpeg.filter.bitstream:3] No valid mode found for filter pgs_frame_merge!
2024/09/15 08:40:08 [main:3] Liquidsoap 2.2.5
2024/09/15 08:40:08 [main:3] Using: angstrom=0.15.0 ao=0.2.4 bigarray=[distributed with Ocaml] bigarray-compat=1.0.0 bigstringaf=0.9.1 bytes=[distributed with OCaml 4.02 or above] camlp-streams camomile.lib=2.0 cry=1.0.2 ctypes=0.22.0 ctypes-foreign=0.22.0 ctypes.stubs=0.22.0 curl=0.9.2 dtools=0.4.5 dune-build-info=3.2.0 dune-private-libs.dune-section=3.2.0 dune-site=3.2.0 duppy=0.9.4 ffmpeg-av=1.1.10 ffmpeg-avcodec=1.1.10 ffmpeg-avdevice=1.1.10 ffmpeg-avfilter=1.1.10 ffmpeg-avutil=1.1.10 ffmpeg-swresample=1.1.10 ffmpeg-swscale=1.1.10 fileutils=0.6.4 gen=1.1 integers lastfm=0.3.4 liquidsoap-lang=2.2.5 liquidsoap-lang.console=2.2.5 liquidsoap_ao liquidsoap_builtins liquidsoap_core liquidsoap_ffmpeg liquidsoap_lastfm liquidsoap_mem_usage liquidsoap_memtrace liquidsoap_optionals liquidsoap_portaudio liquidsoap_runtime liquidsoap_samplerate liquidsoap_srt liquidsoap_ssl liquidsoap_stereotool liquidsoap_taglib liquidsoap_xmlplaylist magic-mime=1.3.1 mem_usage=0.1.1 memtrace=v0.2.2 menhirLib=20230608 metadata=0.3.0 mm=0.8.4 mm.audio=0.8.4 mm.base=0.8.4 mm.image=0.8.4 mm.midi=0.8.4 mm.video=0.8.4 pcre=7.5.0 portaudio=0.2.3 posix-base=2.0.2 posix-socket=2.0.2 posix-socket.constants=2.0.2 posix-socket.stubs=2.0.2 posix-socket.types=2.0.2 re=1.11.0 samplerate=0.1.6 sedlex=3.2 seq=[distributed with OCaml 4.07 or above] srt=0.3.0 srt.constants=0.3.0 srt.stubs=0.3.0 srt.stubs.locked=0.3.0 srt.types=0.3.0 ssl=0.7.0 stdlib-shims=0.3.0 stereotool str=[distributed with Ocaml] stringext=1.6.0 taglib=0.3.10 threads=[distributed with Ocaml] threads.posix=[internal] unix=[distributed with Ocaml] uri=4.2.0 winsvc=1.0.1 xmlm=1.4.0 xmlplaylist=0.1.5
2024/09/15 08:40:08 [clock:3] Using builtin (low-precision) implementation for latency control
2024/09/15 08:40:10 [main:3] Standard library loaded in 1.94 seconds.
2024/09/15 08:40:10 [liquidsoap-record:2] Stripped %url% after ? of: xxxxxxxxxxxxxxxxxxxxxxxx
2024/09/15 08:40:10 [liquidsoap-record:2] ffprobe icy-name:
2024/09/15 08:40:10 [liquidsoap-record:2] Saving to folder: http---prem2difm-vocallounge_hi
2024/09/15 08:40:11 [liquidsoap-record:2] ffprobe failed to get codec_name!!! with error: Parsing error: json value cannot be parsed as type {streams: _, _}
2024/09/15 08:40:11 [liquidsoap-record:2] Is the stream online ??
2024/09/15 08:40:11 [liquidsoap-record:2] STREAM COPY MODE
2024/09/15 08:40:11 [liquidsoap-record:2] Recording.. X:\Musiques\StreamRIP\ripped/http---prem2difm-vocallounge_hi/2024-09-15_08-40-11.mp3.rec#s
2024/09/15 08:40:11 [liquidsoap-record:2] --press CTRL-C to stop/exit.
2024/09/15 08:40:11 [liquidsoap-record:2] Recorded 00:00 [2024-09-15_08-40-11.mp3.rec#s]
2024/09/15 08:40:11 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
2024/09/15 08:40:14 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
2024/09/15 08:40:16 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
2024/09/15 08:40:18 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
2024/09/15 08:40:21 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
2024/09/15 08:40:23 [input.ffmpeg:2] Decoding failed: Avutil.Error(Server returned 401 Unauthorized (authorization failed))
[...]
Your log shows you didn't make the modification.
It should be like this.
#strip url after ?
def split_url
if string.contains(substring="?", url()) then
let (u,r) = string.split.first(separator="?", url())
url.set(u)
log(label="liquidsoap-record", level=2, "Stripped %url% after ? of: " ^ r)
end
end
#split_url