Skip to content

Commit e408124

Browse files
committed
Improve documentation
> > I think you can use YoutubeParsingHelper.getTextFromObject() > That was used there before however I did not choose to use it again. > > ``runs`` returns an array with 3 items containing: > 0: ``<artistname>`` > 1: ``•`` > 2: ``<subscriberCount>`` > > There is 2 problems with that: > 1. It's inefficient for extracting the subscription count > 2. If for some reason the artist now has a name like "2k" the extraction malfunctions See also: #1277 (comment)
1 parent 3ad9f17 commit e408124

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicArtistInfoItemExtractor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public long getSubscriberCount() throws ParsingException {
6868
.getObject("musicResponsiveListItemFlexColumnRenderer")
6969
.getObject("text")
7070
.getArray("runs");
71+
// NOTE: YoutubeParsingHelper#getTextFromObject would use all entries from the run array,
72+
// which is not wanted as only the last entry contains the actual subscriberCount
7173
final String subscriberCount = runs.getObject(runs.size() - 1)
7274
.getString("text");
7375
if (!isNullOrEmpty(subscriberCount)) {

0 commit comments

Comments
 (0)