Merge pull request #598 from GilgusMaximus/development

Fix for infinite comment repeat
This commit is contained in:
Luca Hohmann 2020-10-05 20:40:48 +02:00 committed by GitHub
commit c81629b05d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 4 deletions

6
package-lock.json generated
View File

@ -20706,9 +20706,9 @@
} }
}, },
"yt-comment-scraper": { "yt-comment-scraper": {
"version": "1.3.2", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/yt-comment-scraper/-/yt-comment-scraper-1.3.2.tgz", "resolved": "https://registry.npmjs.org/yt-comment-scraper/-/yt-comment-scraper-1.3.3.tgz",
"integrity": "sha512-i2e+7ZNm5Dvdwsk3W8UyKtxR2xjtcMfUVGUjxVAR31HlEb8wE66XslDr5eIxSCpbhCLV7ItbmvL8NGL3D1TSxw==", "integrity": "sha512-t0mIJOxsXriJTVIzQpRYz7BcAo2SbhhgY8YR2HJjxEq5zBYsu6mVujs8xzrCo1431hri1mDTanvLluS/WWCgjg==",
"requires": { "requires": {
"axios": "^0.19.2", "axios": "^0.19.2",
"html2json": "^1.0.2" "html2json": "^1.0.2"

View File

@ -42,7 +42,7 @@
"youtube-chat": "^1.1.0", "youtube-chat": "^1.1.0",
"youtube-suggest": "^1.1.0", "youtube-suggest": "^1.1.0",
"yt-channel-info": "^1.1.2", "yt-channel-info": "^1.1.2",
"yt-comment-scraper": "^1.3.2", "yt-comment-scraper": "^1.3.3",
"yt-dash-manifest-generator": "^1.1.0", "yt-dash-manifest-generator": "^1.1.0",
"yt-trending-scraper": "^1.0.3", "yt-trending-scraper": "^1.0.3",
"yt-xml2vtt": "^1.1.2", "yt-xml2vtt": "^1.1.2",

View File

@ -4,6 +4,7 @@ import FtCard from '../ft-card/ft-card.vue'
import FtLoader from '../../components/ft-loader/ft-loader.vue' import FtLoader from '../../components/ft-loader/ft-loader.vue'
import FtSelect from '../../components/ft-select/ft-select.vue' import FtSelect from '../../components/ft-select/ft-select.vue'
import FtTimestampCatcher from '../../components/ft-timestamp-catcher/ft-timestamp-catcher.vue' import FtTimestampCatcher from '../../components/ft-timestamp-catcher/ft-timestamp-catcher.vue'
import CommentScraper from 'yt-comment-scraper' import CommentScraper from 'yt-comment-scraper'
export default Vue.extend({ export default Vue.extend({
@ -115,6 +116,16 @@ export default Vue.extend({
this.commentData = [] this.commentData = []
} }
this.commentScraper.scrape_next_page_youtube_comments(this.id).then((response) => { this.commentScraper.scrape_next_page_youtube_comments(this.id).then((response) => {
if (response === null) {
this.showToast({
message: this.$t('No more comments available'),
time: 7000,
action: () => {
}
})
this.isLoading = false
return
}
console.log(response) console.log(response)
const commentData = response.map((comment) => { const commentData = response.map((comment) => {
comment.showReplies = false comment.showReplies = false

View File

@ -494,6 +494,7 @@ Comments:
There are no comments available for this video: There are no comments available There are no comments available for this video: There are no comments available
for this video for this video
Load More Comments: Load More Comments Load More Comments: Load More Comments
No more comments available: No more comments available
Up Next: Up Next Up Next: Up Next
# Toast Messages # Toast Messages