[YouTube] Fix expected upload dates of StreamExtractor tests

YouTube is rolling out or A/B testing a new date format returned inside player
responses, which are precise to the second instead of the day.

This commit makes the StreamExtractor tests use these more precise dates.
This commit is contained in:
AudricV 2023-10-07 19:51:47 +02:00
parent ad3d187ac7
commit 9dc1eab28c
No known key found for this signature in database
GPG Key ID: DA92EC7905614198
6 changed files with 22 additions and 23 deletions

View File

@ -48,8 +48,8 @@ public class YoutubeStreamExtractorAgeRestrictedTest extends DefaultStreamExtrac
@Override public long expectedLength() { return 10; }
@Override public long expectedTimestamp() { return TIMESTAMP; }
@Override public long expectedViewCountAtLeast() { return 232_000; }
@Nullable @Override public String expectedUploadDate() { return "2018-03-11 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2018-03-11"; }
@Nullable @Override public String expectedUploadDate() { return "2018-03-11 19:22:08.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2018-03-11T12:22:08-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 3_700; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasRelatedItems() { return false; } // no related videos (!)

View File

@ -52,8 +52,8 @@ public class YoutubeStreamExtractorControversialTest extends DefaultStreamExtrac
}
@Override public long expectedLength() { return 219; }
@Override public long expectedViewCountAtLeast() { return 285000; }
@Nullable @Override public String expectedUploadDate() { return "2010-09-09 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2010-09-09"; }
@Nullable @Override public String expectedUploadDate() { return "2010-09-09 15:40:44.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2010-09-09T08:40:44-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 13300; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public List<String> expectedTags() { return Arrays.asList("Books", "Burning", "Jones", "Koran", "Qur'an", "Terry", "the amazing atheist"); }

View File

@ -151,8 +151,8 @@ public class YoutubeStreamExtractorDefaultTest {
@Override public long expectedLength() { return 381; }
@Override public long expectedTimestamp() { return TIMESTAMP; }
@Override public long expectedViewCountAtLeast() { return 26682500; }
@Nullable @Override public String expectedUploadDate() { return "2019-08-24 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2019-08-24"; }
@Nullable @Override public String expectedUploadDate() { return "2019-08-24 15:39:57.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2019-08-24T08:39:57-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 5212900; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public int expectedStreamSegmentsCount() { return 0; }
@ -194,8 +194,8 @@ public class YoutubeStreamExtractorDefaultTest {
}
@Override public long expectedLength() { return 434; }
@Override public long expectedViewCountAtLeast() { return 21229200; }
@Nullable @Override public String expectedUploadDate() { return "2018-06-19 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2018-06-19"; }
@Nullable @Override public String expectedUploadDate() { return "2018-06-19 19:41:34.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2018-06-19T12:41:34-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 340100; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedUploaderVerified() { return true; }
@ -283,8 +283,8 @@ public class YoutubeStreamExtractorDefaultTest {
}
@Override public long expectedLength() { return 953; }
@Override public long expectedViewCountAtLeast() { return 270000; }
@Nullable @Override public String expectedUploadDate() { return "2021-03-17 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2021-03-17"; }
@Nullable @Override public String expectedUploadDate() { return "2021-03-17 19:56:59.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2021-03-17T12:56:59-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 2300; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasSubtitles() { return false; }
@ -342,11 +342,10 @@ public class YoutubeStreamExtractorDefaultTest {
@Override public boolean expectedUploaderVerified() { return true; }
@Override public long expectedLength() { return 1010; }
@Override public long expectedViewCountAtLeast() { return 815500; }
@Nullable @Override public String expectedUploadDate() { return "2020-11-18 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2020-11-18"; }
@Nullable @Override public String expectedUploadDate() { return "2020-11-19 05:30:01.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2020-11-18T21:30:01-08:00"; }
@Override public long expectedLikeCountAtLeast() { return 48500; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasSubtitles() { return true; }
@Override public int expectedStreamSegmentsCount() { return 7; }
@Override public String expectedLicence() { return YOUTUBE_LICENCE; }
@Override public String expectedCategory() { return "Science & Technology"; }
@ -410,8 +409,8 @@ public class YoutubeStreamExtractorDefaultTest {
@Override public long expectedLength() { return 45; }
@Override public long expectedTimestamp() { return TIMESTAMP; }
@Override public long expectedViewCountAtLeast() { return 20_000; }
@Nullable @Override public String expectedUploadDate() { return "2023-07-07 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2023-07-07"; }
@Nullable @Override public String expectedUploadDate() { return "2023-07-07 15:30:08.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2023-07-07T08:30:08-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 1000; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public List<MetaInfo> expectedMetaInfo() throws MalformedURLException {
@ -455,8 +454,8 @@ public class YoutubeStreamExtractorDefaultTest {
@Override public List<String> expectedDescriptionContains() { return Arrays.asList("Makani", "prototype", "rotors"); }
@Override public long expectedLength() { return 175; }
@Override public long expectedViewCountAtLeast() { return 88_000; }
@Nullable @Override public String expectedUploadDate() { return "2017-05-16 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2017-05-16"; }
@Nullable @Override public String expectedUploadDate() { return "2017-05-16 14:50:53.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2017-05-16T07:50:53-07:00"; }
@Override public long expectedLikeCountAtLeast() { return -1; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public StreamExtractor extractor() { return extractor; }

View File

@ -57,8 +57,8 @@ public class YoutubeStreamExtractorLivestreamTest extends DefaultStreamExtractor
@Override public long expectedLength() { return 0; }
@Override public long expectedTimestamp() { return TIMESTAMP; }
@Override public long expectedViewCountAtLeast() { return 0; }
@Nullable @Override public String expectedUploadDate() { return "2022-07-12 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2022-07-12"; }
@Nullable @Override public String expectedUploadDate() { return "2022-07-12 12:12:29.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2022-07-12T05:12:29-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 340_000; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public boolean expectedHasSubtitles() { return false; }

View File

@ -63,8 +63,8 @@ public class YoutubeStreamExtractorRelatedMixTest extends DefaultStreamExtractor
@Override public long expectedUploaderSubscriberCountAtLeast() { return 32_000_000; }
@Override public long expectedLength() { return 208; }
@Override public long expectedViewCountAtLeast() { return 449_000_000; }
@Nullable @Override public String expectedUploadDate() { return "2015-07-09 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2015-07-09"; }
@Nullable @Override public String expectedUploadDate() { return "2015-07-09 16:34:35.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2015-07-09T09:34:35-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 6_400_000; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public int expectedStreamSegmentsCount() { return 0; }

View File

@ -48,8 +48,8 @@ public class YoutubeStreamExtractorUnlistedTest extends DefaultStreamExtractorTe
}
@Override public long expectedLength() { return 2488; }
@Override public long expectedViewCountAtLeast() { return 1500; }
@Nullable @Override public String expectedUploadDate() { return "2017-09-22 00:00:00.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2017-09-22"; }
@Nullable @Override public String expectedUploadDate() { return "2017-09-22 12:15:21.000"; }
@Nullable @Override public String expectedTextualUploadDate() { return "2017-09-22T05:15:21-07:00"; }
@Override public long expectedLikeCountAtLeast() { return 110; }
@Override public long expectedDislikeCountAtLeast() { return -1; }
@Override public StreamExtractor.Privacy expectedPrivacy() { return UNLISTED; }