mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-29 00:10:31 +05:30
Merge pull request #543 from TeamPiped/lbry-encoding-fix
Fix for non-utf-8 URLs from LBRY.
This commit is contained in:
commit
88f899fd51
@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import rocks.kavin.reqwest4j.ReqwestUtils;
|
import rocks.kavin.reqwest4j.ReqwestUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static me.kavin.piped.consts.Constants.mapper;
|
import static me.kavin.piped.consts.Constants.mapper;
|
||||||
@ -56,6 +57,9 @@ public class LbryHelper {
|
|||||||
if (StringUtils.isEmpty(streamUrl))
|
if (StringUtils.isEmpty(streamUrl))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
// LBRY provides non UTF-8 characters in the URL, which causes issues
|
||||||
|
streamUrl = new URI(streamUrl).toASCIIString();
|
||||||
|
|
||||||
var resp = ReqwestUtils.fetch(streamUrl, "HEAD", null, Map.of(
|
var resp = ReqwestUtils.fetch(streamUrl, "HEAD", null, Map.of(
|
||||||
"Origin", "https://odysee.com",
|
"Origin", "https://odysee.com",
|
||||||
"Referer", "https://odysee.com/"
|
"Referer", "https://odysee.com/"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user