cyberboysumanjay / JioSaavnAPI

An unofficial API for JioSaavn written in Python 3
https://saavnapi-nine.vercel.app
MIT License
363 stars 182 forks source link

download URL HTTP ERROR 403 #16

Closed ritikkumarsahu closed 4 years ago

ritikkumarsahu commented 4 years ago

The api and download url was working fine till yesterday but today i am getting http error 403 and could not downoad the song from generated url (example: https://aac.saavncdn.com/626/250830dc7d422f41a8934a3377b5a1e4_320.mp3). you can also try this in browser. i think they have updated their api, it could be due to cipher encryption. please solve this Error looks like: Access to aac.saavncdn.com was don't have authorization to view this page. HTTP ERROR 403

cyberboysumanjay commented 4 years ago

Please include the url and the search query from which you got this url. Also please use the latest version. I don't think you're using the latest version.

ritikkumarsahu commented 4 years ago

using function get_album(album_id,lyrics) defined in jiosaavn.py line 36 https://www.jiosaavn.com/api.php?_format=json&__call=content.getAlbumDetails&albumid={0}'.format(albumId) with albumId = 22400677. it successfully generated json response which looks like : {'id': '31hlI1s3', 'type': '', 'song': 'Kandhe Ka Woh Til', 'album': 'Kandhe Ka Woh Til', 'year': '2020', 'music': '', 'music_id': '', 'primary_artists': 'Sachet Tandon,Manan Bhardwaj', 'primary_artists_id': '3623110,746774', 'featured_artists': '', 'featured_artists_id': '', 'singers': 'Sachet Tandon,Manan Bhardwaj', 'starring': '', 'image': 'https://c.saavncdn.com/626/Kandhe-Ka-Woh-Til-Hindi-2020-20200909234001-500x500.jpg', 'label': 'T-Series', 'albumid': '22400677', 'language': 'hindi', 'origin': 'album', 'play_count': '18505', 'copyright_text': '', '320kbps': 'true', 'explicit_content': 0, 'has_lyrics': 'false', 'lyrics_snippet': '', 'encrypted_media_url': 'ID2ieOjCrwfgWvL5sXl4B1ImC5QfbsDyHKMrkj0TI9iIfdKfgzVcOUwVx9al76pShkqS8aToDOeKMTEgeX4JcRw7tS9a8Gtq', 'encrypted_media_path': 'NMKyboFo/FipPXPYZMoffxE0M63ISqTT7tfnT+Oc9n1TCHkFq8S2YdvrlrUrSlSd', 'perma_url': 'https://www.jiosaavn.com/song/kandhe-ka-woh-til/Q1kDXT0BRAA', 'albumurl': 'https://www.jiosaavn.com/album/kandhe-ka-woh-til/jAMrNTacD-c', 'duration': '212', 'rights': {'code': 0, 'reason': '', 'cacheable': True, 'delete_cached_object': False}, 'starred': 'false', 'artistMap': {'Sachet Tandon': '3623110', 'Manan Bhardwaj': '746774', 'Kumaar': 'Kumaar'}, 'release_date': '2020-09-10', 'labelurl': '/label/t-series-albums/6DLuXO3VoTo', 'media_url': 'https://aac.saavncdn.com/626/250830dc7d422f41a8934a3377b5a1e4_320.mp3'}

then further i used 'media_url': 'https://aac.saavncdn.com/626/250830dc7d422f41a8934a3377b5a1e4_320.mp3 in get request to download it as file. but it responded with error 403

cyberboysumanjay commented 4 years ago

Host and use the latest version of this API

I've fixed these issues in the latest builds.

If you prefer using your way you need to change the extension of link to .mp4 instead of .mp3

ritikkumarsahu commented 4 years ago

thanks man your are great.