mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
[YouTube] Do not send a visitorData for every InnerTube request
As YouTube is disabling ability to use a random visitor ID in a visitorData on player requests and BotGuard challenges, it shouldn't matter if we use a random one or not for other request types.
This commit is contained in:
parent
94541d2d94
commit
9e45c8001a
@ -1065,22 +1065,7 @@ public final class YoutubeParsingHelper {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
public static JsonBuilder<JsonObject> prepareDesktopJsonBuilder(
|
public static JsonBuilder<JsonObject> prepareDesktopJsonBuilder(
|
||||||
@Nonnull final Localization localization,
|
@Nonnull final Localization localization,
|
||||||
@Nonnull final ContentCountry contentCountry)
|
@Nonnull final ContentCountry contentCountry) throws IOException, ExtractionException {
|
||||||
throws IOException, ExtractionException {
|
|
||||||
return prepareDesktopJsonBuilder(localization, contentCountry, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
public static JsonBuilder<JsonObject> prepareDesktopJsonBuilder(
|
|
||||||
@Nonnull final Localization localization,
|
|
||||||
@Nonnull final ContentCountry contentCountry,
|
|
||||||
@Nullable final String visitorData)
|
|
||||||
throws IOException, ExtractionException {
|
|
||||||
String vData = visitorData;
|
|
||||||
if (vData == null) {
|
|
||||||
vData = randomVisitorData(contentCountry);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
return JsonObject.builder()
|
return JsonObject.builder()
|
||||||
.object("context")
|
.object("context")
|
||||||
@ -1092,7 +1077,6 @@ public final class YoutubeParsingHelper {
|
|||||||
.value("originalUrl", "https://www.youtube.com")
|
.value("originalUrl", "https://www.youtube.com")
|
||||||
.value("platform", DESKTOP_CLIENT_PLATFORM)
|
.value("platform", DESKTOP_CLIENT_PLATFORM)
|
||||||
.value("utcOffsetMinutes", 0)
|
.value("utcOffsetMinutes", 0)
|
||||||
.value("visitorData", vData)
|
|
||||||
.end()
|
.end()
|
||||||
.object("request")
|
.object("request")
|
||||||
.array("internalExperimentFlags")
|
.array("internalExperimentFlags")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user