From 58ce9b04a15d43afff3395a0db876ec0609d6915 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Wed, 14 Apr 2021 15:01:07 +0200 Subject: [PATCH] Fix channel extraction when channel URL is youtube.com/c/username --- .../youtube/extractors/YoutubeChannelExtractor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java index f9f356cc..a802e531 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java @@ -82,10 +82,10 @@ public class YoutubeChannelExtractor extends ChannelExtractor { final String channel_path = super.getId(); final String[] channelInfo = channel_path.split("/"); String id = ""; - // If the url is an URL with /user, we need to use navigation/resolve_url endpoint of the - // youtubei API to get the channel id. Otherwise, we couldn't get information about the - // channel associated with this username, if there is one. - if (channelInfo[0].equals("user")) { + // If the url is an URL which is not a /channel URL, we need to use the + // navigation/resolve_url endpoint of the youtubei API to get the channel id. Otherwise, we + // couldn't get information about the channel associated with this URL, if there is one. + if (!channelInfo[0].equals("channel")) { final byte[] body = JsonWriter.string(prepareJsonBuilder() .value("url", "https://www.youtube.com/" + channel_path) .done())