From bf10be6b86e79178c1400de632528d7cea08fc76 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 17 Sep 2013 10:23:32 +0200 Subject: [PATCH] Station added to filename --- radiorec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radiorec.py b/radiorec.py index 4aae276..71aeabb 100755 --- a/radiorec.py +++ b/radiorec.py @@ -36,9 +36,9 @@ def read_settings(): config.read(settings_base_dir + 'settings.ini') return dict(config.items()) -def record_worker(stoprec, streamurl, target_dir, name=None): +def record_worker(stoprec, streamurl, target_dir, station, name=None): conn = urllib.request.urlopen(streamurl) - filename = target_dir + os.sep + datetime.datetime.now().isoformat() + filename = target_dir + os.sep + datetime.datetime.now().isoformat() + "_" + station if name: filename += '_' + name content_type = conn.getheader('Content-Type') @@ -81,7 +81,7 @@ def record(args): verboseprint('Recording ' + args.station + '…') recthread = threading.Thread(target = record_worker, - args = (stoprec, streamurl, target_dir, args.name), daemon = True) + args = (stoprec, streamurl, target_dir, args.station, args.name), daemon = True) recthread.start() recthread.join(args.duration * 60)