diff options
| author | RadoslavL <rlelchev@abv.bg> | 2023-10-11 09:12:27 +0300 |
|---|---|---|
| committer | RadoslavL <rlelchev@abv.bg> | 2023-10-11 09:12:27 +0300 |
| commit | fa59f41f7bc4df72ea49d6e2e9902a93e0de5228 (patch) | |
| tree | b9357f3ecefa8725db7adb999556551e0a574bc0 /src | |
| parent | 20ca1ebcc0e0c6a7041dfa12dd241abd2b3f464c (diff) | |
| download | invidious-fa59f41f7bc4df72ea49d6e2e9902a93e0de5228.tar.gz invidious-fa59f41f7bc4df72ea49d6e2e9902a93e0de5228.tar.bz2 invidious-fa59f41f7bc4df72ea49d6e2e9902a93e0de5228.zip | |
Fixed an issue
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos/parser.cr | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index ed313fe5..373715fe 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -236,8 +236,13 @@ 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 = decode_date(item["publishedTimeText"].to_s) - published1 = JSON::Any.new(time.to_unix.to_s) + time_text = item["publishedTimeText"]? + if !time_text.nil? + time = decode_date(item["publishedTimeText"].to_s) + published1 = JSON::Any.new(time.to_unix.to_s) + else + published1 = JSON::Any.new("") + end related_video = parse_related_video(item, published1) related << JSON::Any.new(related_video) if related_video end |
