Skip to content

Commit

Permalink
Fix invalid URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eltik committed Jul 2, 2023
1 parent 26ee460 commit f9574cd
Show file tree
Hide file tree
Showing 4 changed files with 468 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist/libraries/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ async function proxyM3U8(url, headers, res) {
if (line.startsWith("#")) {
if (line.startsWith("#EXT-X-KEY:")) {
const regex = /https?:\/\/[^\""\s]+/g;
const url = `${web_server_url}/${web_server_url}${"/ts-proxy?url=" + encodeURIComponent(regex.exec(line)?.[0] ?? "") + "&headers=" + encodeURIComponent(JSON.stringify(headers))}`;
const url = `${web_server_url}/${encodeURIComponent(web_server_url)}${"/ts-proxy?url=" + encodeURIComponent(regex.exec(line)?.[0] ?? "") + "&headers=" + encodeURIComponent(JSON.stringify(headers))}`;
newLines.push(line.replace(regex, url));
}
else {
Expand Down
Loading

0 comments on commit f9574cd

Please sign in to comment.