Skip to content

Add /ping and /health endpoints, fix two logic bugs and Fix slow, 5-result-capped search: use search.getResults, drop N+1 calls - #77

Open
RobinkumarJ246 wants to merge 2 commits into
cyberboysumanjay:masterfrom
RobinkumarJ246:master
Open

Add /ping and /health endpoints, fix two logic bugs and Fix slow, 5-result-capped search: use search.getResults, drop N+1 calls#77
RobinkumarJ246 wants to merge 2 commits into
cyberboysumanjay:masterfrom
RobinkumarJ246:master

Conversation

@RobinkumarJ246

Copy link
Copy Markdown

Fix except clause in helper.py that never caught TypeError, and fix
an always-true elif condition in the /result/ route.

search_for_song() was calling JioSaavn's autocomplete.get (capped at ~5
results) for the initial search, then making ANOTHER sequential
get_song() HTTP request per result just to fetch playable media URLs
— 6+ round-trips to JioSaavn's origin for a single search.

search.getResults (JioSaavn's actual search API, supports p/n paging)
already returns encrypted_media_url/media_preview_url/duration/etc for
every result in the same response, so format_song() can run on each
result directly with zero extra requests. Verified locally: 15 results
in ~0.2-0.4s versus the old ~5-result, multi-second behavior.

/song/ now accepts an optional n= param (default 15, capped at 40) to
control result count. The songdata=false lightweight path is untouched.

RobinkumarJ246 and others added 2 commits July 11, 2026 16:49
Fix except clause in helper.py that never caught TypeError, and fix
an always-true elif condition in the /result/ route. Also add
CLAUDE.md for repo guidance.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
search_for_song() was calling JioSaavn's autocomplete.get (capped at ~5
results) for the initial search, then making ANOTHER sequential
get_song() HTTP request per result just to fetch playable media URLs
— 6+ round-trips to JioSaavn's origin for a single search.

search.getResults (JioSaavn's actual search API, supports p/n paging)
already returns encrypted_media_url/media_preview_url/duration/etc for
every result in the same response, so format_song() can run on each
result directly with zero extra requests. Verified locally: 15 results
in ~0.2-0.4s versus the old ~5-result, multi-second behavior.

/song/ now accepts an optional n= param (default 15, capped at 40) to
control result count. The songdata=false lightweight path is untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

@RobinkumarJ246 is attempting to deploy a commit to the cyberboy's projects Team on Vercel.

A member of the Team first needs to authorize it.

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