From da9c8079adcf7251210d944bf2ace1a9874be981 Mon Sep 17 00:00:00 2001 From: ailnlv Date: Sat, 28 Dec 2019 00:16:07 -0300 Subject: [PATCH] Open files as binary Fixes an error where serving to play video files would raise a UnicodeDecodeError exception --- dlnap/dlnap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlnap/dlnap.py b/dlnap/dlnap.py index 97b6acb..48c67bf 100755 --- a/dlnap/dlnap.py +++ b/dlnap/dlnap.py @@ -269,7 +269,7 @@ def do_GET(self): content_type = '' if os.path.exists(url): - f = open(url) + f = open(url, 'rb') content_type = mimetypes.guess_type(url)[0] size = os.path.getsize(url) elif not url or not url.startswith('http'):