From 2ba27b39af2a5e19cc9ecd0f813fe1f7de072c86 Mon Sep 17 00:00:00 2001 From: vkay94 Date: Sat, 12 Dec 2020 15:00:45 +0100 Subject: [PATCH] Stream segments: Remove replaceAll from setPreviewUrl --- .../services/youtube/extractors/YoutubeStreamExtractor.java | 3 ++- .../org/schabi/newpipe/extractor/stream/StreamSegment.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 6179742dcd..1f95e62b68 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 @@ -1107,7 +1107,8 @@ public List getStreamSegments() throws ParsingException { final JsonArray previewsArray = segmentJson.getObject("thumbnail").getArray("thumbnails"); if (!previewsArray.isEmpty()) { // Assume that the thumbnail with the highest resolution is at the last position - segment.setPreviewUrl(previewsArray.getObject(previewsArray.size() - 1).getString("url")); + final String url = previewsArray.getObject(previewsArray.size() - 1).getString("url"); + segment.setPreviewUrl(fixThumbnailUrl(url)); } } segments.add(segment); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamSegment.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamSegment.java index 2bb329acaf..5b681073a6 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamSegment.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamSegment.java @@ -64,6 +64,6 @@ public String getPreviewUrl() { } public void setPreviewUrl(@Nullable final String previewUrl) { - this.previewUrl = previewUrl.replaceAll("\\u0026", "&"); + this.previewUrl = previewUrl; } }