Skip to content

Commit

Permalink
plugins.viasat: Fix stream mapping.
Browse files Browse the repository at this point in the history
Resolves #750.
  • Loading branch information
chrippa committed Mar 7, 2015
1 parent 3ac997b commit 0a3521b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/livestreamer/plugins/viasat.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,24 @@ def _extract_streams(self, stream_id):
stream_info = http.json(res, schema=_stream_schema)

mapper = StreamMapper(lambda pattern, video: re.search(pattern, video[1]))
mapper.map(r"\.m3u8$", self._create_dynamic_streams, "HLS", HLSStream.parse_variant_playlist)
mapper.map(r"\.f4m$", self._create_dynamic_streams, "HDS", HDSStream.parse_manifest)
mapper.map(
r"/master\.m3u8",
self._create_dynamic_streams,
"HLS", HLSStream.parse_variant_playlist
)
mapper.map(
r"/manifest\.f4m",
self._create_dynamic_streams,
"HDS", HDSStream.parse_manifest
)
mapper.map(r"^rtmp://", self._create_rtmp_stream)

return mapper(stream_info.items())

def _get_streams(self):
match = _url_re.match(self.url)
stream_id = match.group("stream_id")
print(stream_id)

return self._extract_streams(stream_id)

Expand Down

0 comments on commit 0a3521b

Please sign in to comment.