diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2022-02-14 21:54:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-14 21:54:26 +0100 |
| commit | 7112f3579378808a709b389ed4549baf74f679b1 (patch) | |
| tree | dad9288637112d42324f21f1ddcbed04de96adce /src | |
| parent | 85ba04b715f35e41585e9ef6bb873aaa2cc45a23 (diff) | |
| download | invidious-7112f3579378808a709b389ed4549baf74f679b1.tar.gz invidious-7112f3579378808a709b389ed4549baf74f679b1.tar.bz2 invidious-7112f3579378808a709b389ed4549baf74f679b1.zip | |
comments: don't error out when video has no comments
continuationItems is nil when video has no comments
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/comments.cr | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 65f4b135..ab9fcc8b 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -78,7 +78,8 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b when "RELOAD_CONTINUATION_SLOT_HEADER" header = item["reloadContinuationItemsCommand"]["continuationItems"][0] when "RELOAD_CONTINUATION_SLOT_BODY" - contents = item["reloadContinuationItemsCommand"]["continuationItems"] + # continuationItems is nil when video has no comments + contents = item["reloadContinuationItemsCommand"]["continuationItems"]? end elsif item["appendContinuationItemsAction"]? contents = item["appendContinuationItemsAction"]["continuationItems"] |
