|
4 | 4 | import com.grack.nanojson.JsonObject; |
5 | 5 | import com.grack.nanojson.JsonParser; |
6 | 6 | import com.grack.nanojson.JsonParserException; |
7 | | - |
8 | 7 | import org.schabi.newpipe.extractor.MediaFormat; |
9 | 8 | import org.schabi.newpipe.extractor.NewPipe; |
10 | 9 | import org.schabi.newpipe.extractor.StreamingService; |
|
30 | 29 | import org.schabi.newpipe.extractor.utils.JsonUtils; |
31 | 30 | import org.schabi.newpipe.extractor.utils.Utils; |
32 | 31 |
|
| 32 | +import javax.annotation.Nonnull; |
| 33 | +import javax.annotation.Nullable; |
33 | 34 | import java.io.IOException; |
34 | 35 | import java.io.UnsupportedEncodingException; |
35 | 36 | import java.net.URLEncoder; |
|
38 | 39 | import java.util.List; |
39 | 40 | import java.util.Locale; |
40 | 41 |
|
41 | | -import javax.annotation.Nonnull; |
42 | | -import javax.annotation.Nullable; |
43 | | - |
44 | 42 | public class PeertubeStreamExtractor extends StreamExtractor { |
45 | 43 | private final String baseUrl; |
46 | 44 | private JsonObject json; |
@@ -269,7 +267,9 @@ public StreamInfoItemsCollector getRelatedStreams() throws IOException, Extracti |
269 | 267 | final List<String> tags = getTags(); |
270 | 268 | final String apiUrl; |
271 | 269 | if (tags.isEmpty()) { |
272 | | - apiUrl = getUploaderUrl() + "/videos?start=0&count=8"; |
| 270 | + apiUrl = baseUrl + "/api/v1/accounts/" + JsonUtils.getString(json, "account.name") |
| 271 | + + "@" + JsonUtils.getString(json, "account.host") + |
| 272 | + "/videos?start=0&count=8"; |
273 | 273 | } else { |
274 | 274 | apiUrl = getRelatedStreamsUrl(tags); |
275 | 275 | } |
|
0 commit comments