Commit f3087553 authored by Christian Schabesberger's avatar Christian Schabesberger
Browse files

try YoutubeChannelExtractor.getName() hack try 2

parent a6da2024
......@@ -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);
}
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment