Commit 9afd969b authored by fred's avatar fred

don't fail on first icecast feed that fails to update

parent bc00b344
......@@ -40,5 +40,8 @@ class Command(BaseCommand):
onair_msg = unicodedata.normalize('NFKD', onair_txt).encode('ascii', 'ignore')
else:
onair_msg = onair_txt.encode('utf-8')
r = requests.get(stream_url + '&song=' + urllib.quote(onair_msg), timeout=5)
r.raise_for_status()
try:
r = requests.get(stream_url + '&song=' + urllib.quote(onair_msg), timeout=5)
r.raise_for_status()
except Exception, e:
print 'failed to update', e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment