rajput-hemant / jiosaavn-api-ts

🎵 A simple wrapper for the JioSaavn API powered by Hono.js 🔥.
https://jiosaavn.rajputhemant.me
MIT License
15 stars 21 forks source link

Decrypting media url ? #49

Closed IndusAryan closed 1 month ago

IndusAryan commented 1 month ago

Hi Hemant, Unlike infinitunes, I want users to directly connect my app with saavn official php api, I am making an app so far i reached the search endpoint and song details like this with id

{"t5e4VTsk":{"id":"t5e4VTsk","type":"","song":"Unstoppable","album":"Unstoppable","year":"2016","music":"Sia Furler, Christopher Braide","music_id":"1988757, 568164","primary_artists":"Sia","primary_artists_id":"568707","featured_artists":"","featured_artists_id":"","singers":"Sia","starring":"","image":"https:\/\/c.saavncdn.com\/552\/Unstoppable-English-2016-150x150.jpg","label":"Monkey Puzzle Records\/RCA Records","albumid":"1759517","language":"english","origin":"none","play_count":49038683,"is_drm":1,"copyright_text":"(P) 2015 Monkey Puzzle Records, under exclusive license to RCA Records","320kbps":"true","is_dolby_content":false,"explicit_content":0,"has_lyrics":"false","lyrics_snippet":"","encrypted_drm_media_url":"ID2ieOjCrwdjlkMElYlzWCptgNdUpWD8sAIs9j7KuikGZQ8NdhuEcWrcw3Rg+qjPvZCLxygm8I\/Ejsa2ggH1cI92mytrdt3FDnQW0nglPS4=","encrypted_media_url":"ID2ieOjCrwfgWvL5sXl4B1ImC5QfbsDyTvhsA++2LIoei1Hw4lgCXWPv2fQccBcSQ329r+LfMijz2b1L9FdOEhw7tS9a8Gtq","encrypted_media_path":"NMKyboFo\/FhxDnnILzo7gW4Rw7sH5ydnQh+8KTvxu8KoFW5oE\/iOtXY9b27vCGFH","media_preview_url":"https:\/\/preview.saavncdn.com\/552\/M5DTdyRAHbK6bBBB2d0Co4SFTQpq10mSRThkbXLM7s3og9_96_p.mp4","perma_url":"https:\/\/www.jiosaavn.com\/song\/unstoppable\/BF0OBSJkRFg","album_url":"https:\/\/www.jiosaavn.com\/album\/unstoppable\/1Tm2aGl16CM_","duration":"218","rights":{"code":0,"reason":"","cacheable":true,"delete_cached_object":false},"webp":true,"cache_state":"false","starred":"false","artistMap":{"Sia Furler":"1988757","Christopher Braide":"568164","Sia":"568707"},"release_date":"2016-01-21","vcode":"010910140266829","vlink":"https:\/\/jiotunepreview.jio.com\/content\/Converted\/010910140279460.mp3","triller_available":false,"label_url":"\/label\/monkey-puzzle-recordsrca-records-albums\/MKT34Ph9xHY_"}}

I cannot find the decryption part in your api, can you link it? I will port that particular function to Kotlin!

these are the urls btw

https://www.jiosaavn.com/api.php?__call=autocomplete.get&_format=json&_marker=0&cc=in&includeMetaTags=1&query=unstoppable

https://www.jiosaavn.com/api.php?__call=song.getDetails&cc=in&_marker=0%3F_marker%3D0&_format=json&pids=t5e4VTsk

rajput-hemant commented 1 month ago

hi @IndusAryan ,

you can find the decryption code here.

please let me know if you need any more help

IndusAryan commented 1 month ago

thanks, i already got it working from the sumitkolhe ji's api and ported to kotlin

hiding for now, ping when you need it