Skip to content
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

Merged
merged 19 commits into from Jan 19, 2024
Merged

Update jiosaavn.py #8834

merged 19 commits into from Jan 19, 2024

Conversation

alien-developers
Copy link
Contributor

@alien-developers alien-developers commented Dec 22, 2023

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:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

updated code to pull highest quality 320 kbps
@seproDev
Copy link
Collaborator

Please fill out the PR template properly, otherwise this can not be merged.

There are five quality levels available: 16, 32, 64, 128, 320
Does it make sense to request all five and list them as formats?

@seproDev seproDev added the site-enhancement Feature request for some website label Dec 22, 2023
@alien-developers
Copy link
Contributor Author

alien-developers commented Dec 23, 2023

Please fill out the PR template properly, otherwise this can not be merged.

There are five quality levels available: 16, 32, 64, 128, 320 Does it make sense to request all five and list them as formats?

You mean Instead of downlaoding highest quality, its better to list formats and select one of them. Am i correct?

@seproDev
Copy link
Collaborator

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.

@alien-developers
Copy link
Contributor Author

Sure i will work on that accordingly

@bashonly
Copy link
Member

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',
            })

@bashonly bashonly self-requested a review December 24, 2023 18:29
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
@alien-developers
Copy link
Contributor Author

alien-developers commented Dec 25, 2023

log_new.txt

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"

@alien-developers
Copy link
Contributor Author

alien-developers commented Dec 25, 2023

Below is the log attached when i use '-f 320' for downloading songs in 320kbps'. please refer the log first

log.txt
Screenshot 2023-12-25 121420

yt_dlp/extractor/jiosaavn.py Outdated Show resolved Hide resolved
yt_dlp/extractor/jiosaavn.py Outdated Show resolved Hide resolved
yt_dlp/extractor/jiosaavn.py Show resolved Hide resolved
yt_dlp/extractor/jiosaavn.py Outdated Show resolved Hide resolved
@seproDev seproDev added the pending-fixes PR has had changes requested label Jan 5, 2024
@seproDev seproDev added pending-review PR needs a review and removed pending-fixes PR has had changes requested labels Jan 6, 2024
yt_dlp/extractor/jiosaavn.py Outdated Show resolved Hide resolved
yt_dlp/extractor/jiosaavn.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
yt_dlp/extractor/jiosaavn.py Outdated Show resolved Hide resolved
@bashonly bashonly removed the pending-review PR needs a review label Jan 19, 2024
@seproDev seproDev merged commit 5154dc0 into yt-dlp:master Jan 19, 2024
6 checks passed
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Authored by: alien-developers, bashonly

Co-authored-by: bashonly <bashonly@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-enhancement Feature request for some website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants