@@ -1017,9 +1017,9 @@ public static String getValidJsonResponseBody(@Nonnull final Response response)
10171017 return responseBody ;
10181018 }
10191019
1020- public static JsonObject getJsonPostResponse (final String endpoint ,
1020+ public static JsonObject getJsonPostResponse (@ Nonnull final String endpoint ,
10211021 final byte [] body ,
1022- final Localization localization )
1022+ @ Nonnull final Localization localization )
10231023 throws IOException , ExtractionException {
10241024 final var headers = getYouTubeHeaders ();
10251025
@@ -1028,6 +1028,26 @@ public static JsonObject getJsonPostResponse(final String endpoint,
10281028 + DISABLE_PRETTY_PRINT_PARAMETER , headers , body , localization )));
10291029 }
10301030
1031+ public static JsonObject getJsonPostResponse (@ Nonnull final String endpoint ,
1032+ @ Nonnull final List <String > queryParameters ,
1033+ final byte [] body ,
1034+ @ Nonnull final Localization localization )
1035+ throws IOException , ExtractionException {
1036+ final var headers = getYouTubeHeaders ();
1037+
1038+ final String queryParametersString ;
1039+ if (queryParameters .isEmpty ()) {
1040+ queryParametersString = "?" + DISABLE_PRETTY_PRINT_PARAMETER ;
1041+ } else {
1042+ queryParametersString = "?" + String .join ("&" , queryParameters )
1043+ + "&" + DISABLE_PRETTY_PRINT_PARAMETER ;
1044+ }
1045+
1046+ return JsonUtils .toJsonObject (getValidJsonResponseBody (
1047+ getDownloader ().postWithContentTypeJson (YOUTUBEI_V1_URL + endpoint
1048+ + queryParametersString , headers , body , localization )));
1049+ }
1050+
10311051 @ Nonnull
10321052 public static JsonBuilder <JsonObject > prepareDesktopJsonBuilder (
10331053 @ Nonnull final Localization localization ,
0 commit comments