Skip to content

Conversation

@wxifze
Copy link

@wxifze wxifze commented Sep 29, 2025

Sometimes a download fails with an error message in the form:

The Album/Track requested does not exist at: https://...

This happens during metadata fetch, before downloading the actual audio and image files. On the first run in a while, this error appears several minutes into the run. On a consecutive run, a different error appears immediately:

WARNING:bandcamp-dl.Main:Could not find music grid on the page. No albums found.

I reproduced this behavior from two geographically distinct IP addresses when downloading an artist with a large number of tracks using the --embed-* options:

bandcamp-dl --embed-lyrics --embed-art --embed-genres --artist adarook

This happens when the script reaches a per-IP request rate limit and the server begins to return 429 Too Many Requests for some requests. This can be confirmed by running the script with --debug or visiting bandcamp.com from a browser with the same IP.

This PR implements an optional global limit on the number of requests sent per minute.

It introduces a new config option, limit_req_per_minute, and a command line argument, --limit-req-per-minute, with equivalent semantics. The default value 0 disables rate limiting. Positive integers constrain the number of requests sent per minute using a leaky-bucket algorithm.

I did not test this on Python versions other than 3.13.7. This change adds a new dependency, requests-ratelimiter.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant