About this project

Freyr is a command-line tool for downloading music tracks from streaming services. Given a URL or short URI from Spotify, Apple Music or Deezer, it extracts track metadata (title, artist, album, track/disc number, release date, ISRC, label, copyright, cover art and more), then queries audio sources such as YouTube Music to find matching audio, downloads the raw file, encodes it to Apple AAC (.m4a) at a configurable bitrate (96–320kbps, default 320k), embeds metadata and album art, and organizes output into an ARTIST/ALBUM/TRACK directory structure. Supported query types include tracks, albums, artists and playlists. Batch downloads are possible by passing multiple queries as arguments or via an input file (-i/--input) where each line is a query and # marks comments. A urify subcommand converts between service URLs and freyr-compatible short URIs. Notable options include bitrate selection, concurrent chunk downloads (-n/--chunks), retry counts, custom output directory, checking other directories for existing tracks (-D), cover art naming and size or disabling it, source preference ordering (youtube, yt_music, with ! to exclude), metadata filters, concurrency tuning per stage (queries, tracks, trackStage, downloader, encoder, embedder), gapless playback flag, force overwrite, playlist generation (m3u8) with options for directory, appending, escaping and namespace prefixing, storefront country code, disabling tree organization, cache directory control, memory cache size, network timeout, authentication and browser launch toggles, progress bar styles, and an explicit AtomicParsley binary path. Installation is available via npm (npm install -g freyr) or Yarn, from source, or through official Docker images (freyrcli/freyrjs) with a documented docker run command and alias example. Requirements include Python >= 3.2, Node.js >= 16, and AtomicParsley >= 20230114. The README notes that YouTube Music must be available in the user's region because raw audio is sourced from it. The project is licensed and includes CI checks, CodeFactor grading, npm and Docker download badges, and donation links.