Skip to content

Commit

Permalink
Merge pull request #804 from Stypox/fix-yt-music-mix
Browse files Browse the repository at this point in the history
[YouTube] Fix music mixes in some countries
  • Loading branch information
XiangRongLin authored Mar 20, 2022
2 parents 843945f + dd8687f commit aa6b727
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1085,10 +1085,13 @@ public static String generateConsentCookie() {
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));
Expand Down

0 comments on commit aa6b727

Please sign in to comment.