Browse Source

update errbot plugin to use icedjd

master
Shokara Kou 6 months ago
parent
commit
37113d9724
  1. 5
      icedjbot.py
  2. 3
      icedjd.py

5
icedjbot.py

@ -7,6 +7,7 @@ class IceDJBot(BotPlugin):
@botcmd
def stream(self, msg, args):
filename = IceDJBot.dj.download(args)
IceDJBot.dj.stream(filename)
fifo_path = '/tmp/icedjd.fifo'
with open(fifo_path, 'w') as f:
f.write(args)
return args

3
icedjd.py

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# a daemon for IceDJ that accepts urls in a fifo
# a daemon for IceDJ that accepts urls and filenames in a fifo
import os, signal, sys, queue, threading
from icedj import IceDJ
@ -7,6 +7,7 @@ def stop_program(_signo, _stack_frame):
os.remove(fifo_path)
sys.exit(0)
# FIXME: I think this is the thread that has 100% cpu usage for one core?
def add_song():
while True:
song = songq.get()

Loading…
Cancel
Save