Fix for empty lbry streams. (#180)

This commit is contained in:
Kavin 2022-02-02 21:23:37 +00:00 committed by GitHub
parent c07cf5fd1f
commit 3748afdd72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import me.kavin.piped.consts.Constants;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.IOException; import java.io.IOException;
@ -18,6 +19,10 @@ public class LbryHelper {
public static String getLBRYStreamURL(String lbryId) public static String getLBRYStreamURL(String lbryId)
throws IOException { throws IOException {
if (StringUtils.isEmpty(lbryId))
return null;
var request = new Request.Builder() var request = new Request.Builder()
.url("https://api.lbry.tv/api/v1/proxy?m=get") .url("https://api.lbry.tv/api/v1/proxy?m=get")
.post(RequestBody.create(String.valueOf( .post(RequestBody.create(String.valueOf(