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: https://github.com/TeamNewPipe/NewPipeExtractor/pull/1277#discussion_r1955148742
pull/1277/head
litetex 2025-02-15 15:02:30 +01:00
rodzic 3ad9f17c53
commit e4081243e7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 525B43E6039B3689
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -68,6 +68,8 @@ public class YoutubeMusicArtistInfoItemExtractor implements ChannelInfoItemExtra
.getObject("musicResponsiveListItemFlexColumnRenderer")
.getObject("text")
.getArray("runs");
// NOTE: YoutubeParsingHelper#getTextFromObject would use all entries from the run array,
// which is not wanted as only the last entry contains the actual subscriberCount
final String subscriberCount = runs.getObject(runs.size() - 1)
.getString("text");
if (!isNullOrEmpty(subscriberCount)) {