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

[YouTube] Improve YoutubeStreamInfoItemExtractor #1000

Merged

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Dec 8, 2022

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe. Debug APK to test (contains an app change to return the comment text as a string, not as a Description, in order to avoid the corresponding build error): app-debug.zip

This PR improves some code in YoutubeStreamInfoItemExtractor and:

  • makes duration of video premieres available
  • returns view count and upload date of streams in playlists
  • uses another non-localized method to determine whether a stream is a running livestream (as a last resort)
  • removes the YT Shorts workaround code, as it was only useful on channels, and Shorts have been moved into a separated channel tab.

As a side effect, if duration of YouTube stream items cannot be extracted, -1 is always returned.

- Return duration of video premieres;
- Add another non-localized method to determine whether a stream is a running
livestream;
- Return view count and upload date of videos in playlists;
- Store isPremiere result;
- Remove shorts workaround code, as it was only useful on channels and shorts
have been moved into a separated channel tab;
- Improve some other code.
@AudricV AudricV added enhancement New feature or request youtube service, https://www.youtube.com/ labels Dec 8, 2022
@opusforlife2
Copy link
Collaborator

1000! 🎉

if (isPremiere()) {
// Premieres can be livestreams, so the duration is not available in this
// case
return -1;
Copy link
Member

Choose a reason for hiding this comment

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

We really need to introduce more constants for those default values in the Info classes. But that's something for another PR, maybe a good first issue.

@TobiGr TobiGr merged commit 88e07e5 into TeamNewPipe:dev Dec 11, 2022
@AudricV AudricV deleted the yt-streaminfoitemextractor-improvements branch December 11, 2022 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants