From b7d33b8e8f8364e4ba5da651c5f2f1c854b10971 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Mon, 14 Dec 2020 14:40:54 -0500 Subject: [PATCH] tuner --- fHDHR/device/tuners/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fHDHR/device/tuners/__init__.py b/fHDHR/device/tuners/__init__.py index 7ddbb8d..b90715b 100644 --- a/fHDHR/device/tuners/__init__.py +++ b/fHDHR/device/tuners/__init__.py @@ -95,12 +95,15 @@ class Tuners(): if not stream_args["channelUri"]: raise TunerError("806 - Tune Failed") - channelUri_headers = self.fhdhr.web.session.head(stream_args["channelUri"]).headers - stream_args["true_content_type"] = channelUri_headers['Content-Type'] + if "udp:" not in stream_args["channelUri"]: + channelUri_headers = self.fhdhr.web.session.head(stream_args["channelUri"]).headers + stream_args["true_content_type"] = channelUri_headers['Content-Type'] - if stream_args["true_content_type"].startswith(tuple(["application/", "text/"])): - stream_args["content_type"] = "video/mpeg" + if stream_args["true_content_type"].startswith(tuple(["application/", "text/"])): + stream_args["content_type"] = "video/mpeg" + else: + stream_args["content_type"] = stream_args["true_content_type"] else: - stream_args["content_type"] = stream_args["true_content_type"] + stream_args["content_type"] = "video/mpeg" return stream_args