Compare commits

..

No commits in common. "68c8d0bb729eefda4610eec2c6a15820b326e783" and "ada47b67ebf7c0632ffb8aa20812be6ece6c2145" have entirely different histories.

2 changed files with 4 additions and 8 deletions

View File

@ -1889,7 +1889,7 @@ The following extractors use this feature:
* `type`: Type(s) of game replays to extract. Valid types are: `full_game`, `full_game_spanish`, `condensed_game` and `all_22`. You can use `all` to extract all available replay types, which is the default
#### jiosaavn
* `bitrate`: Audio bitrates to request. One or more of `16`, `32`, `64`, `128`, `320`. Default is `128,320`
* `bitrate`: Which bitrates to request. Valid options are `16`, `32`, `64`, `128`, and `320` or a comma-separated list of these values. Defaults to `128,320`.
**Note**: These options may be changed/removed in the future without concern for backward compatibility

View File

@ -37,15 +37,12 @@ class JioSaavnSongIE(JioSaavnBaseIE):
'only_matching': True,
}]
_VALID_BITRATES = ('16', '32', '64', '128', '320')
def _real_extract(self, url):
audio_id = self._match_id(url)
extract_bitrates = self._configuration_arg('bitrate', ['128', '320'], ie_key='JioSaavn')
if invalid_bitrates := [br for br in extract_bitrates if br not in self._VALID_BITRATES]:
raise ValueError(
f'Invalid bitrate(s): {", ".join(invalid_bitrates)}. '
+ f'Valid bitrates are: {", ".join(self._VALID_BITRATES)}')
if not all(bitrate in ('16', '32', '64', '128', '320') for bitrate in extract_bitrates):
raise ValueError(f'Invalid bitrate(s) {extract_bitrates}')
song_data = self._extract_initial_data(url, audio_id)['song']['song']
formats = []
@ -68,7 +65,6 @@ class JioSaavnSongIE(JioSaavnBaseIE):
'abr': int(bitrate),
'vcodec': 'none',
})
return {
'id': audio_id,
'formats': formats,