|
4 | 4 | import com.grack.nanojson.JsonObject; |
5 | 5 | import com.grack.nanojson.JsonParser; |
6 | 6 | import com.grack.nanojson.JsonParserException; |
| 7 | + |
7 | 8 | import org.jsoup.Jsoup; |
8 | 9 | import org.jsoup.nodes.Document; |
9 | 10 | import org.jsoup.nodes.Element; |
|
17 | 18 | import org.schabi.newpipe.extractor.StreamingService; |
18 | 19 | import org.schabi.newpipe.extractor.downloader.Downloader; |
19 | 20 | import org.schabi.newpipe.extractor.downloader.Response; |
20 | | -import org.schabi.newpipe.extractor.exceptions.*; |
| 21 | +import org.schabi.newpipe.extractor.exceptions.AgeRestrictedContentException; |
| 22 | +import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException; |
| 23 | +import org.schabi.newpipe.extractor.exceptions.ExtractionException; |
| 24 | +import org.schabi.newpipe.extractor.exceptions.GeographicRestrictionException; |
| 25 | +import org.schabi.newpipe.extractor.exceptions.PaidContentException; |
| 26 | +import org.schabi.newpipe.extractor.exceptions.ParsingException; |
| 27 | +import org.schabi.newpipe.extractor.exceptions.PrivateContentException; |
| 28 | +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; |
| 29 | +import org.schabi.newpipe.extractor.exceptions.YoutubeMusicPremiumContentException; |
21 | 30 | import org.schabi.newpipe.extractor.linkhandler.LinkHandler; |
22 | 31 | import org.schabi.newpipe.extractor.localization.DateWrapper; |
23 | 32 | import org.schabi.newpipe.extractor.localization.Localization; |
|
27 | 36 | import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper; |
28 | 37 | import org.schabi.newpipe.extractor.services.youtube.YoutubeThrottlingDecoder; |
29 | 38 | import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeChannelLinkHandlerFactory; |
30 | | -import org.schabi.newpipe.extractor.stream.*; |
| 39 | +import org.schabi.newpipe.extractor.stream.AudioStream; |
| 40 | +import org.schabi.newpipe.extractor.stream.Description; |
| 41 | +import org.schabi.newpipe.extractor.stream.Frameset; |
| 42 | +import org.schabi.newpipe.extractor.stream.Stream; |
| 43 | +import org.schabi.newpipe.extractor.stream.StreamExtractor; |
| 44 | +import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor; |
| 45 | +import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector; |
| 46 | +import org.schabi.newpipe.extractor.stream.StreamSegment; |
| 47 | +import org.schabi.newpipe.extractor.stream.StreamType; |
| 48 | +import org.schabi.newpipe.extractor.stream.SubtitlesStream; |
| 49 | +import org.schabi.newpipe.extractor.stream.VideoStream; |
31 | 50 | import org.schabi.newpipe.extractor.utils.JsonUtils; |
32 | 51 | import org.schabi.newpipe.extractor.utils.Parser; |
33 | 52 | import org.schabi.newpipe.extractor.utils.Utils; |
34 | 53 |
|
35 | | -import javax.annotation.Nonnull; |
36 | | -import javax.annotation.Nullable; |
37 | 54 | import java.io.IOException; |
38 | 55 | import java.io.UnsupportedEncodingException; |
39 | 56 | import java.time.LocalDate; |
40 | 57 | import java.time.OffsetDateTime; |
41 | 58 | import java.time.format.DateTimeFormatter; |
42 | | -import java.util.*; |
| 59 | +import java.util.ArrayList; |
| 60 | +import java.util.Collections; |
| 61 | +import java.util.HashMap; |
| 62 | +import java.util.LinkedHashMap; |
| 63 | +import java.util.List; |
| 64 | +import java.util.Locale; |
| 65 | +import java.util.Map; |
| 66 | +import java.util.Objects; |
| 67 | + |
| 68 | +import javax.annotation.Nonnull; |
| 69 | +import javax.annotation.Nullable; |
43 | 70 |
|
44 | | -import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*; |
| 71 | +import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.fixThumbnailUrl; |
| 72 | +import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getJsonResponse; |
| 73 | +import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getTextFromObject; |
| 74 | +import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getUrlFromNavigationEndpoint; |
45 | 75 | import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING; |
46 | 76 | import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; |
47 | 77 |
|
@@ -532,7 +562,7 @@ public List<VideoStream> getVideoStreams() throws ExtractionException { |
532 | 562 |
|
533 | 563 | String oldNParam = throttlingDecoder.parseNParam(url); |
534 | 564 | String newNParam = throttlingDecoder.decodeNParam(oldNParam); |
535 | | - String newUrl = throttlingDecoder.replaceNParam(url, newNParam); |
| 565 | + String newUrl = throttlingDecoder.replaceNParam(url, oldNParam, newNParam); |
536 | 566 |
|
537 | 567 | final VideoStream videoStream = new VideoStream(newUrl, false, itag); |
538 | 568 | if (!Stream.containSimilarStream(videoStream, videoStreams)) { |
|
0 commit comments