Update app.py
Browse files
app.py
CHANGED
@@ -250,6 +250,31 @@ async def get_track_download_url(video_url: str) -> str:
|
|
250 |
return {"error": "Download URL not found"}
|
251 |
|
252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
|
254 |
|
255 |
|
|
|
250 |
return {"error": "Download URL not found"}
|
251 |
|
252 |
|
253 |
+
def jio_search(query: str) -> str:
|
254 |
+
try:
|
255 |
+
api_url = f"https://saavn.dev/api/search/songs?query={query}/"
|
256 |
+
session = cloudscraper.create_scraper()
|
257 |
+
|
258 |
+
# Use the correct API endpoint
|
259 |
+
response = session.get(api_url)
|
260 |
+
return response
|
261 |
+
|
262 |
+
|
263 |
+
def jio_fetch(url: str) -> str:
|
264 |
+
try:
|
265 |
+
api_url = f"https://saavn.dev/api/songs?link={url}/"
|
266 |
+
session = cloudscraper.create_scraper()
|
267 |
+
|
268 |
+
# Use the correct API endpoint
|
269 |
+
response = session.get(api_url)
|
270 |
+
return response
|
271 |
+
|
272 |
+
@app.post("/jio_dl")
|
273 |
+
async def jio_download(request: Request):
|
274 |
+
data = await request.json()
|
275 |
+
url = data.get('url')
|
276 |
+
response = jio_fetch(url)
|
277 |
+
return response
|
278 |
|
279 |
|
280 |
|