Skip to content

Commit dd8687f

Browse files
committed
[YouTube] Fix music mixes in some countries
1 parent 69e18c8 commit dd8687f

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
@@ -988,10 +988,13 @@ public static String generateConsentCookie() {
988988
public static String extractCookieValue(final String cookieName,
989989
@Nonnull final Response response) {
990990
final List<String> cookies = response.responseHeaders().get("set-cookie");
991-
int startIndex;
992-
String result = "";
991+
if (cookies == null) {
992+
return EMPTY_STRING;
993+
}
994+
995+
String result = EMPTY_STRING;
993996
for (final String cookie : cookies) {
994-
startIndex = cookie.indexOf(cookieName);
997+
final int startIndex = cookie.indexOf(cookieName);
995998
if (startIndex != -1) {
996999
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
9971000
cookie.indexOf(";", startIndex));

0 commit comments

Comments
 (0)