mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2025-09-03 15:55:50 +00:00
Merge pull request #1326 from AudricV/yt_fix-view-count-members-first-only-shorts
This commit is contained in:
@@ -33,12 +33,12 @@ import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
|||||||
* for an extractor for this UI data type.
|
* for an extractor for this UI data type.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public class YoutubeShortsLockupInfoItemExtractor implements StreamInfoItemExtractor {
|
class YoutubeShortsLockupInfoItemExtractor implements StreamInfoItemExtractor {
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private final JsonObject shortsLockupViewModel;
|
private final JsonObject shortsLockupViewModel;
|
||||||
|
|
||||||
public YoutubeShortsLockupInfoItemExtractor(@Nonnull final JsonObject shortsLockupViewModel) {
|
YoutubeShortsLockupInfoItemExtractor(@Nonnull final JsonObject shortsLockupViewModel) {
|
||||||
this.shortsLockupViewModel = shortsLockupViewModel;
|
this.shortsLockupViewModel = shortsLockupViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +93,12 @@ public class YoutubeShortsLockupInfoItemExtractor implements StreamInfoItemExtra
|
|||||||
.getObject("secondaryText")
|
.getObject("secondaryText")
|
||||||
.getString("content");
|
.getString("content");
|
||||||
if (!isNullOrEmpty(viewCountText)) {
|
if (!isNullOrEmpty(viewCountText)) {
|
||||||
|
if (viewCountText.contains("✪")) {
|
||||||
|
// If secondary text content contains ✪, this short should be a members first or a
|
||||||
|
// members only one, we can't extract its view count in this case
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// This approach is language dependent
|
// This approach is language dependent
|
||||||
if (viewCountText.toLowerCase().contains("no views")) {
|
if (viewCountText.toLowerCase().contains("no views")) {
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user