-
Notifications
You must be signed in to change notification settings - Fork 420
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
Fix broken yt likes in comments #628
Conversation
Start from the doc in |
extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItem.java
Outdated
Show resolved
Hide resolved
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.
don't remove getLikeCount(), convert the string to int using helpers method (Utils.mixedNumberWordToLong()
should do the job)
extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItem.java
Outdated
Show resolved
Hide resolved
Restored the |
I should have added that only the mocks for tests related to you changes need to be updated. Especially since as you noted, there is broken stuff that you "uncover" like this, causing the build in your PR to fail |
@XiangRongLin |
71fe88f
to
b776db6
Compare
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.
Can you also check the changes against newpipe. The default methods in interfaces should work on android, but i would like to have that verified.
Best if you can just upload an apk, so the people from the issue can test it out
1ac09e7
to
12fb18c
Compare
ScreenshotsResults when using NewPipe (dev branch) now (without changes to use the new TestingThe untested (I'm just using android studio 😉) apk (built with Note: I couldn't find any instructions how to build it (in a hurry) and therefore used the CI instructions If it doesn't work build it yourself with this manual:
|
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.
About NewPipe, you checked
[x] I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.
There is no API change so it will work, but NewPipe could be improved.
You could check if it is from YouTube service, therefore you round the count using Localization.shortCount()
.
It is non-blocking but will be appreciated.
This PR fixes TeamNewPipe/NewPipe#6323 and does some minor clean up / code de-duplications.
Related PR in NewPipe project: TeamNewPipe/NewPipe#6337
If someone of the maintainers could update the mock data (PR is editable) or tell me how to do it, the test should work again.Youtube now translates the
voteCount
(ex.likeCount
) into the corresponding language. So in English 3033 is displayed in 3K while in German/Deutsch it's displayed as 3.033.However this doesn't seem to work correctly in the app (e.g. when the "Default Content Language" is set) , because SUPPORTED_LANGUGAGES only contains "en-GB":
NewPipeExtractor/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeService.java
Lines 188 to 198 in 6db4bea
When using tests I managed to get it working using this demo test:
YoutubeCommentsExtractorTest.java