mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
[YouTube] Add check for channel items with no video count in search
This commit is contained in:
parent
b7f8001a49
commit
921bf30bb7
@ -86,7 +86,14 @@ public class YoutubeChannelInfoItemExtractor implements ChannelInfoItemExtractor
|
|||||||
@Override
|
@Override
|
||||||
public long getStreamCount() throws ParsingException {
|
public long getStreamCount() throws ParsingException {
|
||||||
try {
|
try {
|
||||||
return Long.parseLong(Utils.removeNonDigitCharacters(getTextFromObject(channelInfoItem.getObject("videoCountText"))));
|
final JsonObject videoCountObject = channelInfoItem.getObject("videoCountText");
|
||||||
|
|
||||||
|
if (videoCountObject == null) {
|
||||||
|
// Video count is not available, channel probably has no public uploads.
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Long.parseLong(Utils.removeNonDigitCharacters(getTextFromObject(videoCountObject)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ParsingException("Could not get stream count", e);
|
throw new ParsingException("Could not get stream count", e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user