Add requested changes.
This commit is contained in:
parent
4bd59f65f4
commit
ab49cb6e18
|
@ -61,6 +61,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
||||||
private JsonObject initialData;
|
private JsonObject initialData;
|
||||||
private JsonObject videoTab;
|
private JsonObject videoTab;
|
||||||
|
|
||||||
|
private static final long UNKNOWN_SUBSCRIBER_COUNT = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some channels have response redirects and the only way to reliably get the id is by saving it.
|
* Some channels have response redirects and the only way to reliably get the id is by saving it.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -281,7 +283,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
||||||
throw new ParsingException("Could not get subscriber count", e);
|
throw new ParsingException("Could not get subscriber count", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ITEM_COUNT_UNKNOWN;
|
return UNKNOWN_SUBSCRIBER_COUNT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ import java.time.OffsetDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.schabi.newpipe.extractor.ListExtractor.ITEM_COUNT_UNKNOWN;
|
|
||||||
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*;
|
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*;
|
||||||
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
|
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
|
||||||
import static org.schabi.newpipe.extractor.utils.Utils.UTF_8;
|
import static org.schabi.newpipe.extractor.utils.Utils.UTF_8;
|
||||||
|
@ -104,6 +103,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
@Nullable
|
@Nullable
|
||||||
private List<SubtitlesStream> subtitles = null;
|
private List<SubtitlesStream> subtitles = null;
|
||||||
|
|
||||||
|
private static final long UNKNOWN_SUBSCRIBER_COUNT = -1;
|
||||||
|
|
||||||
public YoutubeStreamExtractor(final StreamingService service, final LinkHandler linkHandler) {
|
public YoutubeStreamExtractor(final StreamingService service, final LinkHandler linkHandler) {
|
||||||
super(service, linkHandler);
|
super(service, linkHandler);
|
||||||
}
|
}
|
||||||
|
@ -448,7 +449,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
throw new ParsingException("Could not get uploader subscriber count", e);
|
throw new ParsingException("Could not get uploader subscriber count", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ITEM_COUNT_UNKNOWN;
|
return UNKNOWN_SUBSCRIBER_COUNT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue