[YouTube] Fix music mixes in some countries
This commit is contained in:
parent
69e18c80cb
commit
dd8687f9fe
|
@ -988,10 +988,13 @@ public class YoutubeParsingHelper {
|
||||||
public static String extractCookieValue(final String cookieName,
|
public static String extractCookieValue(final String cookieName,
|
||||||
@Nonnull final Response response) {
|
@Nonnull final Response response) {
|
||||||
final List<String> cookies = response.responseHeaders().get("set-cookie");
|
final List<String> cookies = response.responseHeaders().get("set-cookie");
|
||||||
int startIndex;
|
if (cookies == null) {
|
||||||
String result = "";
|
return EMPTY_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
String result = EMPTY_STRING;
|
||||||
for (final String cookie : cookies) {
|
for (final String cookie : cookies) {
|
||||||
startIndex = cookie.indexOf(cookieName);
|
final int startIndex = cookie.indexOf(cookieName);
|
||||||
if (startIndex != -1) {
|
if (startIndex != -1) {
|
||||||
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
|
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
|
||||||
cookie.indexOf(";", startIndex));
|
cookie.indexOf(";", startIndex));
|
||||||
|
|
Loading…
Reference in New Issue