From a3a8fa97fab2daf7f93e2f6933e88fe691632316 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Mon, 16 Sep 2013 16:28:47 +0200 Subject: [PATCH] Improved content type handling --- radiorec.py | 6 +++++- settings.ini | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/radiorec.py b/radiorec.py index c27f7b2..d9cb3e5 100755 --- a/radiorec.py +++ b/radiorec.py @@ -46,8 +46,12 @@ def record_worker(stoprec, streamurl, target_dir, name=None): filename += '.mp3' elif(content_type == 'application/ogg' or content_type == 'audio/ogg'): filename += '.ogg' + elif(content_type == 'audio/x-mpegurl'): + #TODO Add support for M3U playlists + print('Sorry, M3U playlists are currently not supported') + sys.exit() else: - print('Unknown content type. Assuming mp3.') + print('Unknown content type "' + content_type + '". Assuming mp3.') filename += 'mp3' target = open(filename, "wb") while(not stoprec.is_set() and not conn.closed): diff --git a/settings.ini b/settings.ini index aeb56c6..abb6969 100644 --- a/settings.ini +++ b/settings.ini @@ -5,6 +5,6 @@ target_dir = $HOME/Arbeitsfläche dlf = http://dradio_mp3_dlf_m.akacast.akamaistream.net/7/249/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dlf_m dkultur = http://dradio_mp3_dkultur_m.akacast.akamaistream.net/7/530/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dkultur_m dwissen = http://dradio_mp3_dwissen_m.akacast.akamaistream.net/7/728/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dwissen_m -swr2 = http://mp3-live.swr.de/swr2_m.m3u -brklassik = http://streams.br-online.de/br-klassik_2.m3u -mdrklassik = http://avw.mdr.de/livestreams/mdr_klassik_live_128.m3u +swr2 = http://swr-mp3-m-swr2.akacast.akamaistream.net/7/721/137135/v1/gnl.akacast.akamaistream.net/swr-mp3-m-swr2 +brklassik = http://gffstream.ic.llnwd.net/stream/gffstream_w13a +mdrklassik = http://c22033-l.i.core.cdn.streamfarm.net/22008mdrklassik/live/3087mdrklassik/live_de_128.mp3[brodbemn@pcvs90