Skip to content

Commit 9d9cc71

Browse files
dependabot[bot]PikachuEXEabsidue
authored andcommitted
Bump youtubei.js from 13.1.0 to 13.3.0 (#7077)
* Bump youtubei.js from 13.1.0 to 13.3.0 Bumps [youtubei.js](https://github.com/LuanRT/YouTube.js) from 13.1.0 to 13.3.0. - [Release notes](https://github.com/LuanRT/YouTube.js/releases) - [Changelog](https://github.com/LuanRT/YouTube.js/blob/main/CHANGELOG.md) - [Commits](LuanRT/YouTube.js@v13.1.0...v13.3.0) --- updated-dependencies: - dependency-name: youtubei.js dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * ! Fix video data parsing without view count * Fix compatibility issues --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: PikachuEXE <git@pikachuexe.net> Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
1 parent 2b2e75c commit 9d9cc71

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"vue-observe-visibility": "^1.0.0",
7575
"vue-router": "^3.6.5",
7676
"vuex": "^3.6.2",
77-
"youtubei.js": "^13.1.0"
77+
"youtubei.js": "^13.3.0"
7878
},
7979
"devDependencies": {
8080
"@babel/core": "^7.26.7",

src/renderer/helpers/api/local.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ export async function getLocalTrending(location, tab, instance) {
153153
results = []
154154

155155
resultsInstance.videos.forEach(video => {
156-
if (video.type === 'Video' && !alreadySeenIds.includes(video.id)) {
157-
alreadySeenIds.push(video.id)
156+
if (video.type === 'Video' && !alreadySeenIds.includes(video.video_id)) {
157+
alreadySeenIds.push(video.video_id)
158158
results.push(parseLocalListVideo(video))
159159
}
160160
})
@@ -1108,7 +1108,7 @@ export function parseLocalListVideo(item) {
11081108

11091109
return {
11101110
type: 'video',
1111-
videoId: video.id,
1111+
videoId: video.video_id,
11121112
title: video.title.text,
11131113
author: video.author?.name,
11141114
authorId: video.author?.id,
@@ -1148,14 +1148,22 @@ export function parseLocalListVideo(item) {
11481148
video.upcoming
11491149
)
11501150

1151+
let viewCount = null
1152+
1153+
if (video.view_count?.text) {
1154+
viewCount = video.view_count.text.toLowerCase() === 'no views' ? 0 : extractNumberFromString(video.view_count.text)
1155+
} else if (video.short_view_count?.text) {
1156+
viewCount = video.short_view_count.text.toLowerCase() === 'no views' ? 0 : parseLocalSubscriberCount(video.short_view_count.text)
1157+
}
1158+
11511159
return {
11521160
type: 'video',
1153-
videoId: video.id,
1161+
videoId: video.video_id,
11541162
title: video.title.text,
11551163
author: video.author.name,
11561164
authorId: video.author.id,
11571165
description: video.description,
1158-
viewCount: video.view_count?.text == null ? (video.short_view_count.text == null ? null : parseLocalSubscriberCount(video.short_view_count.text)) : extractNumberFromString(video.view_count.text),
1166+
viewCount,
11591167
published,
11601168
lengthSeconds: isNaN(video.duration.seconds) ? '' : video.duration.seconds,
11611169
liveNow: video.is_live,
@@ -1342,7 +1350,7 @@ export function parseLocalWatchNextVideo(video) {
13421350

13431351
return {
13441352
type: 'video',
1345-
videoId: video.id,
1353+
videoId: video.video_id,
13461354
title: video.title.text,
13471355
author: video.author.name,
13481356
authorId: video.author.id,

yarn.lock

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5949,10 +5949,10 @@ jest-worker@^29.7.0:
59495949
merge-stream "^2.0.0"
59505950
supports-color "^8.0.0"
59515951

5952-
jintr@^3.2.1:
5953-
version "3.2.1"
5954-
resolved "https://registry.yarnpkg.com/jintr/-/jintr-3.2.1.tgz#ea6719485c9ff5f14ca7f9131990040d4fdfe1be"
5955-
integrity sha512-yjKUBuwTTg4nc4izMysxuIk0BKh45hnbc1KnXE6LxagIGZn5od+I2elpuRY9IIm3EiKiUZxhxV89a0iX+xoEZg==
5952+
jintr@^3.3.0:
5953+
version "3.3.0"
5954+
resolved "https://registry.yarnpkg.com/jintr/-/jintr-3.3.0.tgz#74271197c260b9b2e435d961339263c515df603d"
5955+
integrity sha512-ZsaajJ4Hr5XR0tSPhOZOTjFhxA0qscKNSOs41NRjx7ZOGwpfdp8NKIBEUtvUPbA37JXyv1sJlgeOOZHjr3h76Q==
59565956
dependencies:
59575957
acorn "^8.8.0"
59585958

@@ -9717,17 +9717,12 @@ yocto-queue@^0.1.0:
97179717
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
97189718
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
97199719

9720-
yocto-queue@^1.0.0:
9721-
version "1.0.0"
9722-
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
9723-
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==
9724-
9725-
youtubei.js@^13.1.0:
9726-
version "13.1.0"
9727-
resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-13.1.0.tgz#1e15da01e58c782ab6fb7cc9191a1c99f821c57f"
9728-
integrity sha512-uL4TyojAYET0c5NGFD7+ScCod/k8Pc/B+D5tLrunFcz1GaBjRMOGRPcNGaRmnhwisegU7ibtw0iUxCN+BZ0ang==
9720+
youtubei.js@^13.3.0:
9721+
version "13.3.0"
9722+
resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-13.3.0.tgz#31cca5fa295a146409b4858aca3283d8c8926c7a"
9723+
integrity sha512-tbl7rxltpgKoSsmfGUe9JqWUAzv6HFLqrOn0N85EbTn5DLt24EXrjClnXdxyr3PBARMJ3LC4vbll100a0ABsYw==
97299724
dependencies:
97309725
"@bufbuild/protobuf" "^2.0.0"
9731-
jintr "^3.2.1"
9726+
jintr "^3.3.0"
97329727
tslib "^2.5.0"
97339728
undici "^5.19.1"

0 commit comments

Comments
 (0)