File tree Expand file tree Collapse file tree
src/main/java/org/schabi/newpipe/extractor/services/youtube Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
4545 private static final String CHANNEL_FEED_BASE = "https://www.youtube.com/feeds/videos.xml?channel_id=" ;
4646 private static final String CHANNEL_URL_PARAMETERS = "/videos?view=0&flow=list&sort=dd&live_view=10000" ;
4747
48+ private String channelName = "" ; //Small hack used to make the channelName available to NextStreams
49+
4850 private Document doc ;
4951 /**
5052 * It's lazily initialized (when getNextStreams is called)
@@ -100,7 +102,8 @@ public String getName() throws ParsingException {
100102 @ Override
101103 public String getAvatarUrl () throws ParsingException {
102104 try {
103- return doc .select ("img[class=\" channel-header-profile-image\" ]" ).first ().attr ("abs:src" );
105+ channelName = doc .select ("img[class=\" channel-header-profile-image\" ]" ).first ().attr ("abs:src" );
106+ return channelName ;
104107 } catch (Exception e ) {
105108 throw new ParsingException ("Could not get avatar" , e );
106109 }
@@ -232,7 +235,11 @@ public String getName() throws ParsingException {
232235
233236 @ Override
234237 public String getUploaderName () throws ParsingException {
235- return YoutubeChannelExtractor .this .getName ();
238+ if (channelName .isEmpty ()) {
239+ return "" ;
240+ } else {
241+ return channelName ;
242+ }
236243 }
237244
238245 @ Override
You can’t perform that action at this time.
0 commit comments