Update app.py
Browse files
app.py
CHANGED
@@ -269,7 +269,7 @@ def jio_search(query: str) -> str:
|
|
269 |
raise HTTPException(status_code=500, detail=f"An error occurred while searching: {str(e)}")
|
270 |
|
271 |
|
272 |
-
def jio_fetch(url: str) ->
|
273 |
try:
|
274 |
# Construct the API URL
|
275 |
api_url = f"https://saavn.dev/api/songs?link={url}"
|
@@ -278,7 +278,7 @@ def jio_fetch(url: str) -> str:
|
|
278 |
response = session.get(api_url)
|
279 |
# Check if the request was successful
|
280 |
response.raise_for_status()
|
281 |
-
return response.
|
282 |
except cloudscraper.exceptions.CloudflareChallengeError as cf_err:
|
283 |
logger.error(f"Cloudflare challenge error while fetching {url}: {cf_err}")
|
284 |
raise HTTPException(status_code=503, detail="Cloudflare challenge failed")
|
|
|
269 |
raise HTTPException(status_code=500, detail=f"An error occurred while searching: {str(e)}")
|
270 |
|
271 |
|
272 |
+
def jio_fetch(url: str) -> dict:
|
273 |
try:
|
274 |
# Construct the API URL
|
275 |
api_url = f"https://saavn.dev/api/songs?link={url}"
|
|
|
278 |
response = session.get(api_url)
|
279 |
# Check if the request was successful
|
280 |
response.raise_for_status()
|
281 |
+
return response.json()
|
282 |
except cloudscraper.exceptions.CloudflareChallengeError as cf_err:
|
283 |
logger.error(f"Cloudflare challenge error while fetching {url}: {cf_err}")
|
284 |
raise HTTPException(status_code=503, detail="Cloudflare challenge failed")
|