diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 6a068a16a..6387ddc60 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -15,6 +15,7 @@ """Allows beets to embed album art into file metadata.""" import os.path +import traceback from io import BytesIO import requests @@ -84,7 +85,7 @@ class EmbedCoverArtPlugin(BeetsPlugin): embed_cmd.parser.add_option("-y", "--yes", action="store_true", help="skip confirmation") - embed_cmd.parser.add_option('-u', '--url', action="store_true", + embed_cmd.parser.add_option('-u', '--url', metavar='URL', help='the URL of the image file to embed') maxwidth = self.config['maxwidth'].get(int) @@ -125,8 +126,10 @@ class EmbedCoverArtPlugin(BeetsPlugin): try: with open('temp.jpg', 'wb') as f: f.write(response.content) - except util.FilesystemError as exc: - self._log.error('Error writing file: {}', exc) + except OSError as exc: + raise util.FilesystemError(exc, 'write', + bytestring_path('temp.jpg'), + traceback.format_exc()) opts.file = 'temp.jpg' items = lib.items(decargs(args)) # Confirm with user.