diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index a815d4d9b..fa43025de 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -505,12 +505,18 @@ class ITunesStore(RemoteArtSource): payload['term']) return + if self._config['high_resolution'].get(): + image_suffix = '100000x100000-999' + else: + image_suffix = '1200x1200bb' + for c in candidates: try: if (c['artistName'] == album.albumartist and c['collectionName'] == album.album): art_url = c['artworkUrl100'] - art_url = art_url.replace('100x100', '1200x1200') + art_url = art_url.replace('100x100bb', + image_suffix) yield self._candidate(url=art_url, match=Candidate.MATCH_EXACT) except KeyError as e: @@ -520,7 +526,8 @@ class ITunesStore(RemoteArtSource): try: fallback_art_url = candidates[0]['artworkUrl100'] - fallback_art_url = fallback_art_url.replace('100x100', '1200x1200') + fallback_art_url = fallback_art_url.replace('100x100bb', + image_suffix) yield self._candidate(url=fallback_art_url, match=Candidate.MATCH_FALLBACK) except KeyError as e: @@ -774,6 +781,7 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): 'google_engine': u'001442825323518660753:hrh5ch1gjzm', 'fanarttv_key': None, 'store_source': False, + 'high_resolution': False, }) self.config['google_key'].redact = True self.config['fanarttv_key'].redact = True diff --git a/docs/changelog.rst b/docs/changelog.rst index 0608fb06c..e8a2717c5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,7 +6,11 @@ Changelog New features: -* :doc:`plugins/discogs` now adds two extra fields: `discogs_labelid` and +* :doc:`plugins/fetchart`: Added a new ``high_resolution`` config option to + allow downloading of higher resolution iTunes artwork (at the expense of + file size). + :bug: `3391` +* :doc:`plugins/discogs` now adds two extra fields: `discogs_labelid` and `discogs_artistid` :bug: `3413` * :doc:`/plugins/export`: Added new ``-f`` (``--format``) flag; diff --git a/docs/plugins/fetchart.rst b/docs/plugins/fetchart.rst index f23fec765..68212a582 100644 --- a/docs/plugins/fetchart.rst +++ b/docs/plugins/fetchart.rst @@ -67,6 +67,9 @@ file. The available options are: - **store_source**: If enabled, fetchart stores the artwork's source in a flexible tag named ``art_source``. See below for the rationale behind this. Default: ``no``. +- **high_resolution**: If enabled, fetchart retrieves artwork in the highest + resolution it can find (warning: image files can sometimes reach >20MB). + Default: ``no``. Note: ``maxwidth`` and ``enforce_ratio`` options require either `ImageMagick`_ or `Pillow`_.