New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update jiosaavn.py #8834
Update jiosaavn.py #8834
Conversation
updated code to pull highest quality 320 kbps
Please fill out the PR template properly, otherwise this can not be merged. There are five quality levels available: 16, 32, 64, 128, 320 |
You mean Instead of downlaoding highest quality, its better to list formats and select one of them. Am i correct? |
Yes that would be the idea. It would come at the cost of making 5 instead of 1 HTTP request. I think that's fine, but maybe others disagree. I would at least request both the 128 and 320 format. |
Sure i will work on that accordingly |
it might be appropriate to have this configurable by extractor-arg, e.g: formats = []
# available bitrates are 16, 32, 64, 128, 320
for bitrate in self._configuration_arg('bitrate', ['128', '320'], ie_key='JioSaavn'):
media_data = self._download_json(
'https://www.jiosaavn.com/api.php', audio_id, f'Downloading format info for {bitrate}',
fatal=False, data=urlencode_postdata({
'__call': 'song.generateAuthToken',
'_format': 'json',
'bitrate': bitrate,
'url': song_data['encrypted_media_url'],
}))
if not media_data.get('auth_url'):
self.report_warning(f'Unable to extract format info for {bitrate}')
continue
formats.append({
'url': media_data['auth_url'],
'ext': media_data.get('type'),
'format_id': bitrate,
'abr': int(bitrate),
'vcodec': 'none',
}) |
updated jiosaavn to get all formats. Please follow the below instructions to download the songs in certain format. # available bitrates are 16, 32, 64, 128, 320 --match-filter "abr = bitrate" Eg: --match-filter "abr = 128" Also, you can use below output format to create folder for each album. Windows: -o %(album)s/%(title)s.%(ext)s
Hey thanks for your suggestion. I have updated the code accordingly. instead on two formats i have added all formats and we can use below command to download certain format song. please find the attached log for output. --match-filter "abr = 320" |
Adjusted white spaces
Below is the log attached when i use '-f 320' for downloading songs in 320kbps'. please refer the log first |
Updated the code suggested by the Team accordingly
Authored by: alien-developers, bashonly Co-authored-by: bashonly <bashonly@protonmail.com>
updated code to pull highest quality 320 kbps
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
ADD DESCRIPTION HERE
Fixes #
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?