Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
* for an extractor for this UI data type.
* </p>
*/
public class YoutubeShortsLockupInfoItemExtractor implements StreamInfoItemExtractor {
class YoutubeShortsLockupInfoItemExtractor implements StreamInfoItemExtractor {

@Nonnull
private final JsonObject shortsLockupViewModel;

public YoutubeShortsLockupInfoItemExtractor(@Nonnull final JsonObject shortsLockupViewModel) {
YoutubeShortsLockupInfoItemExtractor(@Nonnull final JsonObject shortsLockupViewModel) {
this.shortsLockupViewModel = shortsLockupViewModel;
}

Expand Down Expand Up @@ -93,6 +93,12 @@ public long getViewCount() throws ParsingException {
.getObject("secondaryText")
.getString("content");
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
if (viewCountText.toLowerCase().contains("no views")) {
return 0;
Expand Down
Loading