Revert "Replace generateStreamUrl for Lbry get call"

This reverts commit 4d44d81f59.
This commit is contained in:
Thomas Zarebczan 2022-05-12 18:15:56 -04:00
parent 4d44d81f59
commit 6e9b07ec6f
3 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,7 @@ 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,6 +10,7 @@ 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, THUMBNAIL_CARDS_CDN_URL } = require('../../config'); const { URL, LBRY_WEB_STREAMING_API, 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) {
const uri = buildURI({ claimName, claimId }); return `${LBRY_WEB_STREAMING_API}/content/claims/${encodeURIComponent(claimName)
return Lbry.get({ uri }).then(({ streaming_url }) => streaming_url); .replace(/'/g, '%27')
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')}/${claimId}/${encodeURIComponent(claimName)}`;
} }
function generateEmbedUrl(claimName, claimId, startTime, referralLink) { function generateEmbedUrl(claimName, claimId, startTime, referralLink) {