diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 662adcc5..883de2fc 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 166 - versionName "1.11.6" + versionCode 167 + versionName "1.11.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml index 35b40313..420ed66b 100644 --- a/materialious/electron/materialious.metainfo.xml +++ b/materialious/electron/materialious.metainfo.xml @@ -76,7 +76,11 @@ - + + + https://github.com/Materialious/Materialious/releases/tag/1.11.7 + + https://github.com/Materialious/Materialious/releases/tag/1.11.6 diff --git a/materialious/electron/package.json b/materialious/electron/package.json index c6142952..1dc8fdf7 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.11.6", + "version": "1.11.7", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/package.json b/materialious/package.json index cac86305..1bd12663 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.11.6", + "version": "1.11.7", "private": true, "scripts": { "dev": "vite dev", diff --git a/materialious/src/lib/patches/youtubejs.ts b/materialious/src/lib/patches/youtubejs.ts index 9d1e94a2..c0351ef5 100644 --- a/materialious/src/lib/patches/youtubejs.ts +++ b/materialious/src/lib/patches/youtubejs.ts @@ -10,9 +10,9 @@ import type { } from '$lib/api/model'; import { interfaceRegionStore, poTokenCacheStore } from '$lib/store'; import { Capacitor } from '@capacitor/core'; -import BG, { USER_AGENT } from 'bgutils-js'; +import { USER_AGENT } from 'bgutils-js'; import { get } from 'svelte/store'; -import type { Types } from 'youtubei.js'; +import type { Types, Misc } from 'youtubei.js'; import { Innertube, UniversalCache, Utils, YT, YTNodes, Platform } from 'youtubei.js'; Platform.shim.eval = async ( @@ -85,6 +85,29 @@ export async function patchYoutubeJs(videoId: string): Promise { let dashUri: string | undefined; + // Unsupported format fix + // https://github.com/LuanRT/googlevideo/issues/42 + if (video.streaming_data) + video.streaming_data.adaptive_formats = video.streaming_data.adaptive_formats.filter( + (format) => format.xtags !== 'CgcKAnZiEgEx' + ); + + const adaptiveFormats: AdaptiveFormats[] = []; + video.streaming_data?.adaptive_formats.forEach((format) => { + adaptiveFormats.push({ + index: format.index_range?.start?.toString() || '', + bitrate: format.bitrate?.toString() || '', + init: format.init_range?.start?.toString() || '', + url: format.url || '', + itag: format.itag?.toString() || '', + type: format.mime_type, + clen: '', + lmt: '', + projectionType: 0, + resolution: format.width ? `${format.width}x${format.height}` : undefined + }); + }); + const isPostLiveDVR = !!video.basic_info.is_post_live_dvr || (video.basic_info.is_live_content && @@ -100,14 +123,13 @@ export async function patchYoutubeJs(videoId: string): Promise { ? video.streaming_data.hls_manifest_url // HLS is preferred for DVR streams. : `${video.streaming_data.dash_manifest_url}/mpd_version/7`; } else { - dashUri = `data:application/dash+xml;base64,${btoa( - await video.toDash({ - manifest_options: { - is_sabr: true, - include_thumbnails: false - } - }) - )}`; + const manifest = await video.toDash({ + manifest_options: { + is_sabr: true, + include_thumbnails: false + } + }); + dashUri = `data:application/dash+xml;base64,${btoa(manifest)}`; } } @@ -172,22 +194,6 @@ export async function patchYoutubeJs(videoId: string): Promise { }); }); - const adaptiveFormats: AdaptiveFormats[] = []; - video.streaming_data?.adaptive_formats.forEach((format) => { - adaptiveFormats.push({ - index: format.index_range?.start?.toString() || '', - bitrate: format.bitrate?.toString() || '', - init: format.init_range?.start?.toString() || '', - url: format.url || '', - itag: format.itag?.toString() || '', - type: format.mime_type, - clen: '', - lmt: '', - projectionType: 0, - resolution: format.width ? `${format.width}x${format.height}` : undefined - }); - }); - const storyboard: StoryBoard[] = []; if (video.storyboards && 'boards' in video.storyboards) { video.storyboards.boards.forEach((board) => { diff --git a/update_versions.py b/update_versions.py index 20a4d6b7..9c0b8524 100644 --- a/update_versions.py +++ b/update_versions.py @@ -3,7 +3,7 @@ import os import re from datetime import datetime -LATEST_VERSION = "1.11.6" +LATEST_VERSION = "1.11.7" RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")