YT: replace some URL chars with slashes instead encoding it

Avoid dashdemux string query omission bug by using URL path with slashes instead of query string
This commit is contained in:
Rafał Dzięgiel
2021-03-18 09:40:46 +01:00
parent 38e5bae199
commit 36d4a5c848

View File

@@ -155,17 +155,19 @@ function _getStreamRepresentation(stream)
repArr.push(` <AudioChannelConfiguration ${audioConfArr.join(' ')}/>`); repArr.push(` <AudioChannelConfiguration ${audioConfArr.join(' ')}/>`);
} }
const encodedURL = Misc.encodeHTML(stream.url); const modURL = stream.url
.replace('?', '/')
.replace(/&/g, '/')
.replace(/=/g, '/');
const segRange = `${stream.indexRange.start}-${stream.indexRange.end}`; const segRange = `${stream.indexRange.start}-${stream.indexRange.end}`;
const initRange = `${stream.initRange.start}-${stream.initRange.end}`; const initRange = `${stream.initRange.start}-${stream.initRange.end}`;
repArr.push( repArr.push(
` <BaseURL>${encodedURL}</BaseURL>`, ` <BaseURL>${modURL}</BaseURL>`,
`<!-- FIXME: causes string query omission bug in dashdemux`,
` <SegmentBase indexRange="${segRange}">`, ` <SegmentBase indexRange="${segRange}">`,
` <Initialization range="${initRange}"/>`, ` <Initialization range="${initRange}"/>`,
` </SegmentBase>`, ` </SegmentBase>`,
`-->`,
` </Representation>`, ` </Representation>`,
); );