mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-08 21:52:28 +05:30
Added minutes as well
This commit is contained in:
parent
f9460e31bc
commit
48af0af9d5
@ -241,6 +241,17 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
||||
if !time_text.nil?
|
||||
time_string = time_text["simpleText"]?
|
||||
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")
|
||||
time = Time.utc.to_unix - 3600
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user