From ba8782a9ed20271bca01b87ec22d8edc8652c45e Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Wed, 16 Dec 2020 08:32:04 +0100 Subject: [PATCH 1/2] Use lowercase string for extracting cookies The map in a real response happens to ignore upper-/lowercase differences. Other maps used in unit test may not have that behaviour. --- .../extractor/services/youtube/YoutubeParsingHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java index 835ddd309b..69d8771283 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java @@ -591,7 +591,7 @@ public static Response getResponse(final String url, final Localization localiza } public static String extractCookieValue(final String cookieName, final Response response) { - final List cookies = response.responseHeaders().get("Set-Cookie"); + final List cookies = response.responseHeaders().get("set-cookie"); int startIndex; String result = ""; for (final String cookie : cookies) { From cdcb66b93e5a57f6a676b27f3a2ba9a1b923dc01 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Wed, 16 Dec 2020 08:33:32 +0100 Subject: [PATCH 2/2] Clean up stuff from mix pl Coming from unclean merge and missing hints from IDE --- .../extractor/services/youtube/YoutubeParsingHelper.java | 6 ------ .../services/youtube/YoutubeMixPlaylistExtractorTest.java | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java index 69d8771283..b36fe039aa 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java @@ -65,12 +65,6 @@ public class YoutubeParsingHelper { private YoutubeParsingHelper() { } - /** - * The official youtube app supports intents in this format, where after the ':' is the videoId. - * Accordingly there are other apps sharing streams in this format. - */ - public final static String BASE_YOUTUBE_INTENT_URL = "vnd.youtube"; - private static final String HARDCODED_CLIENT_VERSION = "2.20200214.04.00"; private static String clientVersion; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMixPlaylistExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMixPlaylistExtractorTest.java index 49fb3fe040..8832189115 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMixPlaylistExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMixPlaylistExtractorTest.java @@ -41,10 +41,10 @@ public class YoutubeMixPlaylistExtractorTest { private static final String VIDEO_ID = "_AzeUSL9lZc"; private static final String VIDEO_TITLE = "Most Beautiful And Emotional Piano: Anime Music Shigatsu wa Kimi no Uso OST IMO"; + private static final Map dummyCookie + = Collections.singletonMap(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever"); private static YoutubeMixPlaylistExtractor extractor; - private static Map dummyCookie - = Collections.singletonMap(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever"); public static class Mix {