mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Add option to disable LBRY.
This commit is contained in:
parent
748235fcbd
commit
6c6c8c021f
3 changed files with 9 additions and 0 deletions
|
@ -27,6 +27,8 @@ RYD_PROXY_URL:https://ryd-proxy.kavin.rocks
|
|||
DISABLE_RYD:false
|
||||
# Disable API server (node just runs timers if enabled)
|
||||
DISABLE_SERVER:false
|
||||
# Disable the inclusion of LBRY streams
|
||||
DISABLE_LBRY:false
|
||||
# Hibernate properties
|
||||
hibernate.connection.url:jdbc:postgresql://postgres:5432/piped
|
||||
hibernate.connection.driver_class:org.postgresql.Driver
|
||||
|
|
|
@ -57,6 +57,8 @@ public class Constants {
|
|||
|
||||
public static final boolean DISABLE_SERVER;
|
||||
|
||||
public static final boolean DISABLE_LBRY;
|
||||
|
||||
public static final String VERSION;
|
||||
|
||||
public static final ObjectMapper mapper = new ObjectMapper().addMixIn(Page.class, PageMixin.class);
|
||||
|
@ -87,6 +89,7 @@ public class Constants {
|
|||
RYD_PROXY_URL = getProperty(prop, "RYD_PROXY_URL", "https://ryd-proxy.kavin.rocks");
|
||||
DISABLE_RYD = Boolean.parseBoolean(getProperty(prop, "DISABLE_RYD", "false"));
|
||||
DISABLE_SERVER = Boolean.parseBoolean(getProperty(prop, "DISABLE_SERVER", "false"));
|
||||
DISABLE_LBRY = Boolean.parseBoolean(getProperty(prop, "DISABLE_LBRY", "false"));
|
||||
System.getenv().forEach((key, value) -> {
|
||||
if (key.startsWith("hibernate"))
|
||||
hibernateProperties.put(key, value);
|
||||
|
|
|
@ -12,6 +12,10 @@ import java.io.IOException;
|
|||
public class LbryHelper {
|
||||
|
||||
public static String getLBRYId(String videoId) throws IOException {
|
||||
|
||||
if (Constants.DISABLE_LBRY)
|
||||
return null;
|
||||
|
||||
return new JSONObject(
|
||||
RequestUtils.sendGet("https://api.lbry.com/yt/resolve?video_ids=" + URLUtils.silentEncode(videoId))
|
||||
).getJSONObject("data").getJSONObject("videos").optString(videoId, null);
|
||||
|
|
Loading…
Reference in a new issue