[GH-ISSUE #363] 500 Internal Server Error when searching #288

Closed
opened 2026-02-27 22:09:00 +03:00 by kerem · 4 comments
Owner

Originally created by @alanhamlett on GitHub (Mar 14, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/363

Response:

{
  "error": {
    "code": 500,
    "message": "Internal error encountered.",
    "errors": [
      {
        "message": "Internal error encountered.",
        "domain": "global",
        "reason": "backendError"
      }
    ],
    "status": "INTERNAL"
  }
}

Example code:

from ytmusicapi import YTMusic
yt = YTMusic(headers, user_id)
query = "OM Unit Lightworkers Call Feat. Kromestar"
yt.search(query)

Traceback:

Traceback (most recent call last):
  File "spotifyplaylist_to_ytmusic/YouTube.py", line 160, in main
    videoIds = ytmusic.search_songs(playlist['tracks'])
  File "spotifyplaylist_to_ytmusic/YouTube.py", line 74, in search_songs
    result = self.api.search(query)
  File "spotifyplaylist_to_ytmusic/venv/lib/python3.9/site-packages/ytmusicapi/mixins/search.py", line 151, in search
    response = self._send_request(endpoint, body)
  File "spotifyplaylist_to_ytmusic/venv/lib/python3.9/site-packages/ytmusicapi/ytmusic.py", line 146, in _send_request
    raise Exception(message + error)
Exception: Server returned HTTP 500: Internal Server Error.
Originally created by @alanhamlett on GitHub (Mar 14, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/363 Response: ``` { "error": { "code": 500, "message": "Internal error encountered.", "errors": [ { "message": "Internal error encountered.", "domain": "global", "reason": "backendError" } ], "status": "INTERNAL" } } ``` Example code: ```python from ytmusicapi import YTMusic yt = YTMusic(headers, user_id) query = "OM Unit Lightworkers Call Feat. Kromestar" yt.search(query) ``` Traceback: ``` Traceback (most recent call last): File "spotifyplaylist_to_ytmusic/YouTube.py", line 160, in main videoIds = ytmusic.search_songs(playlist['tracks']) File "spotifyplaylist_to_ytmusic/YouTube.py", line 74, in search_songs result = self.api.search(query) File "spotifyplaylist_to_ytmusic/venv/lib/python3.9/site-packages/ytmusicapi/mixins/search.py", line 151, in search response = self._send_request(endpoint, body) File "spotifyplaylist_to_ytmusic/venv/lib/python3.9/site-packages/ytmusicapi/ytmusic.py", line 146, in _send_request raise Exception(message + error) Exception: Server returned HTTP 500: Internal Server Error. ```
kerem closed this issue 2026-02-27 22:09:00 +03:00
Author
Owner

@sigma67 commented on GitHub (Mar 14, 2023):

As you can see it's a backend error, so there's not much this project (client) can do about it.

<!-- gh-comment-id:1468736547 --> @sigma67 commented on GitHub (Mar 14, 2023): As you can see it's a backend error, so there's not much this project (client) can do about it.
Author
Owner

@alanhamlett commented on GitHub (Mar 14, 2023):

The backend error seems persistent, does it work for you? If not, what's the point of having that search method if it always fails?

<!-- gh-comment-id:1469000101 --> @alanhamlett commented on GitHub (Mar 14, 2023): The backend error seems persistent, does it work for you? If not, what's the point of having that search method if it always fails?
Author
Owner

@sigma67 commented on GitHub (Mar 15, 2023):

I cannot reproduce this, so it's probably something specific to your account or a rollout in progress. search works fine for my account.

<!-- gh-comment-id:1469567728 --> @sigma67 commented on GitHub (Mar 15, 2023): I cannot reproduce this, so it's probably something specific to your account or a rollout in progress. `search` works fine for my account.
Author
Owner

@alanhamlett commented on GitHub (Mar 15, 2023):

Yes, must be. I'll try to figure it out on my end. Thanks!

<!-- gh-comment-id:1469571240 --> @alanhamlett commented on GitHub (Mar 15, 2023): Yes, must be. I'll try to figure it out on my end. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#288
No description provided.