Add timeout for streams response.

This commit is contained in:
Kavin 2022-11-16 19:44:53 +00:00
parent 444d789987
commit f757c439af
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -101,7 +101,7 @@ public class StreamHandlers {
final List<Subtitle> subtitles = new ObjectArrayList<>(); final List<Subtitle> subtitles = new ObjectArrayList<>();
final List<ChapterSegment> chapters = new ObjectArrayList<>(); final List<ChapterSegment> chapters = new ObjectArrayList<>();
final StreamInfo info = futureStream.get(); final StreamInfo info = futureStream.get(10, TimeUnit.SECONDS);
info.getStreamSegments().forEach(segment -> chapters.add(new ChapterSegment(segment.getTitle(), rewriteURL(segment.getPreviewUrl()), info.getStreamSegments().forEach(segment -> chapters.add(new ChapterSegment(segment.getTitle(), rewriteURL(segment.getPreviewUrl()),
segment.getStartTimeSeconds()))); segment.getStartTimeSeconds())));