npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@addasoft/art-downloader

v1.14.1

Published

download artist and album art based on the MBID

Downloads

38

Readme

Art-downloader

Download artist art based on their MBID. This node.js program reads a JSON-based music file as used by JSMusicDB, whose structure is based on scanner.py. For each found artist both fanart and Deezer are queried to find art for the artist. If a lot of artists need to be queried a rate limit can occur. If that is the case the program will sleep for 1 minute and then try again. Please be patient while we do our best to find all the art.

Config

The following variables should be set in .env:

  • LASTFMAPIKEY: your last.fm API key. Used to fetch metadata about the found artist. Mainly used for rapid MBID lookup.
  • FANARTAPIKEY: your fanart API key. Used for looking up missing art at fanart.
  • OUTPUT_FOLDER: optional the output folder for cache and status files.
  • ART_FOLDER: optional the output folder for the art images; defaults to OUTPUT_FOLDER/art/.
  • MUSIC_FILE: optional full path to your JSMusicDB compatible music file; defaults to ./src.
  • SOURCE_BASE: optional the base folder to which the paths in MUSIC_FILE resolve. Used when trying to write art to the source folders.

Options

  • --skipArtists will skip all processing for artists.
  • --skipAlbums will skip all processing for albums.
  • --turbo only download art for newly fetched MBIDs.
  • --printArtistsWithoutArt will print a list of all artists and their MBID for which no art is found.
  • --printArtists will print a list of all artists and their MBID.
  • --printAlbums will print a list of all albums and the URL to the source of the art
  • --printAlbumsWithoutArt will print a list of all albums that have no source for their MBID
  • --updateLib will extend the source MUSIC_FILE with the MBIDs
  • --writeSource will write cover.[jpg|png|webp|...] files in the folder per album found in SOURCE_BASE
  • --daemon output minimal progress to output folder in the file progress.txt

Tip: you can export the output of --printArtists and --printAlbums to a file. For example: npm run start --printAlbums > albums.txt

Output

Art is downloaded to ART_FOLDER or ./output/art/ if ART_FOLDER is not specified in .env.

The output logs are stored in ./output and will contain 2 parts:

  • artists.json a map of all cached artist <> MBID pairs found. This is used to speed up the process the next time you run the application.
  • albums.json a map of all cached albums <> {MBID, URL} pairs found. Since last.fm has the album art and does the MBID lookup the data is stored in one go.
  • artists-without-art.json a map of all artists <> MBID for which no art could be found, neither cached nor online. You can use the MBID to save your art for example.