kopia lustrzana https://github.com/TeamNewPipe/NewPipeExtractor
Fix YT artist getSubscriberCount extraction
rodzic
25e4a6f3cf
commit
4d7df1486c
|
@ -1,5 +1,6 @@
|
|||
package org.schabi.newpipe.extractor.services.youtube.extractors;
|
||||
|
||||
import com.grack.nanojson.JsonArray;
|
||||
import com.grack.nanojson.JsonObject;
|
||||
import org.schabi.newpipe.extractor.Image;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor;
|
||||
|
@ -61,10 +62,14 @@ public class YoutubeMusicArtistInfoItemExtractor implements ChannelInfoItemExtra
|
|||
|
||||
@Override
|
||||
public long getSubscriberCount() throws ParsingException {
|
||||
final String subscriberCount = getTextFromObject(artistInfoItem.getArray("flexColumns")
|
||||
.getObject(2)
|
||||
final JsonArray flexColumns = artistInfoItem.getArray("flexColumns");
|
||||
final JsonArray runs = flexColumns
|
||||
.getObject(flexColumns.size() - 1)
|
||||
.getObject("musicResponsiveListItemFlexColumnRenderer")
|
||||
.getObject("text"));
|
||||
.getObject("text")
|
||||
.getArray("runs");
|
||||
final String subscriberCount = runs.getObject(runs.size() - 1)
|
||||
.getString("text");
|
||||
if (!isNullOrEmpty(subscriberCount)) {
|
||||
try {
|
||||
return Utils.mixedNumberWordToLong(subscriberCount);
|
||||
|
|
|
@ -4,7 +4,6 @@ import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
|||
import static java.util.Collections.singletonList;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.schabi.newpipe.downloader.DownloaderTestImpl;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
|
@ -107,7 +106,6 @@ public class YoutubeMusicSearchExtractorTest {
|
|||
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; }
|
||||
}
|
||||
|
||||
@Disabled
|
||||
public static class MusicArtists extends DefaultSearchExtractorTest {
|
||||
private static SearchExtractor extractor;
|
||||
private static final String QUERY = "kevin";
|
||||
|
|
Ładowanie…
Reference in New Issue