Compare commits

..

No commits in common. "ada47b67ebf7c0632ffb8aa20812be6ece6c2145" and "974c55d7c6864eb19880a25dba056d982c2437e9" have entirely different histories.

2 changed files with 7 additions and 13 deletions

View File

@ -1888,9 +1888,6 @@ The following extractors use this feature:
#### nflplusreplay
* `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`.
**Note**: These options may be changed/removed in the future without concern for backward compatibility
<!-- MANPAGE: MOVE "INSTALLATION" SECTION HERE -->

View File

@ -1,10 +1,10 @@
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
url_or_none,
urlencode_postdata,
urljoin,
int_or_none
)
from ..utils.traversal import traverse_obj
@ -21,16 +21,13 @@ class JioSaavnSongIE(JioSaavnBaseIE):
_VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
'md5': '3b84396d15ed9e083c3106f1fa589c04',
'md5': '7b1f70de088ede3a152ea34aece4df42',
'info_dict': {
'id': 'OQsEfQFVUXk',
'ext': 'mp4',
'ext': 'mp3',
'title': 'Leja Re',
'album': 'Leja Re',
'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
'duration': 205,
'view_count': int,
'release_year': 2018,
},
}, {
'url': 'https://www.saavn.com/s/song/hindi/Saathiya/O-Humdum-Suniyo-Re/KAMiazoCblU',
@ -39,11 +36,11 @@ class JioSaavnSongIE(JioSaavnBaseIE):
def _real_extract(self, url):
audio_id = self._match_id(url)
extract_bitrates = self._configuration_arg('bitrate', ['128', '320'], ie_key='JioSaavn')
formats = []
# available bitrates are 16, 32, 64, 128, 320
extract_bitrates = self._configuration_arg('bitrate', ['16', '32', '64', '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}')
song_data = self._extract_initial_data(url, audio_id)['song']['song']
formats = []
for bitrate in extract_bitrates:
@ -80,7 +77,7 @@ class JioSaavnSongIE(JioSaavnBaseIE):
class JioSaavnAlbumIE(JioSaavnBaseIE):
_VALID_URL = r'https?://(?:www\.)?(?:jio)?saavn\.com/album/[^/?#]+/(?P<id>[^/?#]+)'
_VALID_URL = r'https?://(?:www\.)?(?:jio)?saavn\.com/(?:s/playlist|album)/[^/?#]+/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'https://www.jiosaavn.com/album/96/buIOjYZDrNA_',
'info_dict': {