Skip to content

Commit

Permalink
fetchart: Remove Google backend (fix #1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo committed Dec 13, 2015
1 parent 3314db2 commit 5597313
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 44 deletions.
31 changes: 1 addition & 30 deletions beetsplug/fetchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,34 +157,6 @@ def get(self, album):
self._log.debug(u'no image found on page')


class GoogleImages(ArtSource):
URL = 'https://ajax.googleapis.com/ajax/services/search/images'

def get(self, album):
"""Return art URL from google.org given an album title and
interpreter.
"""
if not (album.albumartist and album.album):
return
search_string = (album.albumartist + ',' + album.album).encode('utf-8')
response = self.request(self.URL, params={
'v': '1.0',
'q': search_string,
'start': '0',
})

# Get results using JSON.
try:
results = response.json()
data = results['responseData']
dataInfo = data['results']
for myUrl in dataInfo:
yield myUrl['unescapedUrl']
except:
self._log.debug(u'error scraping art page')
return


class ITunesStore(ArtSource):
# Art from the iTunes Store.
def get(self, album):
Expand Down Expand Up @@ -388,15 +360,14 @@ def get(self, path, cover_names, cautious):

# Try each source in turn.

SOURCES_ALL = [u'coverart', u'itunes', u'amazon', u'albumart', u'google',
SOURCES_ALL = [u'coverart', u'itunes', u'amazon', u'albumart',
u'wikipedia']

ART_SOURCES = {
u'coverart': CoverArtArchive,
u'itunes': ITunesStore,
u'albumart': AlbumArtOrg,
u'amazon': Amazon,
u'google': GoogleImages,
u'wikipedia': Wikipedia,
}

Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Fixes:
ImageMagick on Windows. :bug:`1721`
* Fix a crash when writing some Unicode comment strings to MP3s that used
older encodings. The encoding is now always updated to UTF-8. :bug:`879`
* :doc:`/plugins/fetchart`: The Google Images backend has been removed. It
used an API that has been shut down. :bug:`1760`

.. _Emby Server: http://emby.media

Expand Down
19 changes: 5 additions & 14 deletions docs/plugins/fetchart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ file. The available options are:
- **sources**: List of sources to search for images. An asterisk `*` expands
to all available sources.
Default: ``coverart itunes amazon albumart``, i.e., everything but
``wikipedia`` and ``google``. Enable those two sources for more matches at
``wikipedia``. Enable those two sources for more matches at
the cost of some speed.

Note: ``minwidth`` and ``enforce_ratio`` options require either `ImageMagick`_
Expand Down Expand Up @@ -94,7 +94,7 @@ no resizing is performed for album art found on the filesystem---only downloaded
art is resized. Server-side resizing can also be slower than local resizing, so
consider installing one of the two backends for better performance.

When using ImageMagic, beets looks for the ``convert`` executable in your path.
When using ImageMagick, beets looks for the ``convert`` executable in your path.
On some versions of Windows, the program can be shadowed by a system-provided
``convert.exe``. On these systems, you may need to modify your ``%PATH%``
environment variable so that ImageMagick comes first or use Pillow instead.
Expand All @@ -106,8 +106,9 @@ Album Art Sources
-----------------

By default, this plugin searches for art in the local filesystem as well as on
the Cover Art Archive, the iTunes Store, Amazon, AlbumArt.org,
and Google Image Search, and Wikipedia, in that order. You can reorder the sources or remove
the Cover Art Archive, the iTunes Store, Amazon, and AlbumArt.org, in that
order.
You can reorder the sources or remove
some to speed up the process using the ``sources`` configuration option.

When looking for local album art, beets checks for image files located in the
Expand Down Expand Up @@ -136,16 +137,6 @@ Once the library is installed, the plugin will use it to search automatically.
.. _python-itunes: https://github.com/ocelma/python-itunes
.. _pip: http://pip.openplans.org/

Google Image Search
'''''''''''''''''''

You can optionally search for cover art on `Google Images`_. This option uses
the first hit for a search query consisting of the artist and album name. It
is therefore approximate: "incorrect" image matches are possible (although
unlikely).

.. _Google Images: http://images.google.com/


Embedding Album Art
-------------------
Expand Down

0 comments on commit 5597313

Please sign in to comment.