Skip to content

Commit 7e481cf

Browse files
authored
Merge pull request #490 from B0pol/peertube_related
[peertube] fix related streams api url when no tags
2 parents 22a4151 + 8d34365 commit 7e481cf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.grack.nanojson.JsonObject;
55
import com.grack.nanojson.JsonParser;
66
import com.grack.nanojson.JsonParserException;
7-
87
import org.schabi.newpipe.extractor.MediaFormat;
98
import org.schabi.newpipe.extractor.NewPipe;
109
import org.schabi.newpipe.extractor.StreamingService;
@@ -30,6 +29,8 @@
3029
import org.schabi.newpipe.extractor.utils.JsonUtils;
3130
import org.schabi.newpipe.extractor.utils.Utils;
3231

32+
import javax.annotation.Nonnull;
33+
import javax.annotation.Nullable;
3334
import java.io.IOException;
3435
import java.io.UnsupportedEncodingException;
3536
import java.net.URLEncoder;
@@ -38,9 +39,6 @@
3839
import java.util.List;
3940
import java.util.Locale;
4041

41-
import javax.annotation.Nonnull;
42-
import javax.annotation.Nullable;
43-
4442
public class PeertubeStreamExtractor extends StreamExtractor {
4543
private final String baseUrl;
4644
private JsonObject json;
@@ -269,7 +267,9 @@ public StreamInfoItemsCollector getRelatedStreams() throws IOException, Extracti
269267
final List<String> tags = getTags();
270268
final String apiUrl;
271269
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";
273273
} else {
274274
apiUrl = getRelatedStreamsUrl(tags);
275275
}

0 commit comments

Comments
 (0)