Skip to content

Commit aa6b727

Browse files
authored
Merge pull request #804 from Stypox/fix-yt-music-mix
[YouTube] Fix music mixes in some countries
2 parents 843945f + dd8687f commit aa6b727

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,10 +1085,13 @@ public static String generateConsentCookie() {
10851085
public static String extractCookieValue(final String cookieName,
10861086
@Nonnull final Response response) {
10871087
final List<String> cookies = response.responseHeaders().get("set-cookie");
1088-
int startIndex;
1089-
String result = "";
1088+
if (cookies == null) {
1089+
return EMPTY_STRING;
1090+
}
1091+
1092+
String result = EMPTY_STRING;
10901093
for (final String cookie : cookies) {
1091-
startIndex = cookie.indexOf(cookieName);
1094+
final int startIndex = cookie.indexOf(cookieName);
10921095
if (startIndex != -1) {
10931096
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
10941097
cookie.indexOf(";", startIndex));

0 commit comments

Comments
 (0)