diff --git a/ui/util/web.js b/ui/util/web.js index e6f284358..9f4703ae9 100644 --- a/ui/util/web.js +++ b/ui/util/web.js @@ -3,7 +3,10 @@ const { URL, LBRY_WEB_STREAMING_API } = require('../../config'); const CONTINENT_COOKIE = 'continent'; function generateStreamUrl(claimName, claimId) { - return `${LBRY_WEB_STREAMING_API}/content/claims/${claimName}/${claimId}/stream`; + return `${LBRY_WEB_STREAMING_API}/content/claims/${encodeURIComponent(claimName) + .replace(/'/g, '%27') + .replace(/\(/g, '%28') + .replace(/\)/g, '%29')}/${claimId}/stream`; } function generateEmbedUrl(claimName, claimId, includeStartTime, startTime, referralLink) { @@ -16,7 +19,10 @@ function generateEmbedUrl(claimName, claimId, includeStartTime, startTime, refer urlParams.append('r', referralLink); } - return `${URL}/$/embed/${encodeURIComponent(claimName).replace(/'/g, '%27')}/${claimId}?${urlParams.toString()}`; + return `${URL}/$/embed/${encodeURIComponent(claimName) + .replace(/'/g, '%27') + .replace(/\(/g, '%28') + .replace(/\)/g, '%29')}/${claimId}?${urlParams.toString()}`; } function generateDownloadUrl(claimName, claimId) { diff --git a/web/src/rss.js b/web/src/rss.js index 714d9a448..e6c415251 100644 --- a/web/src/rss.js +++ b/web/src/rss.js @@ -46,7 +46,7 @@ async function getClaimsFromChannel(claimId, count) { page_size: count, has_source: true, claim_type: 'stream', - order_by: ['creation_timestamp'], + order_by: ['release_time'], no_totals: true, }; @@ -70,7 +70,8 @@ const generateEnclosureForClaimContent = (claim) => { case 'document': case 'software': return { - url: generateStreamUrl(claim.name, claim.claim_id), + url: + generateStreamUrl(claim.name, claim.claim_id) + (value.source && value.source.media_type.split('/')[0]) || '', type: (value.source && value.source.media_type) || undefined, size: (value.source && value.source.size) || 0, // Per spec, 0 is a valid fallback. };