forked from j62/ctbrec
Fix URLs for models with special characters in their name
This commit is contained in:
parent
eaf5fd2ed7
commit
2dd32fed0c
|
@ -4,8 +4,6 @@ import static ctbrec.Model.State.*;
|
||||||
import static ctbrec.io.HttpConstants.*;
|
import static ctbrec.io.HttpConstants.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -51,7 +49,8 @@ public class StripchatModel extends AbstractModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject loadModelInfo() throws IOException {
|
private JSONObject loadModelInfo() throws IOException {
|
||||||
String url = getSite().getBaseUrl() + "/api/front/users/username/" + URLEncoder.encode(getName(), StandardCharsets.UTF_8.name());
|
String name = getName();
|
||||||
|
String url = getSite().getBaseUrl() + "/api/front/users/username/" + name;
|
||||||
Request req = new Request.Builder()
|
Request req = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.header(ACCEPT, MIMETYPE_APPLICATION_JSON)
|
.header(ACCEPT, MIMETYPE_APPLICATION_JSON)
|
||||||
|
@ -72,7 +71,7 @@ public class StripchatModel extends AbstractModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StreamSource> getStreamSources() throws IOException, ExecutionException, ParseException, PlaylistException, JAXBException {
|
public List<StreamSource> getStreamSources() throws IOException, ExecutionException, ParseException, PlaylistException, JAXBException {
|
||||||
String name = URLEncoder.encode(getName(), StandardCharsets.UTF_8.name());
|
String name = getName();
|
||||||
String url = getSite().getBaseUrl() + "/api/front/models/username/" + name + "/cam?triggerRequest=loadCam";
|
String url = getSite().getBaseUrl() + "/api/front/models/username/" + name + "/cam?triggerRequest=loadCam";
|
||||||
Request req = new Request.Builder()
|
Request req = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
|
|
Loading…
Reference in New Issue