diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCStreamExtractor.java index 56036c2eb..08f21ef73 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCStreamExtractor.java @@ -49,7 +49,7 @@ public class MediaCCCStreamExtractor extends StreamExtractor { @Nonnull @Override public Description getDescription() throws ParsingException { - return new Description(getServiceId(), data.getString("description")); + return new Description(data.getString("description"), Description.PLAIN_TEXT); } @Override diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java index ac3267f14..a4dafbfc8 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java @@ -83,7 +83,7 @@ public class PeertubeStreamExtractor extends StreamExtractor { e.printStackTrace(); } } - return new Description(getServiceId(), text); + return new Description(text, Description.MARKDOWN); } @Override diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java index c2a537a28..18fffa413 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java @@ -76,7 +76,7 @@ public class SoundcloudStreamExtractor extends StreamExtractor { @Override public Description getDescription() { - return new Description(getServiceId(), track.getString("description")); + return new Description(track.getString("description"), Description.PLAIN_TEXT); } @Override diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index d8ded292d..ea870d715 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -184,7 +184,7 @@ public class YoutubeStreamExtractor extends StreamExtractor { assertPageFetched(); try { // first try to get html-formatted description - return new Description(getServiceId(), parseHtmlAndGetFullLinks(doc.select("p[id=\"eow-description\"]").first().html())); + return new Description(parseHtmlAndGetFullLinks(doc.select("p[id=\"eow-description\"]").first().html()), Description.HTML); } catch (Exception e) { try { // fallback to raw non-html description diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Description.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Description.java index 1ce5e948b..cde422bb2 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Description.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Description.java @@ -1,29 +1,17 @@ package org.schabi.newpipe.extractor.stream; -import static org.schabi.newpipe.extractor.ServiceList.PeerTube; -import static org.schabi.newpipe.extractor.ServiceList.YouTube; - public class Description { - private String content; - private int type; public static final int HTML = 1; public static final int MARKDOWN = 2; public static final int PLAIN_TEXT = 3; - public static final Description emptyDescription = new Description(PLAIN_TEXT, ""); + public static final Description emptyDescription = new Description("", PLAIN_TEXT); - public Description(int serviceID, String content) { - if (serviceID == PeerTube.getServiceId()) { - this.type = MARKDOWN; - } else if (serviceID == YouTube.getServiceId()) { - this.type = HTML; - } else { - this.type = PLAIN_TEXT; - } - setContent(content); - } + private String content; + private int type; - private void setContent(String content) { + public Description(String content, int type) { + this.type = type; if (content == null) { this.content = ""; } else { @@ -31,11 +19,6 @@ public class Description { } } - public Description(String content, int type) { - this.type = type; - setContent(content); - } - public String getContent() { return content; }