mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-22 14:20:37 -04:00
Added minutes as well
This commit is contained in:
parent
f9460e31bc
commit
48af0af9d5
1 changed files with 11 additions and 0 deletions
|
@ -241,6 +241,17 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
||||||
if !time_text.nil?
|
if !time_text.nil?
|
||||||
time_string = time_text["simpleText"]?
|
time_string = time_text["simpleText"]?
|
||||||
end
|
end
|
||||||
|
if !time_string.nil? && time_string.to_s.ends_with?("minute ago")
|
||||||
|
time = Time.utc.to_unix - 60
|
||||||
|
end
|
||||||
|
if !time_string.nil? && time_string.to_s.ends_with?("minutes ago") && !time_string.to_s.starts_with?("Streamed")
|
||||||
|
minutes = time_string.to_s.rchop(" minutes ago").to_i
|
||||||
|
time = Time.utc.to_unix - 60*minutes
|
||||||
|
end
|
||||||
|
if !time_string.nil? && time_string.to_s.ends_with?("minutes ago") && time_string.to_s.starts_with?("Streamed")
|
||||||
|
minutes = time_string.to_s.lchop("Streamed ").rchop(" minutes ago").to_i
|
||||||
|
time = Time.utc.to_unix - 60*minutes
|
||||||
|
end
|
||||||
if !time_string.nil? && time_string.to_s.ends_with?("hour ago")
|
if !time_string.nil? && time_string.to_s.ends_with?("hour ago")
|
||||||
time = Time.utc.to_unix - 3600
|
time = Time.utc.to_unix - 3600
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue