Bunch of small scripts to run a temporary radio stream, automatically. Some liquidsoap, some bash, some pyhton. Combine as if you like Unix. with pipes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
583 B

#This is a pretty weird script, it gets lines of text from somewhere
#And it makes a playlist, to keep the amount of tracks loosely connected
#To the amount of text.
import sys
from subprocess import Popen, PIPE
magic = sys.stdin.readlines()
lines = []
for line in magic:
pfind = Popen(["find", "/media/mp3" ], stdout=PIPE)
pgrep = Popen(["grep", "mp3"], stdin=pfind.stdout, stdout=PIPE)
pfind.stdout.close() # Allow pfind to receive a SIGPIPE if pgrep exits.
pshuf = Popen(["shuf", "-n {0}".format(len(lines))], stdin=pgrep.stdout)