From 8915773706a1e0ba93e1d0615a7fcffe6c0f161f Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 22 Sep 2018 20:05:13 -0500 Subject: [PATCH] Fix transcode flac and live tv --- resources/lib/helper/playutils.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/resources/lib/helper/playutils.py b/resources/lib/helper/playutils.py index 8e9df5f7..7464f4bd 100644 --- a/resources/lib/helper/playutils.py +++ b/resources/lib/helper/playutils.py @@ -213,8 +213,8 @@ class PlayUtils(object): info = TheVoid('GetLiveStream', params).get() LOG.info(info) - if info['RequiresClosing']: - self.info['LiveStreamId'] = info['LiveStreamId'] + if info['MediaSource'].get('RequiresClosing'): + self.info['LiveStreamId'] = info['MediaSource']['LiveStreamId'] return info['MediaSource'] @@ -235,7 +235,8 @@ class PlayUtils(object): params = "%s%s" % ('&'.join(url_parsed), self.get_audio_subs(source, audio, subtitle)) - self.info['Path'] = "%s/emby%s?%s" % (self.info['ServerAddress'], base.replace('stream', "master"), params) + video_type = 'live' if source.get('LiveStreamId') else 'master' + self.info['Path'] = "%s/emby%s?%s" % (self.info['ServerAddress'], base.replace('stream', video_type), params) self.info['Path'] += "&maxWidth=%s&maxHeight=%s" % (self.get_resolution()) return self.info['Path'] @@ -293,7 +294,8 @@ class PlayUtils(object): }, { "Container": "m3u8", - "Type": "Video" + "Type": "Video", + "AudioCodec": "aac,mp3,ac3,opus,flac,vorbis" }, { "Container": "jpeg", @@ -410,6 +412,20 @@ class PlayUtils(object): } ] + if self.item['Type'] == 'TvChannel': + profile['TranscodingProfiles'].insert(0, { + "Container": "ts", + "Type": "Video", + "AudioCodec": "mp3,aac", + "VideoCodec": "h264", + "Context": "Streaming", + "Protocol": "hls", + "MaxAudioChannels": "2", + "MinSegments": "1", + "BreakOnNonKeyFrames": True + }) + + return profile def set_external_subs(self, source, listitem):