Skip to content

Commit

Permalink
Merge pull request #402 from pNre/livetv-support
Browse files Browse the repository at this point in the history
Support live tv streams
  • Loading branch information
iwalton3 authored Aug 10, 2024
2 parents 0242ac5 + c3f0617 commit a3483a0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions jellyfin_mpv_shim/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,21 @@ def _get_url_from_source(self):
if self.media_source["SupportsDirectStream"]:
self.is_transcode = False
log.debug("Using direct url.")
return "%s/Videos/%s/stream?static=true&MediaSourceId=%s&api_key=%s" % (
query_params = {
"static": "true",
"MediaSourceId": self.media_source["Id"],
"api_key": self.client.config.data["auth.token"],
}

if "LiveStreamId" in self.media_source:
query_params["LiveStreamId"] = self.media_source["LiveStreamId"]

query = urllib.parse.urlencode(query_params)

return "%s/Videos/%s/stream?%s" % (
self.client.config.data["auth.server"],
self.item_id,
self.media_source["Id"],
self.client.config.data["auth.token"],
query,
)
elif self.media_source["SupportsTranscoding"]:
log.debug("Using transcode url.")
Expand Down

0 comments on commit a3483a0

Please sign in to comment.