Commit 2d2d58c0 authored by fred's avatar fred

limit aac metadata to ascii characters :/

parent aeaa194a
import requests
import urllib
import unicodedata
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
......@@ -35,5 +36,9 @@ class Command(BaseCommand):
return
for stream_url in settings.STREAM_UPDATE_URLS:
r = requests.get(stream_url + '&song=' + urllib.quote(onair_txt.encode('utf-8')), timeout=5)
if '.aac' in stream_url:
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()
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