Invidious is an alternative front-end to YouTube
Use a regex to fix badly aligned captions
Samantaz Foxd12dff9dcfd2
diff --git a/src/invidious/routes/api/v1/videos.cr b/src/invidious/routes/api/v1/videos.crindex 86eb26ee..2b23d2ad 100644--- a/src/invidious/routes/api/v1/videos.cr+++ b/src/invidious/routes/api/v1/videos.cr@@ -130,7 +130,13 @@ module Invidious::Routes::API::V1::Videosendendelse+ # Some captions have "align:[start/end]" and "position:[num]%"+ # attributes. Those are causing issues with VideoJS, which is unable+ # to properly align the captions on the video, so we remove them.+ #+ # See: https://github.com/iv-org/invidious/issues/2391webvtt = YT_POOL.client &.get("#{url}&format=vtt").body+ .gsub(/([0-9:.]+ --> [0-9:.]+).+/, "\\1")endif title = env.params.query["title"]?