diff --git a/.env.defaults b/.env.defaults index af63458b2..34055c0af 100644 --- a/.env.defaults +++ b/.env.defaults @@ -9,6 +9,7 @@ WEB_SERVER_PORT=1337 # -- APIs --- LBRY_WEB_API=https://api.na-backend.odysee.com +LBRY_WEB_STREAMING_API=https://player.odycdn.com LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video COMMENT_SERVER_API=https://comments.odysee.tv/api/v2 SEARCH_SERVER_API_ALT=https://recsys.odysee.tv/search diff --git a/config.js b/config.js index c4715d6a3..15c5c1b7f 100644 --- a/config.js +++ b/config.js @@ -10,6 +10,7 @@ const config = { LBRY_WEB_PUBLISH_API: process.env.LBRY_WEB_PUBLISH_API, LBRY_WEB_PUBLISH_API_V2: process.env.LBRY_WEB_PUBLISH_API_V2, LBRY_API_URL: process.env.LBRY_API_URL, // api.odysee.com', + LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, // player.odycdn.com LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API, SEARCH_SERVER_API: process.env.SEARCH_SERVER_API, SEARCH_SERVER_API_ALT: process.env.SEARCH_SERVER_API_ALT, diff --git a/ui/util/web.js b/ui/util/web.js index 497737cd3..ab9413dce 100644 --- a/ui/util/web.js +++ b/ui/util/web.js @@ -1,12 +1,12 @@ -const { URL, THUMBNAIL_CARDS_CDN_URL } = require('../../config'); -const { buildURI } = require('../../web/src/lbryURI'); -const { lbryProxy: Lbry } = require('../../web/lbry'); +const { URL, LBRY_WEB_STREAMING_API, THUMBNAIL_CARDS_CDN_URL } = require('../../config'); const CONTINENT_COOKIE = 'continent'; function generateStreamUrl(claimName, claimId) { - const uri = buildURI({ claimName, claimId }); - return Lbry.get({ uri }).then(({ streaming_url }) => streaming_url); + return `${LBRY_WEB_STREAMING_API}/content/claims/${encodeURIComponent(claimName) + .replace(/'/g, '%27') + .replace(/\(/g, '%28') + .replace(/\)/g, '%29')}/${claimId}/${encodeURIComponent(claimName)}`; } function generateEmbedUrl(claimName, claimId, startTime, referralLink) {