Replace generateStreamUrl for Lbry get call

+ remove unused config
This commit is contained in:
Thomas Zarebczan 2022-05-12 15:14:14 -04:00 committed by Thomas Zarebczan
parent ac0ec4794a
commit 4d44d81f59
3 changed files with 5 additions and 7 deletions

View file

@ -9,7 +9,6 @@ WEB_SERVER_PORT=1337
# -- APIs --- # -- APIs ---
LBRY_WEB_API=https://api.na-backend.odysee.com 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 LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video
COMMENT_SERVER_API=https://comments.odysee.tv/api/v2 COMMENT_SERVER_API=https://comments.odysee.tv/api/v2
SEARCH_SERVER_API_ALT=https://recsys.odysee.tv/search SEARCH_SERVER_API_ALT=https://recsys.odysee.tv/search

View file

@ -10,7 +10,6 @@ const config = {
LBRY_WEB_PUBLISH_API: process.env.LBRY_WEB_PUBLISH_API, LBRY_WEB_PUBLISH_API: process.env.LBRY_WEB_PUBLISH_API,
LBRY_WEB_PUBLISH_API_V2: process.env.LBRY_WEB_PUBLISH_API_V2, LBRY_WEB_PUBLISH_API_V2: process.env.LBRY_WEB_PUBLISH_API_V2,
LBRY_API_URL: process.env.LBRY_API_URL, // api.odysee.com', 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, LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API,
SEARCH_SERVER_API: process.env.SEARCH_SERVER_API, SEARCH_SERVER_API: process.env.SEARCH_SERVER_API,
SEARCH_SERVER_API_ALT: process.env.SEARCH_SERVER_API_ALT, SEARCH_SERVER_API_ALT: process.env.SEARCH_SERVER_API_ALT,

View file

@ -1,12 +1,12 @@
const { URL, LBRY_WEB_STREAMING_API, THUMBNAIL_CARDS_CDN_URL } = require('../../config'); const { URL, THUMBNAIL_CARDS_CDN_URL } = require('../../config');
const { buildURI } = require('../../web/src/lbryURI');
const { lbryProxy: Lbry } = require('../../web/lbry');
const CONTINENT_COOKIE = 'continent'; const CONTINENT_COOKIE = 'continent';
function generateStreamUrl(claimName, claimId) { function generateStreamUrl(claimName, claimId) {
return `${LBRY_WEB_STREAMING_API}/content/claims/${encodeURIComponent(claimName) const uri = buildURI({ claimName, claimId });
.replace(/'/g, '%27') return Lbry.get({ uri }).then(({ streaming_url }) => streaming_url);
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')}/${claimId}/${encodeURIComponent(claimName)}`;
} }
function generateEmbedUrl(claimName, claimId, startTime, referralLink) { function generateEmbedUrl(claimName, claimId, startTime, referralLink) {