diff --git a/config.properties b/config.properties index f30c78b..d270d37 100644 --- a/config.properties +++ b/config.properties @@ -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 diff --git a/src/main/java/me/kavin/piped/consts/Constants.java b/src/main/java/me/kavin/piped/consts/Constants.java index 3ef5f81..90bd387 100644 --- a/src/main/java/me/kavin/piped/consts/Constants.java +++ b/src/main/java/me/kavin/piped/consts/Constants.java @@ -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); diff --git a/src/main/java/me/kavin/piped/utils/LbryHelper.java b/src/main/java/me/kavin/piped/utils/LbryHelper.java index dbf1da3..620eeeb 100644 --- a/src/main/java/me/kavin/piped/utils/LbryHelper.java +++ b/src/main/java/me/kavin/piped/utils/LbryHelper.java @@ -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);