gpt4 book ai didi

stream - Liquidsoap 不会重新加载播放列表文件

转载 作者:行者123 更新时间:2023-12-01 23:18:14 24 4
gpt4 key购买 nike

我在使用 Liquidsoap 时遇到了一个非常奇怪的问题。我有以下播放列表:

myplaylist = playlist(mode="normal",playlist_file,reload_mode="rounds",reload=1)

myplaylist = on_metadata(apply_metadata,myplaylist)

其中 apply_metadata 调用一个 python 脚本,该脚本在调用时立即更新播放列表,但有时 Liquidsoap 在重新加载后仍继续播放旧播放列表,即使调用了 apply_metadata 过程也是如此。

预先感谢您的帮助。

Liquidsoap脚本的完整代码:

# This function is called when
# a new metadata block is passed in
# the stream.
def apply_metadata(m) =
title = m["filename"]
artist = m["artist"]
print("Now playing: #{title} by #{artist}")

filename = string.split(separator="/",title) # rozdelime cestu po lomitkach
filename = list.nth(list.rev(filename),0) # vezmeme meno suboru
filename = list.nth(string.split(separator="\.",filename),0) # odpojime koncovku .mp3

command = "python3.3 feedback.py " ^ filename
system(command)

end

#!/usr/bin/liquidsoap
# Log dir
set("log.file.path","/tmp/basic-radio.log")

#tidy up before playing playlist
playlist_file = "playlist.m3u"
system("python3.3 feedback.py -init")


# Music
myplaylist = playlist(mode="normal",playlist_file,reload_mode="rounds",reload=1)

myplaylist = on_metadata(apply_metadata,myplaylist)

# Stream it out
output.icecast(%mp3, host = "localhost", port = 8080, password = "baldur", mount = "stream", myplaylist, fallible=true)

最佳答案

我终于找到了the solution asking in the Liquidsoap's mailing list :

The first though that comes to my mind is that you are perhaps using playlist() in a way this is not intended to be..

Have you though about using request.dynamic? This operator gives you full control over which song is being played next and the next track callback can be written in any language of your choice, which also makes is more convenient..

Good luck!

Romain

关于stream - Liquidsoap 不会重新加载播放列表文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18083472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com