Commit graph

302 commits

Author SHA1 Message Date
Alok Saboo
17591c3ffd Update fetchart.py 2023-04-29 13:30:50 -04:00
Alok Saboo
5cdd9b5747 Add to sources_all 2023-04-29 13:27:40 -04:00
Alok Saboo
17d2193c02 Add cover_art_url as fetchart source 2023-04-29 13:19:59 -04:00
Alok Saboo
d4eb3a6b82 Update fetchart.py 2023-04-28 18:05:27 -04:00
Alok Saboo
067a3633d3 Change error handling 2023-04-28 18:02:17 -04:00
Alok Saboo
34fe9344ae change preposition 2023-04-28 08:50:01 -04:00
Alok Saboo
654b57f50a Make beautifulsoup optional 2023-04-28 08:47:32 -04:00
Alok Saboo
036667c51e change variable to lower case 2023-04-27 18:13:39 -04:00
Alok Saboo
18bcadcfdc Add spotify art source 2023-04-27 18:10:09 -04:00
Mark Trolley
13ce920fd1
Fix cover art archive fetching
PR #3748 changed the way cover art is fetched from the cover art
archive, but the manual addition of a `-` to the width suffix that was
needed when the image URI was being constructed manually was not
removed. Because of this the plugin would try to look up the property
under `thumbnails` that didn't exist (for example `-1200` instead of
`1200`), which would fail.
2023-02-17 19:01:20 -05:00
Adrian Sampson
c5e68f5643
Adapt to pycodestyle changes 2022-07-30 19:54:24 -04:00
Arsen Arsenović
0b578a3384
fetchart: add option to force cover format 2021-11-03 13:31:33 +01:00
Piotrek Kochański
1a130059e8 deinterlace option to affect when no other processing
remove interlacing by default when resizing/down-scaling, the
`deinterlace` option is to remove interlace when otherwise no processing
would have happened.
2021-11-01 13:51:57 +01:00
Piotrek Kochański
417ef0d453 Merge branch 'master' of github.com:beetbox/beets into deinterlace 2021-10-31 13:27:00 +01:00
Andrew Rogl
9106b41a50 Remove as many as possible sys.version tests 2021-08-27 10:24:27 +10:00
Piotrek Kochański
d30c8b32b5 Remove unnecessary line break. 2021-08-26 15:02:51 +02:00
Andrew Rogl
ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Piotrek Kochański
0a0719f9ed Add plugin option to store cover art non-progressive. 2021-08-25 22:56:46 +02:00
wisp3rwind
9a6b65351b Merge pull request #3560 from davidswarbrick/master
Album Art Resize to filesize
2021-03-23 12:15:51 +01:00
wisp3rwind
af70b75670 fetchart/artresizer: Improve comments & docstrings, avoid os.stat if
possible

slight enhancements on top of https://github.com/beetbox/beets/pull/3560
2021-03-23 12:04:30 +01:00
David Swarbrick
07b5e69f40 fetchart/artresizer: add max_filesize support (#3560)
Squashed from the PR, relevant commit messages follow below:

Added file size option to artresizer

 - In line with comments on PR, adjusted the ArtResizer API to add
   functionality to "resize to X bytes" through `max_filesize` arg

 - Adjustment to changelog.rst to include max_filesize change to ArtResizer
   and addition of new plugin.

Added explicit tests for PIL & Imagemagick Methods

 - Checks new resizing functions do reduce the filesize of images

Expose max_filesize logic to fetchart plugin

- Add syspath escaping for OS cross compatibility
- Return smaller PIL image even if max filesize not reached.
- Test resize logic against known smaller filesize (//2)
- Pass integer (not float) quality argument to PIL
- Remove Pillow from dependencies
- Implement "max_filesize" fetchart option, including
  logic to resize and rescale if maxwidth is also set.

Added tests & documentation for fetchart additions.

Tests now check that a target filesize is reached with a
higher initial quality (a difficult check to pass).

With a starting quality of 95% PIL takes 4 iterations to succeed
in lowering the example cover image to 90% its original size.
To cover all bases, the PIL loop has been changed to 5 iterations
in the worst case, and the documentation altered to reflect the
50% loss in quality this implies. This seems reasonable as users
concerned about performance would most likely be persuaded to
install ImageMagick, or remove the maximum filesize constraint.
The previous 30% figure was arbitrary.
2021-03-23 12:00:14 +01:00
Aksh Gupta
79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
djl
33b10d60fb
fetchart: Improve Cover Art Archive source. (#3748)
* fetchart: Improve Cover Art Archive source.

Instead of blindly selecting the first image, we now treat all "front"
images as candidates.

This is useful where some digital releases have both an animated cover
and a still image and the animated image is the first image returned
from the API.
2020-09-13 20:27:12 +01:00
Mark Trolley
0f767ffa66 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes, and a thumbnail of
that size exists in the Cover Art Archive, fetch it directly
instead of fetching the full size image then resizing it.
2020-06-28 17:18:42 -04:00
Mark Trolley
a4c647be46 Revert "fetchart: Use Cover Art Archive thumbnails"
This reverts commit 2131f6f7d9.
2020-06-27 16:26:52 -04:00
Mark Trolley
3232a5b8b7 Revert "Indentation fix"
This reverts commit 1e527ed4e5.
2020-06-27 16:26:20 -04:00
Adrian Sampson
1e527ed4e5 Indentation fix 2020-06-27 12:49:32 -04:00
Mark Trolley
2131f6f7d9 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes fetch it directly
instead of fetching the full size image then resizing it.
2020-06-27 12:34:43 -04:00
pants108
1a79ae5a9f code review 1 2020-05-05 18:39:05 +00:00
pants108
a553693677 fetchart: clean up invalid tmp files 2020-05-03 17:58:44 +00:00
Kylie McClain
1c03f58e0d
fetchart: improve description of -q flag 2020-04-19 14:56:15 -04:00
Jack Wilsdon
333d5d1dd3
fetchart: Add Last.fm artwork source 2020-03-30 20:20:59 +01:00
Daniel Barber
fe8ba17ced Add quality setting to fetchart plugin 2020-02-22 13:36:35 -05:00
Daniel Barber
96b0e8a33e No longer need to pass a default quality here 2020-02-18 16:44:45 -05:00
Daniel Barber
86946ad4b7 Allow the quality to be set for embedded/fetched cover art 2020-02-17 21:12:20 -05:00
Adrian Sampson
91be732bf4 Fix whitespace (#3453) 2020-02-06 22:18:15 -05:00
Adrian Sampson
f9088a3eb7
Merge pull request #3453 from faulkt/master
added merge_environment_settings call
2020-02-06 21:54:14 -05:00
Tyler Faulk
964a6c2e63 restored whitespace to please style checker 2020-02-06 12:10:38 -05:00
Adrian Sampson
a08f2315ea Simplify Confuse usage (#3463) 2019-12-26 20:44:14 -05:00
Mat
2593a5be34 Use a local var to use high resolution option 2019-12-26 21:55:48 +00:00
Mat
3570f5cd56 New high_resolution config option in fetchart 2019-12-26 17:36:56 +00:00
Tyler Faulk
a1af5d280e added merge_environment_settings call in fetchart plugin to handle connections with proxy servers 2019-12-10 22:54:31 -05:00
FichteFoll
aa31fea037
Update a lot of URLs to use HTTPS
*All* URLs were checked manually, but only once per domain!

I mostly concerned myself with URLs in documentation rather than source
code because the latter may or may not have impactful changes, while the
former should be straight forward.

Changes in addition to simply adding an s:

- changed pip and pypi references as their location has changed
- MPoD (iOS app) url redirects to Regelian, so I replaced those
- updated homebrew references

Notable observations:

- beets.io does have HTTPS set up properly (via gh-pages)
- beatport.py uses the old HTTP url for beatport
- as does lyrics.py for lyrics.wikia.com
- https://tomahawk-player.org/ expired long ago, but the http page
  redirects to https regardless
- none of the sourceforge subdomains have https (in 2019!)
2019-06-05 03:11:49 +02:00
Carl Suster
6382c364e2 confit: replace with confuse in plugins 2019-06-01 10:03:41 +10:00
Carl Suster
546bf3af7e mediafile: import from standalone module 2019-05-29 09:35:14 +10:00
Jan Holthuis
c07903ed66 fetchart: Add some error handling to prevent crashes
Today I had some network problems regarding dbpedia.org, which made
beets crash because a requests.exceptions.ConnectionError was raised
("[Errno 113] No route to host"). This commits adds some error handling
around network requests to prevent further crashes in the future.
2019-02-19 16:16:56 +01:00
Reg
2ea77652a7 Fetchart: Respect ignore and ignore_hidden settings when fetching art
from the local filesystem.
2018-12-20 18:44:46 +01:00
Jack Wilsdon
5ad16983d4
Fix miscellaneous typos 2018-10-09 01:11:06 +01:00
nath@dp7510
399bfb985e fetchart: fix itunes debug info
Some typos + make it more useful overall
2018-08-15 13:56:39 +02:00
nath@dp7510
0107262ed3 fetchart: restore itunes art source
Reimplement minimalistic itunes scraper from scratch
2018-08-15 13:55:55 +02:00
wisp3rwind
318f0c4d16 Advanced fetchart source config: pep8 2018-02-24 11:26:50 +01:00
wordofglass
e7a3e27ed9 Advanced fetchart source config: Actually use the new syntax 2018-02-24 11:26:50 +01:00
wordofglass
2c1e4d878b Advanced fetchart source config: add the (still unused) match_by constructor argument 2018-02-24 11:26:50 +01:00
test
842f6afd7f Fix indentation 2017-11-10 14:04:16 +01:00
test
8544b3a830 Fix long line and add changelog entry 2017-11-10 13:46:26 +01:00
test
54297dbab4 Tentative fix for issue 2734: also check for RETAG 2017-11-05 12:04:40 +01:00
euri10
25fb2453b4 Modified the name of the fetchart plugin switch from missing to quiet 2017-09-05 18:27:47 +02:00
euri10
b2fd274e2c Added a missing switch to the fetchart command so that only missing albums
are displayed
2017-09-05 16:34:26 +02:00
wordofglass
bc582701ff fetchart: Internally pass settings in a cleaner way.
Dump the 'extra' dictionary which only duplicated attributes of the
plugin onject in favor of passing a reference to the plugin directly.
2017-01-25 00:01:05 +01:00
Adrian Sampson
f941fd42de Always use SSL on servers that don't require SNI
I did a little audit using the `openssl` command-line tool to find the servers
that don't require SNI. Here's what I found:

icbrainz.org: SNI
images.weserv.nl: inconclusive, but docs say yes SNI
coverartarchive.org: SNI
webservice.fanart.tv: *no* SNI
dbpedia.org: *no* SNI
en.wikipedia.org: *no* SNI
ws.audioscrobbler.com: *no* SNI
api.microsofttranslator.com: *no* SNI

In summary, *only* MusicBrainz and CoverArtArchive were found to require SNI.
So I'm using SSL unconditionally on all the other sites.
2017-01-02 20:39:10 -05:00
tigranl
471f875dc1 Fix typo 2016-12-10 21:26:51 +03:00
tigranl
68b4a03ecd Add tests for https 2016-12-10 19:54:44 +03:00
tigranl
21208b8c39 Add SNI_SUPPORTED 2016-12-08 19:09:15 +03:00
tigranl
efa90416a0 Add SNI_SUPPORTED
Add SNI_SUPPORTED
2016-12-06 19:51:15 +03:00
tigranl
73a7a4ff67 Add SNI_SUPPORTED variable for https check 2016-12-06 18:38:26 +03:00
nathdwek@laptop
a0877dc092 images: Make sure all jpegs work everywhere
Apply #1545 to a public function used everywhere
2016-11-08 18:48:44 +01:00
Johnny Robeson
fcbfce3984 replace deprecated log.warn() with log.warning() 2016-08-09 00:33:38 -04:00
Johnny Robeson
527b51147e add py3_path to NamedTemporaryFile suffixes 2016-07-02 04:53:57 -04:00
wordofglass
e2c6547635 fetchart: Clarify the deprecation of remote_priority in docs and
warning, closes #2092
2016-06-29 19:18:06 +02:00
Adrian Sampson
e16cc58cb9 Walk back some six.iter* uses
In places where it doesn't much matter whether we use an iterator or the old
Python 2 list way, using the six name just hurts legibility.
2016-06-25 18:29:55 -07:00
Adrian Sampson
736ad66518 Merge pull request #2066 from beetbox/use-six
Use the six package to handle py2/p3 compatibility
2016-06-25 18:09:56 -07:00
wordofglass
5d00ca8bda fetchart: do not unnecessarily reset Candidate.path on download failure 2016-06-25 14:10:55 +02:00
wordofglass
697291b04e fetchart: improve error resilience of the Content-Type detection by file magic 2016-06-25 14:10:50 +02:00
wordofglass
9968288358 fetchart: update comments 2016-06-25 13:49:15 +02:00
Johnny Robeson
edb1cbc5fc replace iter{items|values} with six.iter{items|values} 2016-06-24 05:53:55 -04:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
wordofglass
34cdf0f3f3 fetchart: complain about unsupported images only after validating the Content-Type 2016-06-23 17:38:01 +02:00
wordofglass
d47182a3e5 fetchart: do not rely on the server-provided Content-Type, but determine the image format from the file magic 2016-06-23 17:37:55 +02:00
Johnny Robeson
ea02269dee remove ext encode from fetchart (py3 fix for #2068) 2016-06-23 02:29:53 -04:00
wordofglass
c4617c2c1f fetchart: do not hardcode the downloaded extension to jpg, fixes #2053 2016-06-21 10:57:45 +02:00
Johnny Robeson
1c761c60fb bytstringify extra cover_names in fetchart 2016-06-17 03:37:28 -04:00
Johnny Robeson
a76de95183 return a bytestring path from RemoteArtSource 2016-06-12 01:19:39 -04:00
Johnny Robeson
ab67727283 wrap the cover_names map with a list in fetchart
most `cover_names` users expect to operate on a list
2016-06-10 00:09:15 -04:00
Adrian Sampson
f400a2431e fetchart: Fix path types on Windows 2016-06-08 10:20:25 -07:00
Johnny Robeson
81484529c9 remove b' from a few more stdlib calls 2016-05-31 00:13:09 -04:00
Adrian Sampson
09bc250413 Fix #1960: Unicode in fetchart Wikipedia source
The SparQL query needed to use a Unicode literal.
2016-04-26 16:59:23 -07:00
wordofglass
ac2f7fe712 Fix the fanarttv source failing when there were images found, but no cover art 2016-04-20 12:59:18 +02:00
wordofglass
5fbca32ea4 reuse the 'sources' names from the configuration for art_source 2016-04-19 11:25:03 +02:00
wordofglass
740efc0a0e small fixes; consistently use 'source' instead of 'origin' 2016-04-19 11:23:57 +02:00
wordofglass
c27907b043 enable fetchart to store the artworks origin in a flexible field; as of now untested 2016-04-19 11:23:42 +02:00
wordofglass
9e774fdccd Merge branch 'master' into fetchart_almost_square 2016-04-18 19:00:45 +02:00
wordofglass
c3be244109 remove the personal key warning altogether; it's also in the docs and rather obtrusive 2016-04-18 18:52:18 +02:00
wordofglass
20235264a4 rewire logic a bit; reasonable debug messages 2016-04-18 15:23:38 +02:00
wordofglass
30bca5c8af fix unconditionally printing the personal key warning for in fanart.tv in fetchart 2016-04-18 11:39:09 +02:00
wordofglass
6cbbba7dae initial work on allowing slightly non-square images in fetchart 2016-04-18 01:47:39 +02:00
wordofglass
8169983074 fix translation of the old remote_priority option for fetchart, add a test 2016-04-17 21:18:31 +02:00
wordofglass
36e91fc78b fix fanart.tv merge 2016-04-16 14:17:46 +02:00
wordofglass
9ce10c2fda Merge branch 'master' into fetchart_unify_sources,
i.e. adapt the fanart.tv source
2016-04-16 13:34:46 +02:00
wordofglass
4763fec35b fanart.tv: remove overly verbose logging left over from debugging 2016-04-15 19:42:06 +02:00