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

[ie/hungama] Overhaul extractors #7757

Merged
merged 3 commits into from Aug 29, 2023
Merged

[ie/hungama] Overhaul extractors #7757

merged 3 commits into from Aug 29, 2023

Conversation

Yalab7
Copy link
Contributor

@Yalab7 Yalab7 commented Aug 2, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Added un subdomain to the extractor hungama by editing _VALID_URL

Fixes #7754

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?

Copilot Summary

🤖 Generated by Copilot at a18dd41

Summary

🎵🎬🛠️

Improved the Hungama extractor to handle a new subdomain for various media types. Modified a test case accordingly.

We are the rebels of the un. domain
We break the chains of the Hungama extractor
We play the songs of doom and despair
We make the playlists of the damned

Walkthrough

  • Update the _VALID_URL patterns for the HungamaIE, HungamaSongIE, and HungamaAlbumPlaylistIE classes to support the un. subdomain (link, link, link)
  • Change the test URL for the HungamaIE class to use the un. subdomain and match the updated pattern (link)

@bashonly
Copy link
Member

bashonly commented Aug 2, 2023

Don't replace the old tests, add new tests for the new subdomain (they can be the same videos just with new URL format). Also be sure to run them to see if the site revamp broke anything

@bashonly bashonly added site-bug Issue with a specific website pending-fixes PR has had changes requested labels Aug 2, 2023
@Yalab7
Copy link
Contributor Author

Yalab7 commented Aug 2, 2023

When I run the tests using python test/test_download.py TestDownload.test_hungama I get the following error
AttributeError: type object 'TestDownload' has no attribute 'test_hungama'

I tried rerunning the test multiple times as stated in step 6 but the error is still unresolved.

Can you point me to the right direction on how to correctly run the tests?

@bashonly
Copy link
Member

bashonly commented Aug 2, 2023

the test names are case sensitive
python test/test_download.py TestDownload.test_Hungama
python test/test_download.py TestDownload.test_Hungama_1
python test/test_download.py TestDownload.test_HungamaSong
python test/test_download.py TestDownload.test_HungamaSong_all
etc

@Yalab7
Copy link
Contributor Author

Yalab7 commented Aug 3, 2023

I keep getting network errors when I try to test downloading, although the same URL is working in the release version that I'm using.

image

@apstheironheart
Copy link

If something helps:

The website is playing with a lower quality max streaming support upto 192kbps. Audio bitrates of 96,128kbps are also returned. If editing the URL and changing 192 to 320, then I can download the higher bitrate m3u8 file.

@bashonly bashonly removed the pending-fixes PR has had changes requested label Aug 23, 2023
@bashonly bashonly changed the title [hungama] Added un subdomain [ie/hungama] Overhaul extractors Aug 23, 2023
@bashonly
Copy link
Member

bashonly commented Aug 23, 2023

It turns out that it wasn't as simple as just updating the _VALID_URL. Added a baseclass so that HungamaIE and HungamaAlbumPlaylistIE could inherit a common method to call the site's metadata API, since the JSON LD blocks they were using previously for metadata extraction are not available with un.hungama.com links

@bashonly bashonly added the pending-review PR needs a review label Aug 23, 2023
@bashonly bashonly removed the pending-review PR needs a review label Aug 27, 2023
@bashonly bashonly merged commit 4b3a6ef into yt-dlp:master Aug 29, 2023
13 checks passed
@apstheironheart
Copy link

is it resolved? I tried updating to nightly build and its only download a placeholder ad for all the songs from un.hungama?

@bashonly
Copy link
Member

@apstheironheart Looks like song extraction is broken for both www.hungama.com and un.hungama.com song URLs. Can you open a new issue?

@apstheironheart apstheironheart mentioned this pull request Aug 31, 2023
11 tasks
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for un.hungama.com
3 participants