Merge pull request #5 from SeBaBu/add-empty-line-check-m3u

Added length check and new station
This commit is contained in:
Martin Brodbeck 2017-03-20 12:06:21 +01:00 committed by GitHub
commit d8113b9cc9
2 changed files with 2 additions and 1 deletions

View file

@ -108,7 +108,7 @@ def record(args):
verboseprint('Seems to be an M3U playlist. Trying to parse...')
with urllib.request.urlopen(streamurl) as remotefile:
for line in remotefile:
if not line.decode('utf-8').startswith('#'):
if not line.decode('utf-8').startswith('#') and len(line) > 1:
tmpstr = line.decode('utf-8')
break
streamurl = tmpstr

View file

@ -8,5 +8,6 @@ dlf = http://www.deutschlandradio.de/streaming/dlf.m3u
dwissen = http://dradio_mp3_dwissen_m.akacast.akamaistream.net/7/728/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dwissen_m
erfplus = http://c14000-l.i.core.cdn.streamfarm.net/14000cina/live/3212erf_96/live_de_96.mp3
mdrklassik = http://avw.mdr.de/livestreams/mdr_klassik_live_128.m3u
radioeins = http://www.radioeins.de/live.m3u
swr2 = http://mp3-live.swr.de/swr2_m.m3u
wdr3 = http://www.wdr.de/wdrlive/media/mp3/wdr3_hq.m3u