Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d1ea292
Switch to yt-dlp, as youtube-dl is abandoned and now broken.
firetech May 6, 2023
d04c543
Make startup.sh executable.
firetech May 6, 2023
b21d520
Use tempfile.mkstemp() for uploaded files.
firetech May 6, 2023
e29a559
Handle (and show) upload errors without closing connection.
firetech May 6, 2023
f27f258
Go to next song when playing fails.
firetech May 6, 2023
655b052
Cleaner handling of Ctrl+C/SIGINT and SIGTERM.
firetech May 6, 2023
f57c6e1
Improve error styling, use addError() instead of alert().
firetech May 6, 2023
6956f4e
Attempt to preserve upload order when uploading multiple files.
firetech May 6, 2023
1deb59a
Increase max upload size to 150MB.
firetech May 6, 2023
e91215a
Allow video/* file uploads.
firetech May 6, 2023
dd6dc5e
Fix improper event thread handling.
firetech May 6, 2023
1baee08
Improve Drag & Drop handling.
firetech May 6, 2023
43ba355
Fix download functionality.
firetech May 6, 2023
1a872fb
Minor JS cleanup.
firetech May 7, 2023
c14b647
Fix download filename mistake.
firetech May 7, 2023
fa23007
Show [X] button based on IP instead of nick.
firetech May 7, 2023
3a676b8
Attempt to automatically reconnect to WebSocket.
firetech May 7, 2023
c3e7124
Cleanup imports.
firetech May 7, 2023
218c7a5
Add some options to main.py.
firetech May 7, 2023
a3ea888
Improved download URLs.
firetech May 7, 2023
d13b1ca
Add some non-breaking spaces in table.
firetech May 7, 2023
6b61c27
Improve drag & drop overlay logic.
firetech May 8, 2023
6c21686
Add buttons to upload files/links.
firetech May 8, 2023
4de190f
Minor JS cleanups.
firetech May 8, 2023
15615ab
Try to fix intermittent Soundcloud issues.
firetech May 8, 2023
790308f
Improve dubstep logic.
firetech May 8, 2023
f32c4b2
Queue up WebSocket messages while ws is down.
firetech May 8, 2023
458c93a
Add (commented out) option for tornado Application.
firetech May 8, 2023
18dc292
Add system service install script.
firetech May 9, 2023
f1f32c5
Add viewport meta tag to improve look in mobile browsers.
firetech May 9, 2023
040304b
Add pausing ability ("p" in console).
firetech May 9, 2023
7a6920c
Fix minor crash in mp3Juggler.get_list() when not yet running.
firetech May 9, 2023
56c9689
Minor restructuring of main.py.
firetech May 13, 2023
6870375
Try to fix race condition with clients waiting during startup.
firetech May 13, 2023
490f3e4
Player refactoring.
firetech May 13, 2023
f0535b4
Add support for Chromecast output.
firetech May 13, 2023
115fa28
Fix handling of arguments with whitespace in install-service.sh
firetech May 13, 2023
d77c798
Add favicon.
firetech May 13, 2023
ec98b8b
Improve file upload handling.
firetech May 13, 2023
833a3ee
Move file and link type checks to backend.
firetech May 13, 2023
38a730c
Add placeholder error text.
firetech May 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# mp3printer
a mp3 printer, written in python and jquery with websockets

You need python3, vlc, vlc bindings for python, youtube-dl and tornado. Start by running ```sudo sh startup.sh``` and the mp3 printer will listen for http requests at port 80.
You need python3, vlc, vlc bindings for python, yt-dlp and tornado, optionally pychromecast for casting support. Start by running `sudo ./startup.sh` and the mp3 printer will listen for http requests at port 80.
Running `./startup.sh --help` will show a list of possible options.

Record scratch sound is by "Raccoonanimator" and can be found here: https://freesound.org/people/Raccoonanimator/sounds/160907/

Icon is a combination of two icons from the [Tango Desktop Project](http://tango.freedesktop.org/).
8 changes: 4 additions & 4 deletions connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import json

class Connections:
def __init__(self):
def __init__(self, ioloop):
self.lock = Lock()
self._ioloop = ioloop
self._clients = []

def add_conneciton(self, handler):
def add_connection(self, handler):
self.lock.acquire()
try:
self._clients.append(handler)
Expand All @@ -20,11 +21,10 @@ def close_connection(self, handler):
finally:
self.lock.release()


def message_clients(self, message):
self.lock.acquire()
try:
for client in self._clients:
client.write_message(json.dumps(message))
self._ioloop.add_callback(client.write_message, json.dumps(message))
finally:
self.lock.release()
Loading