diff --git a/package.json b/package.json index 27908e5c9..a30c92781 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "vue-router": "^3.6.5", "vue-tiny-slider": "^0.1.39", "vuex": "^3.6.2", - "youtubei.js": "^5.1.0" + "youtubei.js": "^5.2.0" }, "devDependencies": { "@babel/core": "^7.22.5", diff --git a/src/renderer/components/playlist-info/playlist-info.js b/src/renderer/components/playlist-info/playlist-info.js index 907417ba5..9a2fe326e 100644 --- a/src/renderer/components/playlist-info/playlist-info.js +++ b/src/renderer/components/playlist-info/playlist-info.js @@ -17,6 +17,7 @@ export default defineComponent({ return { id: '', firstVideoId: '', + playlistThumbnail: '', title: '', channelThumbnail: '', channelName: '', @@ -54,7 +55,7 @@ export default defineComponent({ if (this.backendPreference === 'invidious') { baseUrl = this.currentInvidiousInstance } else { - baseUrl = 'https://i.ytimg.com' + return this.data.playlistThumbnail } switch (this.thumbnailPreference) { diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index 552dece38..1de58c46d 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -353,6 +353,8 @@ function parseShortDuration(accessibilityLabel, videoId) { export function parseLocalListPlaylist(playlist, author = undefined) { let channelName let channelId = null + /** @type {import('youtubei.js').YTNodes.PlaylistVideoThumbnail} */ + const thumbnailRenderer = playlist.thumbnail_renderer if (playlist.author) { if (playlist.author instanceof Misc.Text) { @@ -374,7 +376,7 @@ export function parseLocalListPlaylist(playlist, author = undefined) { type: 'playlist', dataSource: 'local', title: playlist.title.text, - thumbnail: playlist.thumbnails[0].url, + thumbnail: thumbnailRenderer ? thumbnailRenderer.thumbnail[0].url : playlist.thumbnails[0].url, channelName, channelId, playlistId: playlist.id, diff --git a/src/renderer/views/Playlist/Playlist.js b/src/renderer/views/Playlist/Playlist.js index 8551c4f27..09bdc58b9 100644 --- a/src/renderer/views/Playlist/Playlist.js +++ b/src/renderer/views/Playlist/Playlist.js @@ -88,6 +88,7 @@ export default defineComponent({ title: result.info.title, description: result.info.description ?? '', firstVideoId: result.items[0].id, + playlistThumbnail: result.info.thumbnails[0].url, viewCount: extractNumberFromString(result.info.views), videoCount: extractNumberFromString(result.info.total_items), lastUpdated: result.info.last_updated ?? '', diff --git a/yarn.lock b/yarn.lock index d0fc5dc5f..fc23d15f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8585,10 +8585,10 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -youtubei.js@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-5.1.0.tgz#a71474f23fbf8679c1f517f3f8a33064e898683e" - integrity sha512-Rbe71rqqSVGj2kBv7FeIDbod+AEcd84F/7inSLWjt6jv8tmTGLjXr8cjlqzY5WhpNKMJuSUVKLFgCb3V0SHTUA== +youtubei.js@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-5.2.0.tgz#97e66de34072c40e04e7cf5172c0cf3a1eeccbf7" + integrity sha512-UXbkHnLp+YUSbA6ye58knH11RRx52BWpO/k6wSKQTm6eC/MSUBQO4KdYrO1INptlbOWWn7DjW5LwLMZ6e4qdMw== dependencies: jintr "^1.0.0" linkedom "^0.14.12"