Files
streamrip-go/config.toml.example
T
JorenandClaude Opus 5 da4add57fe perf: allow request bursts, reuse album track metadata; feat: qobuz lyrics
Two related changes: a 68-track Qobuz album was gated by the API throttle
rather than the network, and Qobuz lyrics are now supported, which is what the
faster album path had to be designed around.

--- perf ---

ratelimit: token bucket instead of fixed spacing
  The limiter spaced every request exactly interval apart with no burst, so at
  the default 60 requests/minute it allowed exactly one request per second no
  matter how many workers ran. Measured: 8 requests took 7s with 1 worker and
  7s with 6, i.e. max_connections had no effect on anything touching the API.
  Since a track needs its metadata and stream URL before downloading, workers
  could only start a track every two seconds, which is why an album looked
  serial even at 57 MiB/s per track.

  New() now takes a burst (providers pass max_connections), idle time accrues
  budget up to that burst, and burst is clamped to one minute's worth of
  requests so a large max_connections cannot bypass a small configured rate.

app: reuse the track objects already in the album payload
  ripAlbum fetched the album, kept only the track ids, then asked the provider
  for every track again, doubling the request count. Providers opt in via
  AlbumTracksAreComplete(); only Qobuz does, because it is only verified there
  and because Tidal does extra work in its track lookup.

  Verified against the live Qobuz API on a 68-track release: the embedded track
  objects already carry title, version, track_number, media_number,
  parental_warning, isrc, copyright, performer, performers, composer, duration,
  audio_info, maximum_bit_depth, maximum_sampling_rate and
  release_date_original. The only field a per-track lookup adds that this app
  reads is the nested album object, so albumTrackMetadata attaches the parent
  album with its own track list stripped, or a 68-track album would hold 68
  copies of itself. trackMetaUsable refetches anyway when title or track number
  is missing, so a thin payload cannot produce a wrongly named file.

  Measured end-to-end through the real app and limiter at the shipped defaults,
  68 tracks: 137 API calls / 2m11s before, 69 calls / 1m3s after.

--- qobuz lyrics ---

Qobuz's main API does not serve lyrics: has_lyrics is only a flag, extra=lyrics
adds nothing, and track/getLyrics does not exist. Its apps use a two-step flow
instead, confirmed live:

  GET track/lyricsUrl?track_id=&app_id=&request_ts=&request_sig=
    -> {"track_id","album_id","lyrics_url"}      (signed CloudFront URL)
  GET <lyrics_url>
    -> {"original":{"type","lang","lines":[{"line","start","end"}]},
        "translation_langs":[...],"writers","publishers":[...]}

type is plain, lsync or wsync; start/end are milliseconds; the line text is
under "line". Passing a language returns a translation instead of the original,
and only for languages that exist for the track (en 403s on an English song),
so the language parameter is deliberately omitted. A 403 on the signed URL is
how Qobuz represents "no lyrics", so it is not treated as an error.

Lyrics are exposed through a TrackLyrics method rather than inside GetMetadata,
because album rips skip the per-track metadata call. That keeps the fast path:
with lyrics on, an album costs the same two provider calls per track it always
did, and the lyrics document itself comes from a CDN that does not consume the
provider's request budget. With metadata.exclude = ["lyrics"] it drops to one
call per track and the full speedup applies.

Existing behaviour is preserved: Tidal and Deezer already attach lyrics in
their metadata, so attachLyrics leaves them alone, and a lyrics failure is
logged and ignored rather than failing a download.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-03 21:55:48 +02:00

215 lines
7.5 KiB
TOML

[downloads]
# Folder where tracks are downloaded to
folder = "/path/to/StreamripDownloads"
# Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal', etc.
source_subdirectories = false
# Put tracks in albums with 2+ discs into subfolders named `Disc N`
disc_subdirectories = true
# Download (and convert) tracks concurrently instead of sequentially
concurrency = true
# The maximum number of tracks to download at once
# Set to -1 for no limit
max_connections = 6
# Max number of API requests per source per minute. Set to -1 for no limit.
#
# This is the usual cause of a large album feeling slow: every track needs a
# stream-URL lookup, so a 68-track album is ~69 requests and at 60/minute that
# is a minute of waiting before the audio is even reached. Requests are
# allowed to burst up to max_connections, so raising this is what lets several
# tracks download at once. Raise it if your provider tolerates it.
requests_per_minute = 60
# Verify SSL certificates for API connections
# Set to false only if certificate verification fails (not recommended)
verify_ssl = true
[qobuz]
# Quality ladder (global scale is 0-4, Qobuz supports 1-4):
# 1 = MP3 320, 2 = FLAC 16/44.1, 3 = FLAC 24-bit <=96kHz, 4 = FLAC 24-bit <=192kHz
quality = 3
# Authenticate using Qobuz auth token instead of email/password hash
use_auth_token = false
# If use_auth_token=true, set your user id. Otherwise set your email.
email_or_userid = ""
# If use_auth_token=true, set your auth token. Otherwise set md5(password).
password_or_token = ""
# Managed automatically by streamrip-go
app_id = ""
# Managed automatically by streamrip-go
secrets = []
# Vendor app credentials. Leave empty to use the values built into
# streamrip-go; set them only if Qobuz rotates theirs and you need to
# patch your install without waiting for a new release.
mobile_app_id = ""
mobile_app_secret = ""
[tidal]
# Quality ladder:
# 0 = LOW (HEAACV1), 1 = HIGH (AACLC), 2 = LOSSLESS (FLAC), 3/4 = HI_RES_LOSSLESS when available
# If a tier is unavailable, Tidal may fall back to the best available stream for that track.
quality = 3
# Prefer Dolby Atmos/immersive stream variants when available
# Disabled by default because stereo FLAC is usually preferred
prefer_atmos = false
# Download videos included in supported Tidal media
download_videos = true
# Session values are managed automatically. Do not modify manually.
user_id = ""
country_code = ""
access_token = ""
refresh_token = ""
# Unix timestamp when access_token expires
token_expiry = 0
# Vendor app credentials. Leave empty to use the values built into
# streamrip-go; set them only if Tidal rotates theirs and you need to
# patch your install without waiting for a new release.
app_client_id = ""
app_client_secret = ""
[deezer]
# Quality ladder:
# 0 = MP3_128, 1 = MP3_320, 2/3/4 = FLAC
quality = 2
# If target quality is unavailable, fallback down quality ladder
lower_quality_if_not_available = true
# Deezer ARL cookie (recommended auth method)
arl = ""
# Optional login alternative when ARL is not provided
email = ""
password = ""
# Optional cached Deezer refresh token. Managed automatically when available.
refresh_token = ""
# Vendor app credentials. Leave empty to use the values built into
# streamrip-go; set them only if Deezer rotates theirs and you need to
# patch your install without waiting for a new release.
api_key = ""
gateway_key = ""
# Must be exactly 16 characters if set.
blowfish_secret = ""
[yandex]
# Quality ladder:
# 0 = LOW (HE-AAC/AAC when available), 1 = HIGH (AAC/MP3 192), 2/3/4 = LOSSLESS when available
quality = 2
# OAuth access token for api.music.yandex.net
access_token = ""
# Cached current account uid. Managed automatically when available.
user_id = ""
# Vendor app credentials. Leave empty to use the values built into
# streamrip-go; set them only if Yandex rotates theirs and you need to
# patch your install without waiting for a new release.
sign_key = ""
legacy_mp3_sign_salt = ""
[beatport]
# Quality ladder:
# 1 = medium (AAC 128), 2 = high (AAC 256), 3/4 = lossless (FLAC 16/44.1)
# medium-hls is intentionally not supported.
quality = 3
# If a release lists more artists than this, use "Various Artists" as album artist.
# Set to -1 to disable this collapse.
various_artists_threshold = 3
# Beatport Streaming account credentials
username = ""
password = ""
# Session values are managed automatically. Do not modify manually.
access_token = ""
refresh_token = ""
# Unix timestamp when access_token expires
token_expiry = 0
# Vendor app credentials. Leave empty to use the values built into
# streamrip-go; set them only if Beatport rotates theirs and you need to
# patch your install without waiting for a new release.
app_client_id = ""
[soundcloud]
# Quality is currently provider-defined (keep 0)
quality = 0
[database]
# Track IDs already downloaded are stored here and skipped next time
downloads_enabled = true
downloads_path = "/path/to/.config/streamrip/downloads.db"
# Failed item IDs are stored here for retry/repair workflows
failed_downloads_enabled = true
failed_downloads_path = "/path/to/.config/streamrip/failed_downloads.db"
[conversion]
# Convert tracks after download
enabled = false
# ALAC, FLAC, OGG, MP3, or AAC
codec = "ALAC"
# In Hz. Audio is downsampled when above this rate.
sampling_rate = 48000
# Applied only when source bit depth is higher than this value
bit_depth = 24
# Used for lossy codecs
lossy_bitrate = 320
[qobuz_filters]
# Filter a Qobuz artist discography (best-effort for other sources)
extras = false
repeats = false
non_albums = false
features = false
non_studio_albums = false
non_remaster = false
[artwork]
# Embed artwork in the audio file
embed = true
# thumbnail, small, large, or original
embed_size = "large"
# If > 0, embedded image max(width, height) in pixels
embed_max_width = -1
# Save artwork as separate jpg file
save_artwork = true
# If > 0, saved image max(width, height) in pixels
saved_max_width = -1
[metadata]
# Set ALBUM metadata to playlist name for playlist items
set_playlist_to_album = true
# Use playlist position as tracknumber for playlist items
renumber_playlist_tracks = true
# Separator used when a provider exposes multiple artists as separate values
artist_separator = "; "
# Metadata fields to exclude from tagging.
#
# "lyrics" is worth knowing about: Qobuz, Tidal and Deezer each serve lyrics
# from a separate endpoint, so fetching them costs one extra API request per
# track and is subject to requests_per_minute above. Set
# exclude = ["lyrics"] if you do not want lyrics and would rather have the
# faster rip.
exclude = []
[filepaths]
# Create folders for single tracks using folder_format template
add_singles_to_folder = false
# Available keys: albumartist, title, year, bit_depth, sampling_rate, id, container, codec, quality, bitrate, albumcomposer
folder_format = "{albumartist} - {title} ({year}) [{container}] [{bit_depth}B-{sampling_rate}kHz]"
# Available keys: id, tracknumber, artist, albumartist, composer, title, albumcomposer, explicit
track_format = "{tracknumber:02}. {artist} - {title}{explicit}"
# Restrict filenames to printable ASCII
restrict_characters = false
# Truncate filenames longer than this value
truncate_to = 120
[lastfm]
# Primary source used to resolve Last.fm playlist tracks
source = "qobuz"
# Fallback source when primary lookup fails
fallback_source = ""
[cli]
# Print informational output like "Downloading <album>"
text_output = true
# Show resolve and download progress bars
progress_bars = true
# Max interactive search results displayed
max_search_results = 100
[misc]
# Metadata used for config compatibility checks
version = "2.2.0"