mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-29 08:20:30 +05:30
Support for initial pages of other channel URL types.
This commit is contained in:
parent
3811a7f264
commit
5b77fbed1c
@ -78,7 +78,22 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
||||
}
|
||||
})).map("/channels/:channelId", AsyncServlet.ofBlocking(executor, request -> {
|
||||
try {
|
||||
return getJsonResponse(ResponseHelper.channelResponse(request.getPathParameter("channelId")),
|
||||
return getJsonResponse(
|
||||
ResponseHelper.channelResponse("channel/" + request.getPathParameter("channelId")),
|
||||
"public, max-age=600");
|
||||
} catch (Exception e) {
|
||||
return getErrorResponse(e);
|
||||
}
|
||||
})).map("/c/:name", AsyncServlet.ofBlocking(executor, request -> {
|
||||
try {
|
||||
return getJsonResponse(ResponseHelper.channelResponse("c/" + request.getPathParameter("name")),
|
||||
"public, max-age=600");
|
||||
} catch (Exception e) {
|
||||
return getErrorResponse(e);
|
||||
}
|
||||
})).map("/user/:name", AsyncServlet.ofBlocking(executor, request -> {
|
||||
try {
|
||||
return getJsonResponse(ResponseHelper.channelResponse("user/" + request.getPathParameter("name")),
|
||||
"public, max-age=600");
|
||||
} catch (Exception e) {
|
||||
return getErrorResponse(e);
|
||||
|
@ -166,9 +166,9 @@ public class ResponseHelper {
|
||||
|
||||
}
|
||||
|
||||
public static final byte[] channelResponse(String channelId) throws Exception {
|
||||
public static final byte[] channelResponse(String channelPath) throws Exception {
|
||||
|
||||
final ChannelInfo info = ChannelInfo.getInfo("https://youtube.com/channel/" + channelId);
|
||||
final ChannelInfo info = ChannelInfo.getInfo("https://youtube.com/" + channelPath);
|
||||
|
||||
final List<StreamItem> relatedStreams = new ObjectArrayList<>();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user