diff --git a/avs/alexa.py b/avs/alexa.py index 6928ac0..13ce30e 100755 --- a/avs/alexa.py +++ b/avs/alexa.py @@ -320,7 +320,7 @@ def iter_lines(response, delimiter=None): logger.debug(json_payload) if 'directive' in json_payload: directives.append(json_payload['directive']) - else: + elif content_type == "application/octet-stream": logger.info("Finished downloading {} which is {}".format( content_type, content_id)) payload.seek(0) @@ -331,9 +331,9 @@ def iter_lines(response, delimiter=None): filename = hashlib.md5(filename).hexdigest() with open(os.path.join(tempfile.gettempdir(), '{}.mp3'.format(filename)), 'wb') as f: f.write(payload.read()) - logger.info('write audio to {}.mp3'.format(content_id)) - + else: + logger.info("Finished downloading {} which is {} abandon it".format(content_type, content_id)) continue elif on_boundary: # logger.debug("Now in header")