naqushab / saavn-downloader-extension

Chrome Extension to download songs and block ads for jiosaavn.com (previously saavn.com)
https://www.jiosaavn.com/
91 stars 18 forks source link

this is not working for download song from jiosaavan new web page #33

Closed Sanj2020 closed 4 years ago

Sanj2020 commented 4 years ago

Sir I love this extension but few days the Jiosaavan.com update his web page so new page I can download any song with this extension so I request to you please fix this

HritwikSinghal commented 4 years ago

@naqushab saavn changed the url of song after decrpytion, now its like 'aac.saavncdn.com/935/e234433555a6c343c2c8b6576db66c32_96.mp4' which redirects to any one of jio cdn ( like 'http://sdlhivkecdnems05.cdnsrv.jio.com/aac.saavncdn.com/935/e234433555a6c343c2c8b6576db66c32_96.mp4') and this url has new song.

so after redirecting, just replace the '_96.mp4' part in last with '_320.mp3' and check if 200 status is returned, if not replace the '_96.mp4' part in last with '_160.mp3' and again check. if not, replace the '_96.mp4' part in last with '.mp3' for 128kbps.

i dont know javascript thats why i couldn't do it. Please look into it

naqushab commented 4 years ago

Thank you. I'll look into it and get back to you. Thanks for the investigation, it will help.

On Fri, Jun 5, 2020, 12:29 PM Hritwik notifications@github.com wrote:

@naqushab https://github.com/naqushab saavn changed the url of song after decrpytion, now its ' aac.saavncdn.com/935/e234433555a6c343c2c8b6576db66c32_96.mp4' which redirects to any one of jio cdn ( like ' http://schnncdnems02.cdnsrv.jio.com/h.saavncdn.com/935/e234433555a6c343c2c8b6576db66c32_96.mp4') and this url has new song.

so after redirecting, just replace the '_96.mp4' part in last with '_320.mp3' and check if 200 status is returned, if not replace the '_96.mp4' part in last with '_160.mp3' and again check. if not, replace the '_96.mp4' part in last with '.mp3' for 128kbps.

i dont know javascript thats why i couldn't do it. Please look into it

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/naqushab/saavn-downloader-extension/issues/33#issuecomment-639296770, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUAKXQWGK45VI2HEDCBI3DRVCJU7ANCNFSM4NRVDOEQ .

onlynir commented 4 years ago

naqushab Sir, please develop one tool for Gaana also. I have more than 50 albums link which is not available at Savaan. Therefore I am not able to download those albums. I am eagerly requesting to You.

naqushab commented 4 years ago

naqushab Sir, please develop one tool for Gaana also. I have more than 50 albums link which is not available at Savaan. Therefore I am not able to download those albums. I am eagerly requesting to You.

Its a feature request. I would try to move to a unified approach but not in a foreseeable future.

naqushab commented 4 years ago

@HritwikSinghal how did you came across this new URL? I can search for the decrypting logic but it would be easier if you just told me and I reuse that. :)

HritwikSinghal commented 4 years ago

@HritwikSinghal how did you came across this new URL? I can search for the decrypting logic but it would be easier if you just told me and I reuse that. :)

Saavn changed their whole interface again, so now i get encrypted media url from their api. Then i decrypt it using the already known scheme which is used till now, Then the url looks like this "http://aac.saavncdn.com/430/5c5ea5cc00e3bff45616013226f376fe_96.mp4" so replace '_96' with '_320' (to get 320 KBPS instead of 96 KBPS ) and open it in browser tab. so That would Be the download Url now.

There is another way to get song url. If you replace 'aac.saavncdn.com' with 'h.saavncdn.com', and open the url ( which is now "http://h.saavncdn.com/430/5c5ea5cc00e3bff45616013226f376fe_320.mp4"), it will automatically redirect to one of cdn server. But AFAIK there is no need for this method. Just use the "aac.saavncdn.com/" Url and it serves the song. For API you can see 'https://github.com/monuyadav016/Saavn-Downloader'

Edit: Here are the api url (i got them from network tab in dev tools)

'artist': 'https://www.jiosaavn.com/api.php?__call=webapi.get&token={0}&type=artist&p=&n_song=10&n_album=14&sub_type=&category=&sort_order=&includeMetaTags=0&ctx=web6dot0&api_version=4&',

'album': 'https://www.jiosaavn.com/api.php?__call=webapi.get&token={0}&type=album&includeMetaTags=0&ctx=web6dot0&api_version=4&_format=json&_marker=0',

'playlist': 'https://www.jiosaavn.com/api.php?__call=webapi.get&token={0}&type=playlist&p=1&n=20&includeMetaTags=0&ctx=web6dot0&api_version=4&_format=json&_marker=0',

'song': 'https://www.jiosaavn.com/api.php?__call=webapi.get&token={0}&type=song&includeMetaTags=0&ctx=web6dot0&api_version=4&_format=json&_marker=0',

replace the '{0}' part in each with last part in website url. like 'KD8zfAZpZFo' in 'https://www.jiosaavn.com/song/tere-naal/KD8zfAZpZFo'

naqushab commented 4 years ago

good stuff @HritwikSinghal ! I'll give it a read. meanwhile I have added the download option back using an unoffical Jiosaavn api.