Skip to content

Commit f308755

Browse files
committed
try YoutubeChannelExtractor.getName() hack try 2
1 parent a6da202 commit f308755

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public String getId() throws ParsingException {
9393
@Override
9494
public String getName() throws ParsingException {
9595
try {
96-
return doc.select("span[class=\"qualified-channel-title-text\"]").first().select("a").first().text();
96+
channelName = doc.select("span[class=\"qualified-channel-title-text\"]").first().select("a").first().text();
97+
return channelName;
9798
} catch (Exception e) {
9899
throw new ParsingException("Could not get channel name", e);
99100
}
@@ -102,8 +103,7 @@ public String getName() throws ParsingException {
102103
@Override
103104
public String getAvatarUrl() throws ParsingException {
104105
try {
105-
channelName = doc.select("img[class=\"channel-header-profile-image\"]").first().attr("abs:src");
106-
return channelName;
106+
return doc.select("img[class=\"channel-header-profile-image\"]").first().attr("abs:src");
107107
} catch (Exception e) {
108108
throw new ParsingException("Could not get avatar", e);
109109
}

src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.schabi.newpipe.extractor.ListExtractor;
77
import org.schabi.newpipe.extractor.NewPipe;
88
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
9+
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
910

1011
import static org.junit.Assert.*;
1112
import static org.schabi.newpipe.extractor.ServiceList.YouTube;

0 commit comments

Comments
 (0)