Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot]
e24060c31d chore(main): release 15.1.1 (#1033)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-13 15:02:21 -03:00
absidue
a2c3774e9a fix(Player): Store the full library version in cache entries (#1032) 2025-09-12 16:10:19 -03:00
4 changed files with 13 additions and 9 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## [15.1.1](https://github.com/LuanRT/YouTube.js/compare/v15.1.0...v15.1.1) (2025-09-12)
### Bug Fixes
* **Player:** Store the full library version in cache entries ([#1032](https://github.com/LuanRT/YouTube.js/issues/1032)) ([a2c3774](https://github.com/LuanRT/YouTube.js/commit/a2c3774e9a0212d7aab7af2baee1f48ad3319a08))
## [15.1.0](https://github.com/LuanRT/YouTube.js/compare/v15.0.1...v15.1.0) (2025-09-11)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "youtubei.js",
"version": "15.1.0",
"version": "15.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "youtubei.js",
"version": "15.1.0",
"version": "15.1.1",
"funding": [
"https://github.com/sponsors/LuanRT"
],

View File

@@ -1,6 +1,6 @@
{
"name": "youtubei.js",
"version": "15.1.0",
"version": "15.1.1",
"description": "A JavaScript client for YouTube's private API, known as InnerTube.",
"type": "module",
"types": "./dist/src/platform/lib.d.ts",

View File

@@ -19,7 +19,7 @@ interface SerializablePlayer {
sts: number;
sig_sc?: string;
nsig_sc?: string;
library_version: number;
library_version: string;
}
/**
@@ -200,10 +200,9 @@ export default class Player {
return null;
try {
const current_library_version = parseInt(packageInfo.version.split('.', 1)[0]);
const player_data = BinarySerializer.deserialize<SerializablePlayer>(new Uint8Array(buffer));
if (player_data.library_version !== current_library_version) {
if (player_data.library_version !== packageInfo.version) {
Log.warn(TAG, `Cached player data is from a different library version (${player_data.library_version}). Ignoring it.`);
return null;
}
@@ -225,14 +224,12 @@ export default class Player {
if (!cache || !this.sig_sc || !this.nsig_sc)
return;
const current_library_version = parseInt(packageInfo.version.split('.', 1)[0]);
const buffer = BinarySerializer.serialize({
player_id: this.player_id,
sts: this.sts,
sig_sc: this.sig_sc,
nsig_sc: this.nsig_sc,
library_version: current_library_version
library_version: packageInfo.version
});
await cache.set(this.player_id, buffer);