-
Notifications
You must be signed in to change notification settings - Fork 424
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] Fix the extraction of series playlists and don't return the view count as the stream count for learning playlists #811
Conversation
@sovietscout @yashpalgoyal1304 Could you test this APK and see if it fixes the issues? Thank you in advance. |
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, please remove the "fixes" for suggestions and mixes - they will be fixed via #813
I tested the attested apk with the links given at TeamNewPipe/NewPipe#7609 (comment) and:
|
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 almost good to me, thank you!
As always the real fix is in between a hundred other unrelated changed lines :-/
...test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMixPlaylistExtractorTest.java
Outdated
Show resolved
Hide resolved
.../java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubePlaylistExtractor.java
Outdated
Show resolved
Hide resolved
...va/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java
Outdated
Show resolved
Hide resolved
This will prevent their override in each child class where the values corresponding to the methods could not be extracted.
Also fix some issues in the extractors, remove uneeded overrides, use the Java 8 Stream API where possible and replace usages of Utils.UTF_8 with StandardCharsets.UTF_8 in these classes.
…w count as the stream count for learning playlists ITEM_COUNT_UNKNOWN is returned when the JSON array which contains usally the number of videos is less than 3 items. Also apply the same type of optimizations done in other PlaylistExtractors in YoutubePlaylistExtractor.
fff8ab0
to
c7757c0
Compare
Done. |
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.
Code looks good and tests succeed, lgtm
These changes need testing on every playlist type available, because I removed some old code related to the extraction of a playlist type, which seems to be not used anymore by YouTube.
This PR fixes the extraction of YouTube series playlists and the extraction of the stream count for learning playlists: instead of returning the view count of the playlist as the stream count,
ITEM_COUNT_UNKNOWN
is now returned for these playlists.Because some of the methods in the
PlaylistExtractor
abstract class are mostly overriden with the same return value in inherited classes, I implemented them in the base class instead and they are now only overridden where it's relevant.I also improved and refactored a bit the classes which extends the
PlaylistExtractor
one (use of the Java 8 Streaming API and theStandardCharsets
class, use of thefinal
keyword where possible, etc.).This PR fixes TeamNewPipe/NewPipe#5004 and fixes TeamNewPipe/NewPipe#7609.
Debug APK to test the changes: app-debug.zip