HTTP Error followed by Max Retries Reached #255
Description
Checklist
- I've verified that I'm running the latest stable version of Spowlo or any later preview versions.
- I've checked that the YouTube Music is available in my country.
- I understand that the issue will be (ignored/closed) if I intentionally remove or skip any mandatory field.
Describe the bug
Tried downloading two playlists, it started downloading a few songs alright, but then started giving the error: "HTTP Error for GET to" for every song in the playlists. Then, when I tried again it gave a new error: ResponseError: too many 429 error responses
Also the entire log didn't fit in the error report section so the one I pasted there was just the second error
To Reproduce
Not sure? Maybe downloading the same playlist I did. https://open.spotify.com/playlist/1MQLlavqhKODDQdesaR1td?si=vAgCjTzhTLmgvQ5e3SmEmg&pi=e-CgG-ybNPR0Kh
Error reports
Processing query: https://open.spotify.com/playlist/3meCXuETLKdnocVqbwZtrm
Max Retries reached
An error occurred
ResponseError: too many 429 error responses
The above exception was the direct cause of the following exception:
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /data/user/0/com.bobbyesp.spowlo/no_backup/spotdl-android/packages/python/us │
│ r/lib/python3.11/site-packages/requests/adapters.py:667 in send │
│ │
│ 664 │ │ │ timeout = TimeoutSauce(connect=timeout, read=timeout) │
│ 665 │ │ │
│ 666 │ │ try: │
│ ❱ 667 │ │ │ resp = conn.urlopen( │
│ 668 │ │ │ │ method=request.method, │
│ 669 │ │ │ │ url=url, │
│ 670 │ │ │ │ body=request.body, │
│ r/lib/python3.11/site-packages/urllib3/connectionpool.py:944 in urlopen │
│ 941 │ │ │ response.drain_conn() │
│ 942 │ │ │ retries.sleep(response) │
│ 943 │ │ │ log.debug("Retry: %s", url) │
│ ❱ 944 │ │ │ return self.urlopen( │
│ 945 │ │ │ │ method, │
│ 946 │ │ │ │ url, │
│ 947 │ │ │ │ body, │
│ r/lib/python3.11/site-packages/urllib3/connectionpool.py:934 in urlopen │
│ 931 │ │ has_retry_after = bool(response.headers.get("Retry-After")) │
│ 932 │ │ if retries.is_retry(method, response.status, has_retry_after) │
│ 933 │ │ │ try: │
│ ❱ 934 │ │ │ │ retries = retries.increment(method, url, response=res │
│ 935 │ │ │ except MaxRetryError: │
│ 936 │ │ │ │ if retries.raise_on_status: │
│ 937 │ │ │ │ │ response.drain_conn() │
│ r/lib/python3.11/site-packages/urllib3/util/retry.py:519 in increment │
│ 516 │ │ │
│ 517 │ │ if new_retry.is_exhausted(): │
│ 518 │ │ │ reason = error or ResponseError(cause) │
│ ❱ 519 │ │ │ raise MaxRetryError(_pool, url, reason) from reason # typ │
│ ignore[arg-type] │
│ 520 │ │ │
│ 521 │ │ log.debug("Incremented Retry for (url='%s'): %r", url, new_ret │
│ 522 │
╰──────────────────────────────────────────────────────────────────────────────╯
MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max
retries exceeded with url:
/v1/playlists/3meCXuETLKdnocVqbwZtrm/tracks?offset=100&limit=100&additional_type
s=track (Caused by ResponseError('too many 429 error responses'))
During handling of the above exception, another exception occurred:
│ r/lib/python3.11/site-packages/spotipy/client.py:270 in _internal_call │
│ 267 │ │ │ │ │ method, url, args.get("params"), headers, args.g │
│ 268 │ │ │
│ 269 │ │ try: │
│ ❱ 270 │ │ │ response = self._session.request( │
│ 271 │ │ │ │ method, url, headers=headers, proxies=self.proxies, │
│ 272 │ │ │ │ timeout=self.requests_timeout, **args │
│ 273 │ │ │ ) │
│ r/lib/python3.11/site-packages/requests/sessions.py:589 in request │
│ 586 │ │ │ "allow_redirects": allow_redirects, │
│ 587 │ │ } │
│ 588 │ │ send_kwargs.update(settings) │
│ ❱ 589 │ │ resp = self.send(prep, **send_kwargs) │
│ 590 │ │ │
│ 591 │ │ return resp │
│ 592 │
│ r/lib/python3.11/site-packages/requests/sessions.py:703 in send │
│ 700 │ │ start = preferred_clock() │
│ 701 │ │ │
│ 702 │ │ # Send the request │
│ ❱ 703 │ │ r = adapter.send(request, **kwargs) │
│ 704 │ │ │
│ 705 │ │ # Total elapsed time of the request (approximately) │
│ 706 │ │ elapsed = preferred_clock() - start │
│ r/lib/python3.11/site-packages/requests/adapters.py:691 in send │
│ 688 │ │ │ │ │ raise ConnectTimeout(e, request=request) │
│ 689 │ │ │ │
│ 690 │ │ │ if isinstance(e.reason, ResponseError): │
│ ❱ 691 │ │ │ │ raise RetryError(e, request=request) │
│ 692 │ │ │ │
│ 693 │ │ │ if isinstance(e.reason, _ProxyError): │
│ 694 │ │ │ │ raise ProxyError(e, request=request) │
RetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries
exceeded with url:
│ in entry_point:160 │
│ 157 │ try: │
│ 158 │ │ # Pick the operation to perform │
│ 159 │ │ # based on the name and run it! │
│ ❱ 160 │ │ OPERATIONS[arguments.operation]( │
│ 161 │ │ │ query=arguments.query, │
│ 162 │ │ │ downloader=downloader, │
│ 163 │ │ ) │
│ in download:25 │
│ 22 │ """ │
│ 23 │ │
│ 24 │ # Parse the query │
│ ❱ 25 │ songs = get_simple_songs( │
│ 26 │ │ query, │
│ 27 │ │ use_ytm_data=downloader.settings["ytm_data"], │
│ 28 │ │ playlist_numbering=downloader.settings["playlist_numbering"], │
│ in get_simple_songs:260 │
│ 257 │ │ │ ) │
│ 258 │ │ │ songs.extend(full_lists) │
│ 259 │ │ elif "open.spotify.com" in request and "playlist" in request: │
│ ❱ 260 │ │ │ lists.append(Playlist.from_url(request, fetch_songs=False) │
│ 261 │ │ elif "open.spotify.com" in request and "album" in request: │
│ 262 │ │ │ lists.append(Album.from_url(request, fetch_songs=False)) │
│ 263 │ │ elif "open.spotify.com" in request and "artist" in request: │
│ in from_url:306 │
│ 303 │ │ - The SongList object. │
│ 304 │ │ """ │
│ 305 │ │ │
│ ❱ 306 │ │ metadata, songs = cls.get_metadata(url) │
│ 307 │ │ urls = [song.url for song in songs] │
│ 308 │ │ │
│ 309 │ │ if fetch_songs: │
│ in get_metadata:79 │
│ 76 │ │ # Get all tracks from playlist │
│ 77 │ │ tracks = playlist_response["items"] │
│ 78 │ │ while playlist_response["next"]: │
│ ❱ 79 │ │ │ playlist_response = spotify_client.next(playlist_response) │
│ 80 │ │ │ │
│ 81 │ │ │ # Failed to get response, break the loop │
│ 82 │ │ │ if playlist_response is None: │
│ r/lib/python3.11/site-packages/spotipy/client.py:351 in next │
│ 348 │ │ │ │ - result - a previously returned paged result │
│ 349 │ │ """ │
│ 350 │ │ if result["next"]: │
│ ❱ 351 │ │ │ return self._get(result["next"]) │
│ 352 │ │ else: │
│ 353 │ │ │ return None │
│ 354 │
│ in _get:195 │
│ 192 │ │ retries = self.max_retries # type: ignore # pylint: disable=E │
│ 193 │ │ while response is None: │
│ 194 │ │ │ try: │
│ ❱ 195 │ │ │ │ response = self._internal_call("GET", url, payload, kw │
│ 196 │ │ │ except (requests.exceptions.Timeout, requests.ConnectionEr │
│ 197 │ │ │ │ retries -= 1 │
│ 198 │ │ │ │ if retries <= 0: │
│ r/lib/python3.11/site-packages/spotipy/client.py:311 in _internal_call │
│ 308 │ │ │ │ reason = retry_error.args[0].reason │
│ 309 │ │ │ except (IndexError, AttributeError): │
│ 310 │ │ │ │ reason = None │
│ ❱ 311 │ │ │ raise SpotifyException( │
│ 312 │ │ │ │ 429, │
│ 313 │ │ │ │ -1, │
│ 314 │ │ │ │ f"{request.path_url}:\n Max Retries", │
SpotifyException: http status: 429, code:-1 -
s=track:
Max Retries, reason: too many 429 error responses
Screenshots & Screen Records
Device info
App version: 1.5.1 (1050100)
Device information: Android 14 (API 34)
Supported ABIs: [arm64-v8a]
spotDL version: v4.2.8
Additional context
No response