sumitkolhe / jiosaavn-api

🎵 An Unofficial API for downloading high-quality songs from JioSaavn
https://saavn.dev
MIT License
256 stars 116 forks source link

Issue with downloadable links #35

Closed samocodes closed 1 year ago

samocodes commented 1 year ago

I guess JioSaavn recently made changes in their API which resulted in breaking the API.

fmsidoe commented 1 year ago

Facing the same issue too, I hope it can be fixed soon.

sumitkolhe commented 1 year ago

Can you share a sample query or link where you are facing this issue?

fmsidoe commented 1 year ago

For example if you use the query: https://saavn.me/songs?link=https://www.jiosaavn.com/song/hattrick-feat.-yaygo-musalini/IS8beB9ZAmA

You get the results, but the downloadUrl's are not working as the songs were playable yesterday, but today it is not available anymore to play

samocodes commented 1 year ago

I tried putting the same method as JioSaavan doing

But there is also a issue with that somehow it wont work from your code or from API Client. I dont know the issue. Tried fake User Agent. Same issue.

samocodes commented 1 year ago

Update: I tried decrypting with the code (it is in python) and it worked.

from pyDes import *
import base64

def decrypt_url(url):
    des_cipher = des(b"38346591", ECB, b"\0\0\0\0\0\0\0\0",pad=None, padmode=PAD_PKCS5)
    enc_url = base64.b64decode(url.strip())
    dec_url = des_cipher.decrypt(enc_url, padmode=PAD_PKCS5).decode('utf-8')
    dec_url = dec_url.replace("_96.mp4", "_320.mp4")
    return dec_url

Source

sumitkolhe commented 1 year ago

i've found the issue, a fix would be live soon

samocodes commented 1 year ago

Can you tell where the issue is?

sumitkolhe commented 1 year ago

1df1c0e should fix the download link issue.

vibhu1720001 commented 1 year ago

When I host it on vercel the search results are only showing hindi songs, while when I locally host it or use saavn.me api it showing worlwide results. How to resolve that?

sumitkolhe commented 1 year ago

@vibhu1720001 when deploying on vercel choose the serverless function region as Mumbai

vibhu1720001 commented 1 year ago

Mumbai, India (South)- bom1 option?

sumitkolhe commented 1 year ago

Yes

vibhu1720001 commented 1 year ago

It is showing same results.

vibhu1720001 commented 1 year ago

Domain should be same right.

sumitkolhe commented 1 year ago

you need to deploy again after changing the serverless region

vibhu1720001 commented 1 year ago

Gotcha

vibhu1720001 commented 1 year ago

It worked. Thanks.