|
2 | 2 |
|
3 | 3 | import com.grack.nanojson.JsonArray; |
4 | 4 | import com.grack.nanojson.JsonObject; |
5 | | - |
6 | 5 | import org.schabi.newpipe.extractor.Page; |
7 | 6 | import org.schabi.newpipe.extractor.StreamingService; |
8 | 7 | import org.schabi.newpipe.extractor.channel.ChannelExtractor; |
|
18 | 17 | import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector; |
19 | 18 | import org.schabi.newpipe.extractor.utils.Utils; |
20 | 19 |
|
21 | | -import java.io.IOException; |
22 | | - |
23 | 20 | import javax.annotation.Nonnull; |
| 21 | +import java.io.IOException; |
24 | 22 |
|
25 | | -import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.fixThumbnailUrl; |
26 | | -import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getJsonResponse; |
27 | | -import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getTextFromObject; |
| 23 | +import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*; |
28 | 24 | import static org.schabi.newpipe.extractor.utils.JsonUtils.EMPTY_STRING; |
29 | 25 | import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; |
30 | 26 |
|
@@ -87,7 +83,8 @@ public void onFetchPage(@Nonnull Downloader downloader) throws IOException, Extr |
87 | 83 |
|
88 | 84 | final String browseId = endpoint.getObject("browseEndpoint").getString("browseId", EMPTY_STRING); |
89 | 85 |
|
90 | | - if (webPageType.equalsIgnoreCase("WEB_PAGE_TYPE_BROWSE") && !browseId.isEmpty()) { |
| 86 | + if (webPageType.equalsIgnoreCase("WEB_PAGE_TYPE_BROWSE") |
| 87 | + || webPageType.equalsIgnoreCase("WEB_PAGE_TYPE_CHANNEL") && !browseId.isEmpty()) { |
91 | 88 | if (!browseId.startsWith("UC")) { |
92 | 89 | throw new ExtractionException("Redirected id is not pointing to a channel"); |
93 | 90 | } |
@@ -191,12 +188,7 @@ public long getSubscriberCount() throws ParsingException { |
191 | 188 | throw new ParsingException("Could not get subscriber count", e); |
192 | 189 | } |
193 | 190 | } else { |
194 | | - // If there's no subscribe button, the channel has the subscriber count disabled |
195 | | - if (c4TabbedHeaderRenderer.has("subscribeButton")) { |
196 | | - return 0; |
197 | | - } else { |
198 | | - return -1; |
199 | | - } |
| 191 | + return ITEM_COUNT_UNKNOWN; |
200 | 192 | } |
201 | 193 | } |
202 | 194 |
|
|
0 commit comments