2
0
mirror of https://github.com/TeamNewPipe/NewPipeExtractor synced 2025-08-30 13:57:46 +00:00

[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").
This commit is contained in:
TiA4f8R
2022-05-15 11:20:06 +02:00
parent 23fa31a1ec
commit c34b5e3a8b

View File

@@ -853,7 +853,7 @@ public final class YoutubeParsingHelper {
musicKey = getStringResultFromRegexArray(response, INNERTUBE_API_KEY_REGEXES, 1);
musicClientName = Parser.matchGroup1(INNERTUBE_CLIENT_NAME_REGEX, response);
} 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<>();
addCookieHeader(headers);
final String html = getDownloader().get(url, headers).responseBody();