Merge pull request #904 from Materialious/update/1.8.4

Remove po token cache
This commit is contained in:
Ward
2025-05-06 01:38:15 +12:00
committed by GitHub
5 changed files with 22 additions and 22 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 107
versionName "1.8.3"
versionCode 108
versionName "1.8.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
@@ -66,8 +66,10 @@
<release version="1.8.4" date="2025-5-05">
<url>https://github.com/Materialious/Materialious/releases/tag/1.8.4</url>
</release>
<release version="1.8.3" date="2025-5-05">
<url>https://github.com/Materialious/Materialious/releases/tag/1.8.3</url>
</release>
@@ -123,4 +125,4 @@
<url>https://github.com/Materialious/Materialious/releases/tag/1.6.18</url>
</release>
</releases>
</component>
</component>
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "Materialious",
"version": "1.8.3",
"version": "1.8.4",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
@@ -44,4 +44,4 @@
"capacitor",
"electron"
]
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "materialious",
"version": "1.8.3",
"version": "1.8.4",
"private": true,
"scripts": {
"dev": "vite dev",
@@ -71,4 +71,4 @@
"terser": "^5.34.1",
"youtubei.js": "^13.4.0"
}
}
}
+11 -13
View File
@@ -29,23 +29,21 @@ export async function patchYoutubeJs(videoId: string): Promise<VideoPlay> {
enable_session_cache: false
});
if (!get(poTokenCacheStore)) {
const visitorData = youtube.session.context.client.visitorData ?? '';
const visitorData = youtube.session.context.client.visitorData ?? '';
const requestKey = 'O43z0dpjhgX20SCx4KAo';
const challengeResponse = await youtube.getAttestationChallenge('ENGAGEMENT_TYPE_UNBOUND');
const requestKey = 'O43z0dpjhgX20SCx4KAo';
const challengeResponse = await youtube.getAttestationChallenge('ENGAGEMENT_TYPE_UNBOUND');
if (!challengeResponse.bg_challenge) throw new Error('Could not get challenge');
if (!challengeResponse.bg_challenge) throw new Error('Could not get challenge');
const platformMinter =
Capacitor.getPlatform() === 'android'
? androidPoTokenMinter
: window.electronAPI.generatePoToken;
const platformMinter =
Capacitor.getPlatform() === 'android'
? androidPoTokenMinter
: window.electronAPI.generatePoToken;
poTokenCacheStore.set(
await platformMinter(challengeResponse.bg_challenge, requestKey, visitorData)
);
}
poTokenCacheStore.set(
await platformMinter(challengeResponse.bg_challenge, requestKey, visitorData)
);
const extraArgs: Record<string, any> = {
playbackContext: {