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/eggs] Add extractors #11904

Merged
merged 9 commits into from
Jan 20, 2025
Merged

[ie/eggs] Add extractors #11904

merged 9 commits into from
Jan 20, 2025

Conversation

subsense
Copy link
Contributor

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

This PR adds support for extracting audio from the music platform Eggs.

For a single page, it extracts one audio file.
For an artist page, it downloads all audio files from the list.

It didn't seem like there were any basic JSON or API endpoints available on the site.
I'm still a beginner, so please go easy on me.

Fixes #11843

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?

@pukkandan pukkandan added the site-request Request to support a new website label Jan 5, 2025
@seproDev
Copy link
Member

seproDev commented Jan 11, 2025

Having a quick look at the app, there exists a JSON API
Some of the useful endpoints are:

https://app-front-api.eggs.mu/v1/musics/[song_id]
https://app-front-api.eggs.mu/v1/playlists/[playlist_id]
https://app-front-api.eggs.mu/v1/artists/[artist_slug]

Headers are

Accept: */*
apVersion: 8.2.00
Authorization: Bearer
deviceId: 9bbb0e747d45c5f4
deviceName: Android
User-Agent: flamingo/8.2.00 (Android; 14)

deviceId should be a random 16 character hex code.

I, personally, would vastly prefer using the api instead of relying on regexing the webpage.

@subsense
Copy link
Contributor Author

subsense commented Jan 12, 2025

Ah, I hadn’t looked into the Android app. Thank you for the hint.

It seems that for retrieving the API, in addition to at least the deviceId, also need the apVersion and deviceName. Is it okay to omit specifying anything beyond those?

Also, it appears that on an artist’s page or a single’s page, some tracks may be YouTube links.
Example URL:
https://eggs.mu/artist/KAMO_3pband/song/1d4bc45f-1af6-47a9-8b30-a70cae350b4f
https://eggs.mu/artist/KAMO_3pband

In that case, I think the appropriate approach would be to call an existing YouTubeIE or similar to handle the processing. If so, is there a way to save the output in m4a or mp3 formats? requested_formats?

@seproDev
Copy link
Member

Is it okay to omit specifying anything beyond those?

imo. that's fine. Mabe include the Accept: */* part.

If so, is there a way to save the output in m4a or mp3 formats? requested_formats?

Not from the extractor side. The extractor should just return a url result to YoutubeIE. The user can then use -x to download just the audio.

@seproDev seproDev changed the title [ie/eggs] add extractor [ie/eggs] Add extractors Jan 19, 2025
@seproDev seproDev self-assigned this Jan 19, 2025
Copy link
Member

@seproDev seproDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reworked the extractors a bit

yt_dlp/extractor/eggs.py Show resolved Hide resolved
yt_dlp/extractor/eggs.py Outdated Show resolved Hide resolved
@seproDev seproDev merged commit 20c765d into yt-dlp:master Jan 20, 2025
6 checks passed
@subsense subsense deleted the eggs branch January 21, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-request Request to support a new website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Eggs
4 participants