Merge pull request #2872 from SamantazFox/misaligned-captions

Use a regex to fix badly aligned captions
このコミットが含まれているのは:
Samantaz Fox 2022-02-10 18:38:59 +01:00 committed by GitHub
コミット da10cdd5ab
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更6行の追加0行の削除

ファイルの表示

@ -130,7 +130,13 @@ module Invidious::Routes::API::V1::Videos
end
end
else
# 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/2391
webvtt = YT_POOL.client &.get("#{url}&format=vtt").body
.gsub(/([0-9:.]+ --> [0-9:.]+).+/, "\\1")
end
if title = env.params.query["title"]?