diff --git a/package.json b/package.json index d75c5cd0..be6b1869 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "vue-router": "^3.5.2", "vuex": "^3.6.2", "youtube-suggest": "^1.1.2", - "yt-channel-info": "^2.2.0", + "yt-channel-info": "^3.0.1", "yt-dash-manifest-generator": "1.1.0", "yt-trending-scraper": "^2.0.1", "ytdl-core": "^4.10.1", diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index 84d5ca90..ef3f507c 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -1303,7 +1303,7 @@ export default Vue.extend({ getChannelInfoLocal: function (channelId) { return new Promise((resolve, reject) => { - ytch.getChannelInfo(channelId, 'latest').then(async (response) => { + ytch.getChannelInfo({ channelId: channelId }).then(async (response) => { resolve(response) }).catch((err) => { console.log(err) diff --git a/src/renderer/views/Channel/Channel.js b/src/renderer/views/Channel/Channel.js index 58131c7f..da284883 100644 --- a/src/renderer/views/Channel/Channel.js +++ b/src/renderer/views/Channel/Channel.js @@ -249,7 +249,7 @@ export default Vue.extend({ getChannelInfoLocal: function () { this.apiUsed = 'local' - ytch.getChannelInfo(this.id).then((response) => { + ytch.getChannelInfo({ channelId: this.id }).then((response) => { this.id = response.authorId this.channelName = response.author document.title = `${this.channelName} - ${process.env.PRODUCT_NAME}` @@ -258,16 +258,18 @@ export default Vue.extend({ } else { this.subCount = response.subscriberCount.toFixed(0) } + console.log(response) this.thumbnailUrl = response.authorThumbnails[2].url this.channelDescription = autolinker.link(response.description) this.relatedChannels = response.relatedChannels.items this.relatedChannels.forEach(relatedChannel => { - relatedChannel.authorThumbnails.map(thumbnail => { + relatedChannel.thumbnail.map(thumbnail => { if (!thumbnail.url.includes('https')) { thumbnail.url = `https:${thumbnail.url}` } return thumbnail }) + relatedChannel.authorThumbnails = relatedChannel.thumbnail }) if (response.authorBanners !== null) { @@ -306,7 +308,7 @@ export default Vue.extend({ getChannelVideosLocal: function () { this.isElementListLoading = true - ytch.getChannelVideos(this.id, this.videoSortBy).then((response) => { + ytch.getChannelVideos({ channelId: this.id, sortBy: this.videoSortBy }).then((response) => { this.latestVideos = response.items this.videoContinuationString = response.continuation this.isElementListLoading = false @@ -332,7 +334,7 @@ export default Vue.extend({ }, channelLocalNextPage: function () { - ytch.getChannelVideosMore(this.videoContinuationString).then((response) => { + ytch.getChannelVideosMore({ continuation: this.videoContinuationString }).then((response) => { this.latestVideos = this.latestVideos.concat(response.items) this.videoContinuationString = response.continuation }).catch((err) => { @@ -418,7 +420,7 @@ export default Vue.extend({ }, getPlaylistsLocal: function () { - ytch.getChannelPlaylistInfo(this.id, this.playlistSortBy).then((response) => { + ytch.getChannelPlaylistInfo({ channelId: this.id, sortBy: this.playlistSortBy }).then((response) => { console.log(response) this.latestPlaylists = response.items.map((item) => { item.proxyThumbnail = false @@ -448,7 +450,7 @@ export default Vue.extend({ }, getPlaylistsLocalMore: function () { - ytch.getChannelPlaylistsMore(this.playlistContinuationString).then((response) => { + ytch.getChannelPlaylistsMore({ continuation: this.playlistContinuationString }).then((response) => { console.log(response) this.latestPlaylists = this.latestPlaylists.concat(response.items) this.playlistContinuationString = response.continuation @@ -638,7 +640,7 @@ export default Vue.extend({ searchChannelLocal: function () { if (this.searchContinuationString === '') { - ytch.searchChannel(this.id, this.lastSearchQuery).then((response) => { + ytch.searchChannel({ channelId: this.id, query: this.lastSearchQuery }).then((response) => { console.log(response) this.searchResults = response.items this.isElementListLoading = false @@ -663,7 +665,7 @@ export default Vue.extend({ } }) } else { - ytch.searchChannelMore(this.searchContinuationString).then((response) => { + ytch.searchChannelMore({ continuation: this.searchContinuationString }).then((response) => { console.log(response) this.searchResults = this.searchResults.concat(response.items) this.isElementListLoading = false diff --git a/src/renderer/views/Channel/Channel.vue b/src/renderer/views/Channel/Channel.vue index b2ef0a3d..8e58c564 100644 --- a/src/renderer/views/Channel/Channel.vue +++ b/src/renderer/views/Channel/Channel.vue @@ -138,7 +138,7 @@ { - ytch.getChannelVideos(channel.id, 'latest').then(async (response) => { + ytch.getChannelVideos({ channelId: channel.id, sortBy: 'latest' }).then(async (response) => { const videos = await Promise.all(response.items.map(async (video) => { if (video.liveNow) { video.publishedDate = new Date().getTime() diff --git a/yarn.lock b/yarn.lock index 3a6417c4..b890631a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9050,10 +9050,10 @@ youtube-suggest@^1.1.2: node-fetch "^2.6.0" smol-jsonp "^1.0.0" -yt-channel-info@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/yt-channel-info/-/yt-channel-info-2.2.0.tgz#3e5d608916fcef79e473e16a779c23ea0ac41d71" - integrity sha512-P8WWBKQxIEZ23UmKzfHpCI4zgIBGpmthsT+oDPDfNYH0VweWHgHMsLphopMJe2y+FElz/b/N1yo5v4vwrteGRQ== +yt-channel-info@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/yt-channel-info/-/yt-channel-info-3.0.1.tgz#cb6651111a59018379110fe4846dd8ba2260b76c" + integrity sha512-iaW+/PcYpodVmwkVgsL7aKrAn7V2TqBS7AD48y7Y2xTjOphytuXhINjpU87IPMoANwJAxbF4sDk8Xz921l5wxg== dependencies: axios "^0.21.1" querystring "^0.2.0"