diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 5df9f2e5a..d623c9942 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -122,8 +122,12 @@ class EmbedCoverArtPlugin(BeetsPlugin): except OSError as e: self._log.error("Error: {}".format(e)) if img.format: - with open('temp.jpg', 'wb') as f: - f.write(response.content) + try: + with open('temp.jpg', 'wb') as f: + f.write(response.content) + except Exception as e: + self._log.error(f"Error writing file: {e}" + ) opts.file = 'temp.jpg' items = lib.items(decargs(args)) # Confirm with user.