From 5150f3add5e3a873723144e4c7d434a4b840b8aa Mon Sep 17 00:00:00 2001 From: Robb Ebright Date: Sat, 7 Oct 2017 18:48:39 -0400 Subject: [PATCH] Adding decode = true to the raw request object fixes issues with certain podcasts and corruption --- python_apps/airtime-celery/airtime-celery/tasks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python_apps/airtime-celery/airtime-celery/tasks.py b/python_apps/airtime-celery/airtime-celery/tasks.py index 10b8ca2d1..c25f24528 100644 --- a/python_apps/airtime-celery/airtime-celery/tasks.py +++ b/python_apps/airtime-celery/airtime-celery/tasks.py @@ -153,6 +153,7 @@ def podcast_download(id, url, callback_url, api_key, podcast_name, album_overrid with closing(requests.get(url, stream=True)) as r: filename = get_filename(r) with tempfile.NamedTemporaryFile(mode ='wb+', delete=False) as audiofile: + r.raw.decode_content = True shutil.copyfileobj(r.raw, audiofile) # currently hardcoded for mp3s may want to add support for oggs etc m = MP3(audiofile.name, ID3=EasyID3)