-
Notifications
You must be signed in to change notification settings - Fork 417
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
Conversation
Is anyone able to review this? |
There was a problem hiding this 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 ;-)
...in/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Outdated
Show resolved
Hide resolved
...in/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Show resolved
Hide resolved
The code mostly comes from #358 Co-Authored-By: Mauricio Colli <mauriciocolli@outlook.com>
@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. |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
compatible with the changed API.
Changes
DeliveryFormat
enumurl
inStream
tocontent
and addisUrl
to indicate whethercontent
contains the URL or the file itself (which is useful when we have to split DASH/HLS manifests)id
inStream
to identify a specific stream (there could be multipleStream
s with the same ID if the same stream is offered through multiple delivery methods; in YouTube's case the ID would be the itag)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.