update yt-channel-info (#2126)
* update yt-channel-info * update to 3.0.1 * Update yarn.lock
This commit is contained in:
parent
40ac959684
commit
927225d1f4
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
<ft-channel-bubble
|
||||
v-for="(channel, index) in relatedChannels"
|
||||
:key="index"
|
||||
:channel-name="channel.author"
|
||||
:channel-name="channel.author || channel.channelName"
|
||||
:channel-id="channel.authorId"
|
||||
:channel-thumbnail="channel.authorThumbnails[channel.authorThumbnails.length - 1].url"
|
||||
@click="goToChannel(channel.authorId)"
|
||||
|
|
|
@ -225,7 +225,7 @@ export default Vue.extend({
|
|||
|
||||
getChannelVideosLocalScraper: function (channel, failedAttempts = 0) {
|
||||
return new Promise((resolve, reject) => {
|
||||
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()
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue