mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-29 18:51:24 +01:00
Compare commits
2 Commits
ada47b67eb
...
68c8d0bb72
Author | SHA1 | Date | |
---|---|---|---|
|
68c8d0bb72 | ||
|
d64f7c88df |
|
@ -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`: 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`.
|
||||
* `bitrate`: Audio bitrates to request. One or more of `16`, `32`, `64`, `128`, `320`. Default is `128,320`
|
||||
|
||||
**Note**: These options may be changed/removed in the future without concern for backward compatibility
|
||||
|
||||
|
|
|
@ -37,12 +37,15 @@ 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 not all(bitrate in ('16', '32', '64', '128', '320') for bitrate in extract_bitrates):
|
||||
raise ValueError(f'Invalid bitrate(s) {extract_bitrates}')
|
||||
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)}')
|
||||
|
||||
song_data = self._extract_initial_data(url, audio_id)['song']['song']
|
||||
formats = []
|
||||
|
@ -65,6 +68,7 @@ class JioSaavnSongIE(JioSaavnBaseIE):
|
|||
'abr': int(bitrate),
|
||||
'vcodec': 'none',
|
||||
})
|
||||
|
||||
return {
|
||||
'id': audio_id,
|
||||
'formats': formats,
|
||||
|
|
Loading…
Reference in New Issue
Block a user