Compare commits

...

5 Commits

Author SHA1 Message Date
sepro
ada47b67eb Remove duplicate line 2024-01-06 04:31:24 +01:00
sepro
b43bc03249 Add info to readme 2024-01-06 04:27:52 +01:00
sepro
1e9a9561f3 Update tests 2024-01-06 04:19:44 +01:00
sepro
e58284f924 Cleanup PR 2024-01-06 04:18:31 +01:00
sepro
5803f6116a Revert unrelated changes 2024-01-06 04:16:46 +01:00
2 changed files with 13 additions and 7 deletions

View File

@ -1888,6 +1888,9 @@ 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,13 +21,16 @@ 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': '7b1f70de088ede3a152ea34aece4df42',
'md5': '3b84396d15ed9e083c3106f1fa589c04',
'info_dict': {
'id': 'OQsEfQFVUXk',
'ext': 'mp3',
'ext': 'mp4',
'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',
@ -36,11 +39,11 @@ class JioSaavnSongIE(JioSaavnBaseIE):
def _real_extract(self, url):
audio_id = self._match_id(url)
formats = []
# available bitrates are 16, 32, 64, 128, 320
extract_bitrates = self._configuration_arg('bitrate', ['16', '32', '64', '128', '320'], ie_key='JioSaavn')
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}')
song_data = self._extract_initial_data(url, audio_id)['song']['song']
formats = []
for bitrate in extract_bitrates:
@ -77,7 +80,7 @@ class JioSaavnSongIE(JioSaavnBaseIE):
class JioSaavnAlbumIE(JioSaavnBaseIE):
_VALID_URL = r'https?://(?:www\.)?(?:jio)?saavn\.com/(?:s/playlist|album)/[^/?#]+/(?P<id>[^/?#]+)'
_VALID_URL = r'https?://(?:www\.)?(?:jio)?saavn\.com/album/[^/?#]+/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'https://www.jiosaavn.com/album/96/buIOjYZDrNA_',
'info_dict': {