mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Merge pull request #2872 from SamantazFox/misaligned-captions
Use a regex to fix badly aligned captions
This commit is contained in:
commit
da10cdd5ab
1 changed files with 6 additions and 0 deletions
|
@ -130,7 +130,13 @@ module Invidious::Routes::API::V1::Videos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
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
|
webvtt = YT_POOL.client &.get("#{url}&format=vtt").body
|
||||||
|
.gsub(/([0-9:.]+ --> [0-9:.]+).+/, "\\1")
|
||||||
end
|
end
|
||||||
|
|
||||||
if title = env.params.query["title"]?
|
if title = env.params.query["title"]?
|
||||||
|
|
Loading…
Reference in a new issue