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

Properly support other delivery methods #367

Closed
wants to merge 2 commits into from
Closed

Properly support other delivery methods #367

wants to merge 2 commits into from

Conversation

wb9688
Copy link
Contributor

@wb9688 wb9688 commented Jul 15, 2020

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it
    compatible with the changed API.

Changes

  • Add DeliveryFormat enum
  • Rename url in Stream to content and add isUrl to indicate whether content contains the URL or the file itself (which is useful when we have to split DASH/HLS manifests)
  • Add id in Stream to identify a specific stream (there could be multiple Streams with the same ID if the same stream is offered through multiple delivery methods; in YouTube's case the ID would be the itag)
  • Support Opus and MP3 over HLS for SoundCloud
  • Parse YouTube's DASH MPD

When all changes are finished, I'm going to work on implementing them in NewPipe's downloader. When I'm done with that and the unified player has been merged, I'll look at implementing it in the player as well.

I'll leave not hardcoding itags to another PR.

@wb9688 wb9688 marked this pull request as ready for review July 16, 2020 12:02
@dbenjaminmiller
Copy link

Is anyone able to review this?

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you for looking into this ;-)

wb9688 and others added 2 commits August 27, 2020 15:25
The code mostly comes from #358

Co-Authored-By: Mauricio Colli <mauriciocolli@outlook.com>
@wb9688
Copy link
Contributor Author

wb9688 commented Aug 27, 2020

@Stypox: Could you review this again? This PR shouldn't be merged yet though, as I haven't properly tested e.g. whether the YouTube DASH extraction is actually correct (the output looks correct though). Btw I just started working on the NewPipe part of this.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

LGTM, thank you :-D
I only pointed out two small things, after they are solved and you have finished with your tests this can be merged imo

if (fmt != null && languageCode != null)
subtitles.add(new SubtitlesStream(fmt, languageCode, url, false));
if (fmt != null && languageCode != null) {
final String id = languageCode + "." + fmt.suffix;
Copy link
Member

Choose a reason for hiding this comment

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

Make a constructor of SubtitlesStream without id, so that it can be automatically set to this. I see this is being used also in YoutubeStreamExtractor

} else if (t.getString("preset").contains("opus")) {
mediaFormat = MediaFormat.OPUS;
} else {
break;
Copy link
Member

Choose a reason for hiding this comment

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

Why break and not continue? Also below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants