]> git.0d.be Git - django-panik-nonstop.git/commitdiff
misc: update publish to icecast command for python3
authorFrédéric Péters <fpeters@0d.be>
Mon, 22 Jun 2020 14:37:52 +0000 (16:37 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 22 Jun 2020 14:37:52 +0000 (16:37 +0200)
nonstop/management/commands/publish_to_icecast.py

index b1f239d8a016123b546ae8bfc5c68747261a3f4c..4daa6c55d45a9dd9978dcd869ac9938ad86b0999 100644 (file)
@@ -1,5 +1,5 @@
 import requests
-import urllib
+import urllib.parse
 import unicodedata
 
 from django.core.management.base import BaseCommand, CommandError
@@ -41,7 +41,7 @@ class Command(BaseCommand):
             else:
                 onair_msg = onair_txt.encode('utf-8')
             try:
-                r = requests.get(stream_url + '&song=' + urllib.quote(onair_msg), timeout=5)
+                r = requests.get(stream_url + '&song=' + urllib.parse.quote(onair_msg), timeout=5)
                 r.raise_for_status()
             except Exception as e:
                 print('failed to update', e)