Skip to content

Lyrics: "too many 429 error responses" during bulk import (similar to #6728) #7226

Backlog

Description

@dannn-o

Problem

I have recently been importing multiple albums, and have been receiving consistent "429 errors"
on just about every song during lyric lookup. A typical example follows:

lyrics: Genius: Request error: HTTPSConnectionPool(host='api.genius.com', port=443): Max retries exceeded with url: /search?q=Umphrey%27s+McGee+Prophecy+Now (Caused by ResponseError('too many 429 error responses'))

I was at beets version 2.12.0, and searching Github issues I found one that was very similar: #6728 .
It was closed and merged on June 11, which was very close to when 2.12.0 was released. So, I tried
upgrading earlier today to beets version 2.14.1, figuring the fix should be included (though, I couldn't
find it itemized in the fixes listed under "Releases"). However, the issue persists even after upgrading.

Lyrics tend to be successfully found and imported in spite of the 429 errors, but it adds significantly
to the processing time.

Setup

  • OS: Linux Mint 22.3 (Cinnamon 6.6.9)
  • Python version: 3.12.3
  • beets version: 2.14.1 (latest)
  • Turning off plugins made problem go away (yes/no): yes

My configuration (output of beet config) is:

directory: ~/Music
library: ~/data/musiclibrary.blb
asciify_paths: yes
id3v23: yes
plugins: lyrics fetchart zero embedart scrub importreplace musicbrainz discogs

ui:
    color: yes

import:
    move: yes
    write: yes
    log: /home/dan/Music/import-log.txt
    timid: yes

zero:
    fields: comments day
    
lyrics:
    force: yes
    google_API_key: <Removed>
    # sources: google, tekstowo, lrclib, genius
    sources: [lrclib, genius, google, lrcmux]

embedart:
    maxwidth: 300
    remove_art_file: yes

fetchart:
    cautious: true
    sources: 
      - filesystem 
      - coverart: release
      - coverart: releasegroup
      - itunes

syncpl:
    dest: /media/dan/HulkTunes
    playlist_dir: /home/dan/Desktop
    include_playlist: yes
    delete: no
    playlists: HulkTunes

importreplace:
  replacements:
    - item_fields: title artist artist_sort artist_credit
      album_fields: album artist artist_sort artist_credit
      replace:
        '[\u2018-\u201B]': ''''
        '[\u201C-\u201F]': '"'
        '[\u2010-\u2015]': '-'

Activity

  1. Sabrina04072003 commented on Nov 30, 2026

    @Sabrina04072003
    Contributor

    Hi! I would like to work on this issue.

    I looked at the code: all requests go through TimeoutAndRetrySession (6 retries, backoff 0.5) and one rate limiter (0.25 s between requests) that is shared by every site. My guess is that this is too fast for Genius.

    My proposal: make the rate limiter keep a separate timer per site, so that Genius can be given a slower limit while the other sources keep their current speed.

    Other options would be to retry longer on 429, or to give up on a source sooner and show a clear message. I think the first one avoids the errors instead of reacting to them, but I am happy to do it differently if you prefer.

  2. dannn-o commented on Nov 30, 2026

    @dannn-o
    Author

    Thanks for the reply. For my particular situation, this does seem to happen most often with Genius, but I'm not familiar with
    the code and don't know if a Genius-specific change would be best. It seems that another fix, #6729 , intended to add a
    rate limiting throttle for 429 errors, but that was also from the June '26 time frame and so I would think that is included
    in the 2.14.1 version I upgraded to.

    But, if Genius is the outlier and changing it to a slower limit seems feasible, that seems like a reasonable approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lyrics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions