Merge pull request #327 from Robbt/robbt-fix/podcast_download_decode_to_avoid_corruption
Fix podcast corruption by adding decode = true to the raw request object for the celery task
This commit is contained in:
commit
1add49efdf
1 changed files with 1 additions and 0 deletions
|
@ -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:
|
with closing(requests.get(url, stream=True)) as r:
|
||||||
filename = get_filename(r)
|
filename = get_filename(r)
|
||||||
with tempfile.NamedTemporaryFile(mode ='wb+', delete=False) as audiofile:
|
with tempfile.NamedTemporaryFile(mode ='wb+', delete=False) as audiofile:
|
||||||
|
r.raw.decode_content = True
|
||||||
shutil.copyfileobj(r.raw, audiofile)
|
shutil.copyfileobj(r.raw, audiofile)
|
||||||
# currently hardcoded for mp3s may want to add support for oggs etc
|
# currently hardcoded for mp3s may want to add support for oggs etc
|
||||||
m = MP3(audiofile.name, ID3=EasyID3)
|
m = MP3(audiofile.name, ID3=EasyID3)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue