|
a/rdpl2stream/fetchStream.py |
|
b/rdpl2stream/fetchStream.py |
|
... |
|
... |
32 |
|
32 |
|
33 |
urlInfo = decoder.getMediaStreamInfo(sys.argv[1])
|
33 |
urlInfo = decoder.getMediaStreamInfo(sys.argv[1])
|
34 |
|
34 |
|
35 |
while urlInfo is not None and urlInfo.isPlaylist():
|
35 |
while urlInfo is not None and urlInfo.isPlaylist():
|
36 |
playlist = decoder.getPlaylist(urlInfo)
|
36 |
playlist = decoder.getPlaylist(urlInfo)
|
37 |
if len(playlist) == 0:
|
37 |
if playlist is None or len(playlist) == 0:
|
38 |
logger.error("Received empty stream from station", file=sys.stderr)
|
38 |
logger.error("Received empty stream from station")
|
39 |
sys.exit(1)
|
39 |
sys.exit(1)
|
40 |
stream = playlist.pop(0)
|
40 |
stream = playlist.pop(0)
|
41 |
logger.info('Stream %s' % stream)
|
41 |
logger.info('Stream %s' % stream)
|
42 |
urlInfo = decoder.getMediaStreamInfo(stream)
|
42 |
urlInfo = decoder.getMediaStreamInfo(stream)
|
43 |
|
43 |
|