mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-03-01 09:49:41 -05:00
Updated ProxyData exceptions to include previous exception to finish stacktrace
Updated LiveUserData.Request to throw an IllegalArgumentException when a null or blank username is provided Updated HttpClientSettings to use setProxyClientSettings instead of direct access Fixed ProxyRotation bug starting at index 1 instead of 0 and made methods default to synchronized in case concurrency is used in implementors code Changed HttpClient#toUrl to toUri Added @Getter to HttpClientFactory for liveClientSettings Added consumer to TikTokLive#requests so that way proxies can be used when calling the fetch methods Changed LiveUserData.Response#startTime to clarify the variable name
This commit is contained in:
@@ -90,14 +90,14 @@ public class HttpClient {
|
||||
return toResponse().map(HttpResponse::body);
|
||||
}
|
||||
|
||||
public URI toUrl() {
|
||||
public URI toUri() {
|
||||
var stringUrl = prepareUrlWithParameters(url, httpClientSettings.getParams());
|
||||
return URI.create(stringUrl);
|
||||
}
|
||||
|
||||
protected HttpRequest prepareGetRequest() {
|
||||
var requestBuilder = HttpRequest.newBuilder().GET();
|
||||
requestBuilder.uri(toUrl());
|
||||
requestBuilder.uri(toUri());
|
||||
requestBuilder.timeout(httpClientSettings.getTimeout());
|
||||
httpClientSettings.getHeaders().forEach(requestBuilder::setHeader);
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
package io.github.jwdeveloper.tiktok.http;
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.settings.*;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class HttpClientFactory {
|
||||
private final LiveClientSettings liveClientSettings;
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public class HttpProxyClient extends HttpClient {
|
||||
public X509Certificate[] getAcceptedIssuers() { return null; }
|
||||
}}, null);
|
||||
|
||||
URL url = toUrl().toURL();
|
||||
URL url = toUri().toURL();
|
||||
|
||||
if (proxySettings.hasNext()) {
|
||||
try {
|
||||
@@ -117,7 +117,7 @@ public class HttpProxyClient extends HttpClient {
|
||||
|
||||
var responseInfo = createResponseInfo(socksConnection.getResponseCode(), headers);
|
||||
|
||||
var response = createHttpResponse(body, toUrl(), responseInfo);
|
||||
var response = createHttpResponse(body, toUri(), responseInfo);
|
||||
|
||||
return ActionResult.success(response);
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user