diff --git a/package-lock.json b/package-lock.json index 1b7f6e5..91bd73c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "yt-comment-scraper", - "version": "4.0.1", + "version": "4.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/Youtube-Scraper.js b/src/Youtube-Scraper.js index 44c1f21..d33931c 100644 --- a/src/Youtube-Scraper.js +++ b/src/Youtube-Scraper.js @@ -34,7 +34,7 @@ class CommentScraper { const commentPageResponse = await requester.requestCommentsPage(commentsPayload) const commentHtml = commentPageResponse.data.response.continuationContents.itemSectionContinuation - const commentData = htmlParser.parseCommentData(commentHtml.contents) + const commentData = (typeof commentHtml.contents !== 'undefined') ? htmlParser.parseCommentData(commentHtml.contents) : [] const continuation = commentHtml.continuations let ctoken = null