[YouTube] Fix music mixes in some countries

This commit is contained in:
Stypox 2022-03-01 23:02:56 +01:00
parent 69e18c80cb
commit dd8687f9fe
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 6 additions and 3 deletions

View File

@ -988,10 +988,13 @@ public class YoutubeParsingHelper {
public static String extractCookieValue(final String cookieName,
@Nonnull final Response response) {
final List<String> cookies = response.responseHeaders().get("set-cookie");
int startIndex;
String result = "";
if (cookies == null) {
return EMPTY_STRING;
}
String result = EMPTY_STRING;
for (final String cookie : cookies) {
startIndex = cookie.indexOf(cookieName);
final int startIndex = cookie.indexOf(cookieName);
if (startIndex != -1) {
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
cookie.indexOf(";", startIndex));