Adding decode = true to the raw request object fixes issues with certain podcasts and corruption

This commit is contained in:
Robb Ebright 2017-10-07 18:48:39 -04:00
parent 29e7cc38a7
commit 5150f3add5
1 changed files with 1 additions and 0 deletions

View File

@ -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)