mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-13 22:00:29 +05:30
Add videoId scope and fix sentry transaction trace.
This commit is contained in:
parent
fa1b3163d4
commit
f4cb18d102
@ -37,12 +37,18 @@ import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper
|
||||
public class StreamHandlers {
|
||||
public static byte[] streamsResponse(String videoId) throws Exception {
|
||||
|
||||
Sentry.configureScope(scope -> {
|
||||
scope.setContexts("videoId", videoId);
|
||||
});
|
||||
|
||||
final var futureStream = Multithreading.supplyAsync(() -> {
|
||||
ITransaction transaction = Sentry.startTransaction("StreamInfo fetch", "fetch");
|
||||
try {
|
||||
return StreamInfo.getInfo("https://www.youtube.com/watch?v=" + videoId);
|
||||
} catch (Exception e) {
|
||||
ExceptionUtils.rethrow(e);
|
||||
} finally {
|
||||
transaction.finish();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
@ -189,6 +195,10 @@ public class StreamHandlers {
|
||||
|
||||
public static byte[] commentsResponse(String videoId) throws Exception {
|
||||
|
||||
Sentry.configureScope(scope -> {
|
||||
scope.setContexts("videoId", videoId);
|
||||
});
|
||||
|
||||
CommentsInfo info = CommentsInfo.getInfo("https://www.youtube.com/watch?v=" + videoId);
|
||||
|
||||
List<Comment> comments = new ObjectArrayList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user