Bandcamp: Get Stream upload date

This commit is contained in:
Fynn Godau 2020-06-04 13:03:16 +02:00
parent e98bff8ae9
commit 6822fe3dc8
2 changed files with 6 additions and 1 deletions

View File

@ -96,7 +96,7 @@ public class BandcampStreamExtractor extends StreamExtractor {
@Nullable
@Override
public String getTextualUploadDate() {
return current.getString("release_date");
return current.getString("publish_date").replaceAll(" \\d+:\\d+:\\d+ .+", "");
}
@Nullable

View File

@ -60,6 +60,11 @@ public class BandcampStreamExtractorTest {
assertTrue(url.contains("://f4.bcbits.com/img/") && url.endsWith(".jpg"));
}
@Test
public void testUploadDate() {
assertEquals("27 Sep 2019", extractor.getTextualUploadDate());
}
@Test
public void testNoArtistProfilePicture() throws ExtractionException {
assertEquals("", Bandcamp.getStreamExtractor("https://powertothequeerkids.bandcamp.com/track/human-nature").getUploaderAvatarUrl());