From 94efe86c7147792db661613b1b5804b8ee5de8c4 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 22 Sep 2021 16:19:44 +0100 Subject: [PATCH 1/3] Extract Video Short Description in YouTube. In Trending, and Search results. --- .../BandcampRadioInfoItemExtractor.java | 6 + ...campDiscographStreamInfoItemExtractor.java | 6 + ...ndcampPlaylistStreamInfoItemExtractor.java | 6 + ...BandcampSearchStreamInfoItemExtractor.java | 6 + .../MediaCCCLiveStreamKioskExtractor.java | 6 + .../MediaCCCRecentKioskExtractor.java | 6 + .../MediaCCCStreamInfoItemExtractor.java | 6 + .../PeertubeStreamInfoItemExtractor.java | 6 + .../SoundcloudStreamInfoItemExtractor.java | 6 + .../YoutubeFeedInfoItemExtractor.java | 6 + .../YoutubeStreamInfoItemExtractor.java | 13 + .../extractor/stream/StreamInfoItem.java | 9 + .../stream/StreamInfoItemExtractor.java | 10 + .../stream/StreamInfoItemsCollector.java | 5 + .../search/YoutubeSearchExtractorTest.java | 30 + .../video_description/generated_mock_0.json | 226 +++++ .../video_description/generated_mock_1.json | 259 ++++++ .../video_description/generated_mock_2.json | 786 ++++++++++++++++++ 18 files changed, 1398 insertions(+) create mode 100644 extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/search/video_description/generated_mock_0.json create mode 100644 extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/search/video_description/generated_mock_1.json create mode 100644 extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/search/video_description/generated_mock_2.json diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java index cca802e9..3699921b 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java @@ -43,6 +43,12 @@ public class BandcampRadioInfoItemExtractor implements StreamInfoItemExtractor { return BandcampExtractorHelper.parseDate(getTextualUploadDate()); } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public String getName() throws ParsingException { return show.getString("subtitle"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java index 6a254998..cb8db136 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java @@ -26,6 +26,12 @@ public class BandcampDiscographStreamInfoItemExtractor extends BandcampStreamInf return null; } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public String getName() { return discograph.getString("title"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java index c28c24ba..922d95bd 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java @@ -60,6 +60,12 @@ public class BandcampPlaylistStreamInfoItemExtractor extends BandcampStreamInfoI return null; } + @Nullable + @Override + public String getShortDescription() { + return null; + } + /** * Each track can have its own cover art. Therefore, unless a substitute is provided, * the thumbnail is extracted using a stream extractor. diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java index 87ba69d1..4288f2d9 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java @@ -32,6 +32,12 @@ public class BandcampSearchStreamInfoItemExtractor extends BandcampStreamInfoIte return null; } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public String getName() throws ParsingException { return resultInfo.getElementsByClass("heading").text(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java index e04be76f..79453126 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java @@ -95,4 +95,10 @@ public class MediaCCCLiveStreamKioskExtractor implements StreamInfoItemExtractor public DateWrapper getUploadDate() throws ParsingException { return null; } + + @Nullable + @Override + public String getShortDescription() { + return null; + } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java index 4f272898..8c9a8c73 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java @@ -92,4 +92,10 @@ public class MediaCCCRecentKioskExtractor implements StreamInfoItemExtractor { DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSzzzz")); return new DateWrapper(zonedDateTime.toOffsetDateTime(), false); } + + @Nullable + @Override + public String getShortDescription() { + return null; + } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java index 0f03788a..cecaa15e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java @@ -73,6 +73,12 @@ public class MediaCCCStreamInfoItemExtractor implements StreamInfoItemExtractor return new DateWrapper(MediaCCCParsingHelper.parseDateFrom(date)); } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public String getName() throws ParsingException { return event.getString("title"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java index b9c7f4b1..e2992915 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java @@ -92,6 +92,12 @@ public class PeertubeStreamInfoItemExtractor implements StreamInfoItemExtractor return new DateWrapper(PeertubeParsingHelper.parseDateFrom(textualUploadDate)); } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public StreamType getStreamType() { return item.getBoolean("isLive") ? StreamType.LIVE_STREAM : StreamType.VIDEO_STREAM; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java index 3647ff09..f95eb9d9 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java @@ -66,6 +66,12 @@ public class SoundcloudStreamInfoItemExtractor implements StreamInfoItemExtracto return new DateWrapper(SoundcloudParsingHelper.parseDateFrom(getTextualUploadDate())); } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public long getViewCount() { return itemObject.getLong("playback_count"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java index a0bd8917..be135be0 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java @@ -77,6 +77,12 @@ public class YoutubeFeedInfoItemExtractor implements StreamInfoItemExtractor { } } + @Nullable + @Override + public String getShortDescription() { + return null; + } + @Override public String getName() { return entryElement.getElementsByTag("title").first().text(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java index 8a4ecf05..5c903aef 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java @@ -288,4 +288,17 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor { throw new ParsingException("Could not parse date from premiere: \"" + startTime + "\""); } } + + @Nullable + @Override + public String getShortDescription() throws ParsingException { + + if(videoInfo.has("detailedMetadataSnippets")) + return getTextFromObject(videoInfo.getArray("detailedMetadataSnippets").getObject(0).getObject("snippetText")); + + if(videoInfo.has("descriptionSnippet")) + return getTextFromObject(videoInfo.getObject("descriptionSnippet")); + + return null; + } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java index 8f2d4243..d974ee2c 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java @@ -32,6 +32,7 @@ public class StreamInfoItem extends InfoItem { private final StreamType streamType; private String uploaderName; + private String shortDescription; private String textualUploadDate; @Nullable private DateWrapper uploadDate; @@ -92,6 +93,14 @@ public class StreamInfoItem extends InfoItem { this.uploaderAvatarUrl = uploaderAvatarUrl; } + public String getShortDescription() { + return shortDescription; + } + + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + @Nullable public String getTextualUploadDate() { return textualUploadDate; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java index 6d61ee44..4a996dc0 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java @@ -116,4 +116,14 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor { @Nullable DateWrapper getUploadDate() throws ParsingException; + + /** + * Get the video's short description. + * + * @return The video's short description or {@code null} if not provided by the service. + * @throws ParsingException if there is an error in the extraction + */ + @Nullable + String getShortDescription() throws ParsingException; + } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java index ae00a1b7..01909c26 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java @@ -101,6 +101,11 @@ public class StreamInfoItemsCollector extends InfoItemsCollector Date: Mon, 4 Oct 2021 01:28:07 +0100 Subject: [PATCH 2/3] Add requested changes. Co-authored-by: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Add final. Co-authored-by: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> --- .../extractors/YoutubeStreamInfoItemExtractor.java | 8 +++++--- .../schabi/newpipe/extractor/stream/StreamInfoItem.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java index 5c903aef..e46a63a5 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java @@ -293,11 +293,13 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor { @Override public String getShortDescription() throws ParsingException { - if(videoInfo.has("detailedMetadataSnippets")) + if (videoInfo.has("detailedMetadataSnippets")) { return getTextFromObject(videoInfo.getArray("detailedMetadataSnippets").getObject(0).getObject("snippetText")); + } - if(videoInfo.has("descriptionSnippet")) - return getTextFromObject(videoInfo.getObject("descriptionSnippet")); + if (videoInfo.has("descriptionSnippet")) { + return getTextFromObject(videoInfo.getObject("descriptionSnippet")); + } return null; } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java index d974ee2c..61690df7 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java @@ -97,7 +97,7 @@ public class StreamInfoItem extends InfoItem { return shortDescription; } - public void setShortDescription(String shortDescription) { + public void setShortDescription(final String shortDescription) { this.shortDescription = shortDescription; } From 62313962a084e9c6009104b858bde3f51518296a Mon Sep 17 00:00:00 2001 From: FireMaskterK <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 4 Oct 2021 01:42:29 +0100 Subject: [PATCH 3/3] Add default implementation for getShortDescription. --- .../bandcamp/extractors/BandcampRadioInfoItemExtractor.java | 6 ------ .../BandcampDiscographStreamInfoItemExtractor.java | 6 ------ .../BandcampPlaylistStreamInfoItemExtractor.java | 6 ------ .../BandcampSearchStreamInfoItemExtractor.java | 6 ------ .../extractors/MediaCCCLiveStreamKioskExtractor.java | 6 ------ .../media_ccc/extractors/MediaCCCRecentKioskExtractor.java | 6 ------ .../infoItems/MediaCCCStreamInfoItemExtractor.java | 6 ------ .../extractors/PeertubeStreamInfoItemExtractor.java | 6 ------ .../extractors/SoundcloudStreamInfoItemExtractor.java | 6 ------ .../youtube/extractors/YoutubeFeedInfoItemExtractor.java | 6 ------ .../newpipe/extractor/stream/StreamInfoItemExtractor.java | 2 +- 11 files changed, 1 insertion(+), 61 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java index 3699921b..cca802e9 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java @@ -43,12 +43,6 @@ public class BandcampRadioInfoItemExtractor implements StreamInfoItemExtractor { return BandcampExtractorHelper.parseDate(getTextualUploadDate()); } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public String getName() throws ParsingException { return show.getString("subtitle"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java index cb8db136..6a254998 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampDiscographStreamInfoItemExtractor.java @@ -26,12 +26,6 @@ public class BandcampDiscographStreamInfoItemExtractor extends BandcampStreamInf return null; } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public String getName() { return discograph.getString("title"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java index 922d95bd..c28c24ba 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampPlaylistStreamInfoItemExtractor.java @@ -60,12 +60,6 @@ public class BandcampPlaylistStreamInfoItemExtractor extends BandcampStreamInfoI return null; } - @Nullable - @Override - public String getShortDescription() { - return null; - } - /** * Each track can have its own cover art. Therefore, unless a substitute is provided, * the thumbnail is extracted using a stream extractor. diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java index 4288f2d9..87ba69d1 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/streaminfoitem/BandcampSearchStreamInfoItemExtractor.java @@ -32,12 +32,6 @@ public class BandcampSearchStreamInfoItemExtractor extends BandcampStreamInfoIte return null; } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public String getName() throws ParsingException { return resultInfo.getElementsByClass("heading").text(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java index 79453126..e04be76f 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKioskExtractor.java @@ -95,10 +95,4 @@ public class MediaCCCLiveStreamKioskExtractor implements StreamInfoItemExtractor public DateWrapper getUploadDate() throws ParsingException { return null; } - - @Nullable - @Override - public String getShortDescription() { - return null; - } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java index 8c9a8c73..4f272898 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCRecentKioskExtractor.java @@ -92,10 +92,4 @@ public class MediaCCCRecentKioskExtractor implements StreamInfoItemExtractor { DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSzzzz")); return new DateWrapper(zonedDateTime.toOffsetDateTime(), false); } - - @Nullable - @Override - public String getShortDescription() { - return null; - } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java index cecaa15e..0f03788a 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/infoItems/MediaCCCStreamInfoItemExtractor.java @@ -73,12 +73,6 @@ public class MediaCCCStreamInfoItemExtractor implements StreamInfoItemExtractor return new DateWrapper(MediaCCCParsingHelper.parseDateFrom(date)); } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public String getName() throws ParsingException { return event.getString("title"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java index e2992915..b9c7f4b1 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamInfoItemExtractor.java @@ -92,12 +92,6 @@ public class PeertubeStreamInfoItemExtractor implements StreamInfoItemExtractor return new DateWrapper(PeertubeParsingHelper.parseDateFrom(textualUploadDate)); } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public StreamType getStreamType() { return item.getBoolean("isLive") ? StreamType.LIVE_STREAM : StreamType.VIDEO_STREAM; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java index f95eb9d9..3647ff09 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamInfoItemExtractor.java @@ -66,12 +66,6 @@ public class SoundcloudStreamInfoItemExtractor implements StreamInfoItemExtracto return new DateWrapper(SoundcloudParsingHelper.parseDateFrom(getTextualUploadDate())); } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public long getViewCount() { return itemObject.getLong("playback_count"); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java index be135be0..a0bd8917 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java @@ -77,12 +77,6 @@ public class YoutubeFeedInfoItemExtractor implements StreamInfoItemExtractor { } } - @Nullable - @Override - public String getShortDescription() { - return null; - } - @Override public String getName() { return entryElement.getElementsByTag("title").first().text(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java index 4a996dc0..21aa25f2 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java @@ -124,6 +124,6 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor { * @throws ParsingException if there is an error in the extraction */ @Nullable - String getShortDescription() throws ParsingException; + default String getShortDescription() throws ParsingException { return null; } }