diff --git a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java index ed80bfcf..8d2914f5 100644 --- a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java +++ b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java @@ -93,7 +93,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor { @Override public String getName() throws ParsingException { try { - return doc.select("span[class=\"qualified-channel-title-text\"]").first().select("a").first().text(); + channelName = doc.select("span[class=\"qualified-channel-title-text\"]").first().select("a").first().text(); + return channelName; } catch (Exception e) { throw new ParsingException("Could not get channel name", e); } @@ -102,8 +103,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor { @Override public String getAvatarUrl() throws ParsingException { try { - channelName = doc.select("img[class=\"channel-header-profile-image\"]").first().attr("abs:src"); - return channelName; + return doc.select("img[class=\"channel-header-profile-image\"]").first().attr("abs:src"); } catch (Exception e) { throw new ParsingException("Could not get avatar", e); } diff --git a/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java b/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java index 3df3add3..84e7e622 100644 --- a/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java +++ b/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java @@ -6,6 +6,7 @@ import org.schabi.newpipe.Downloader; import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.channel.ChannelExtractor; +import org.schabi.newpipe.extractor.stream.StreamInfoItem; import static org.junit.Assert.*; import static org.schabi.newpipe.extractor.ServiceList.YouTube;