NewPipeExtractor
NewPipeExtractor copied to clipboard
Fix view count extraction for YouTube originals content.
- [x] 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.
I've had a look at the JSON structure on a YouTube channel, it shouldn't cause any issues. However, since this extractor is likely used in every other place too, more testing is necessary.
Closes #596
Is there already an test for this? If not can you add it
I checked out this branch and reverted the bug fix, but the added test are still passing => The tests are testing the wrong thing.
Since a very specific bug needs to be tested, I personally would not go the whole way and implement DefaultSearchExtractorTest. This adds a lot of tests, which don't give more confidence. Instead I would just test that single thing
I checked out this branch and reverted the bug fix, but the added test are still passing => The tests are testing the wrong thing.
Since a very specific bug needs to be tested, I personally would not go the whole way and implement
DefaultSearchExtractorTest. This adds a lot of tests, which don't give more confidence. Instead I would just test that single thing
Do you know any other way? This bug only happens when you view the video on the ~~search page~~, channel page, trending page, etc.
With my current knowlegde I have no idea. I don't even know where to look I can see the bug inside the app/piped, since the issue description is very sparse
Ok, I just figured that it doesn't happen in the search result, hence why the test was passing.
To see this in action, open https://piped.kavin.rocks/c/vox and https://www.youtube.com/c/vox/videos
and find this video:

@FireMasterK Are you going to adjust the test to your comment? Then it could be merged in my opinion
Ok, I just figured that it doesn't happen in the search result, hence why the test was passing.
I'll do that tomorrow, I have to board a plane today!
@FireMasterK Ping. Downgraded PR to draft as long as it's not finished.
The test has been removed already tho 🤔
Sorry I'm not familiar with this issue... Which test? I didn't see one in the PR and the currently implemented ones seem to be working with mock-data...
I didn't want the test removed, but adjusted.
Ok, I just figured that it doesn't happen in the search result, hence why the test was passing.
With adjusting the test I meant changing it from checking the search result to checking whereever the problem does occur.
Probably here
To see this in action, open https://piped.kavin.rocks/c/vox and https://www.youtube.com/c/vox/videos
I don't think that's feasible since I don't know any channel which uploads only YouTube originals content.
Is the problem that the data changes with the time? Because back then you linked a channel were you said that the problem could be observed.
If yes you can be the first on to use the MockOnly rule https://github.com/TeamNewPipe/documentation/blob/master/docs/05_Mock_tests.md#mock-only-tests
Then you just need to create the mock once and run the test against that scenario. Maybe also add what characteristics are important in the case that the mocks need to be regenerated
Does this problem occur inside playlists? Maybe we can use one for a test. Playlists usually don't change that much.
Does this problem occur inside playlists? Maybe we can use one for a test. Playlists usually don't change that much.
YouTube doesn't provide view counts in playlists, so that won't work!
I'll create a MockOnly later.
It looks like this now happens on the search page, so I added a test again!
Closing this as YouTube is now hiding the views on originals content, so this doesn't matter anymore.