diff options
| author | RadoslavL <rlelchev@abv.bg> | 2023-10-09 12:09:03 +0300 |
|---|---|---|
| committer | RadoslavL <rlelchev@abv.bg> | 2023-10-09 12:09:03 +0300 |
| commit | f9460e31bc77d17c7fc6719770402008b422d7b4 (patch) | |
| tree | 9eb7d26822659fb52db637dfd1fbb86c30a7ee79 | |
| parent | b7a252b096f7bc29f105ea25454fe053cf4b4d4b (diff) | |
| download | invidious-f9460e31bc77d17c7fc6719770402008b422d7b4.tar.gz invidious-f9460e31bc77d17c7fc6719770402008b422d7b4.tar.bz2 invidious-f9460e31bc77d17c7fc6719770402008b422d7b4.zip | |
Fixed an issue
| -rw-r--r-- | src/invidious/videos/parser.cr | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index a1b9b988..e7458672 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -236,7 +236,11 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any .dig?("secondaryResults", "secondaryResults", "results") secondary_results.try &.as_a.each do |element| if item = element["compactVideoRenderer"]? - time_string = item["publishedTimeText"]["simpleText"]? + time_text = item["publishedTimeText"]? + time_string = nil + if !time_text.nil? + time_string = time_text["simpleText"]? + end if !time_string.nil? && time_string.to_s.ends_with?("hour ago") time = Time.utc.to_unix - 3600 end |
