Merge pull request #1024 from AudricV/snd_fix-tracks-like-count

[SoundCloud] Fix extraction of tracks like count
This commit is contained in:
Stypox 2023-01-29 10:52:54 +01:00 committed by GitHub
commit 999fb7f812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -133,7 +133,7 @@ public class SoundcloudStreamExtractor extends StreamExtractor {
@Override
public long getLikeCount() {
return track.getLong("favoritings_count", -1);
return track.getLong("likes_count", -1);
}
@Nonnull

View File

@ -22,7 +22,8 @@ import java.util.List;
import javax.annotation.Nullable;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
public class SoundcloudStreamExtractorTest {
@ -64,7 +65,7 @@ public class SoundcloudStreamExtractorTest {
@Override public long expectedViewCountAtLeast() { return 43000; }
@Nullable @Override public String expectedUploadDate() { return "2019-05-16 16:28:45.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2019-05-16 16:28:45"; }
@Override public long expectedLikeCountAtLeast() { return -1; }
@Override public long expectedLikeCountAtLeast() { return 600; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasAudioStreams() { return false; }
@Override public boolean expectedHasVideoStreams() { return false; }
@ -127,7 +128,7 @@ public class SoundcloudStreamExtractorTest {
@Override public long expectedViewCountAtLeast() { return 386000; }
@Nullable @Override public String expectedUploadDate() { return "2016-11-11 01:16:37.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2016-11-11 01:16:37"; }
@Override public long expectedLikeCountAtLeast() { return -1; }
@Override public long expectedLikeCountAtLeast() { return 7350; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasAudioStreams() { return false; }
@Override public boolean expectedHasVideoStreams() { return false; }
@ -170,7 +171,7 @@ public class SoundcloudStreamExtractorTest {
@Override public long expectedViewCountAtLeast() { return 27000; }
@Nullable @Override public String expectedUploadDate() { return "2019-03-28 13:36:18.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2019-03-28 13:36:18"; }
@Override public long expectedLikeCountAtLeast() { return -1; }
@Override public long expectedLikeCountAtLeast() { return 25; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasVideoStreams() { return false; }
@Override public boolean expectedHasSubtitles() { return false; }