Skip to content

Conversation

@Taerear
Copy link

@Taerear Taerear commented Nov 15, 2025

Proposal of changes to retry send_request when YT returns 403 on searching for a song on a playlist.
Related discussion: #830

Taerear and others added 2 commits November 15, 2025 18:38
…Error

catch JSONDecodeError and retry since json.loads() cannot handle None…
try:
response_text: JsonDict = json.loads(response.text)
except json.JSONDecodeError:
print("JSON parsing failed for song \"" + body["query"] + "\". Probably a 403 or other garbage response. Retrying.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling here is way too specific and opinionated.

_send_request is used by literally every single function in this library.

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.

2 participants