[YouTube] Fix extraction of YouTube Music client version and API key when using YouTube Music's website in EU

Google returns now the consent page of YouTube for YouTube Music in EU, which can be also avoided by adding the ucbcb parameter to the URL with the value 1 ("?ucbcb=1").
pull/848/head
TiA4f8R 2022-05-15 11:20:06 +02:00
rodzic 23fa31a1ec
commit c34b5e3a8b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: E6D3E7F5949450DD
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -853,7 +853,7 @@ public final class YoutubeParsingHelper {
musicKey = getStringResultFromRegexArray(response, INNERTUBE_API_KEY_REGEXES, 1); musicKey = getStringResultFromRegexArray(response, INNERTUBE_API_KEY_REGEXES, 1);
musicClientName = Parser.matchGroup1(INNERTUBE_CLIENT_NAME_REGEX, response); musicClientName = Parser.matchGroup1(INNERTUBE_CLIENT_NAME_REGEX, response);
} catch (final Exception e) { } catch (final Exception e) {
final String url = "https://music.youtube.com/"; final String url = "https://music.youtube.com/?ucbcb=1";
final Map<String, List<String>> headers = new HashMap<>(); final Map<String, List<String>> headers = new HashMap<>();
addCookieHeader(headers); addCookieHeader(headers);
final String html = getDownloader().get(url, headers).responseBody(); final String html = getDownloader().get(url, headers).responseBody();