mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Don't fail hard when LBRY throws errors.
This commit is contained in:
parent
cad4e2cc33
commit
2c7baa0710
1 changed files with 12 additions and 8 deletions
|
@ -121,7 +121,7 @@ public class ResponseHelper {
|
||||||
try {
|
try {
|
||||||
return getLBRYId(videoId);
|
return getLBRYId(videoId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ExceptionUtils.rethrow(e);
|
ExceptionHandler.handle(e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
@ -130,7 +130,7 @@ public class ResponseHelper {
|
||||||
try {
|
try {
|
||||||
return getLBRYStreamURL(futureLbryId);
|
return getLBRYStreamURL(futureLbryId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ExceptionUtils.rethrow(e);
|
ExceptionHandler.handle(e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
@ -945,12 +945,16 @@ public class ResponseHelper {
|
||||||
String lbryId = futureLbryId.get();
|
String lbryId = futureLbryId.get();
|
||||||
|
|
||||||
if (!lbryId.isEmpty())
|
if (!lbryId.isEmpty())
|
||||||
return new JSONObject(Constants.h2client.send(HttpRequest
|
return new JSONObject(
|
||||||
.newBuilder(URI.create("https://api.lbry.tv/api/v1/proxy?m=get"))
|
Constants.h2client.send(
|
||||||
|
HttpRequest.newBuilder(URI.create("https://api.lbry.tv/api/v1/proxy?m=get"))
|
||||||
.POST(BodyPublishers.ofString(
|
.POST(BodyPublishers.ofString(
|
||||||
String.valueOf(new JSONObject().put("jsonrpc", "2.0").put("method", "get").put("params",
|
String.valueOf(new JSONObject().put("id", System.currentTimeMillis())
|
||||||
new JSONObject().put("uri", "lbry://" + lbryId).put("save_file", true)))))
|
.put("jsonrpc", "2.0").put("method", "get").put("params",
|
||||||
.build(), BodyHandlers.ofString()).body()).getJSONObject("result").getString("streaming_url");
|
new JSONObject().put("uri", "lbry://" + lbryId)
|
||||||
|
.put("save_file", true)))))
|
||||||
|
.build(),
|
||||||
|
BodyHandlers.ofString()).body()).getJSONObject("result").getString("streaming_url");
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue