diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index d796d3ae..7f697f11 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -2,6 +2,7 @@ "enabled": "Enabled", "disabled": "Disabled", "premium": "Premium YouTube content can't be watched on Materialious.", + "isUpcoming": "Video is not in a watchable state yet.", "copyUrl": "Copy URL", "loadMore": "Load more", "views": "views", diff --git a/materialious/src/lib/patches/youtubejs.ts b/materialious/src/lib/patches/youtubejs.ts index 882a785e..135b6824 100644 --- a/materialious/src/lib/patches/youtubejs.ts +++ b/materialious/src/lib/patches/youtubejs.ts @@ -172,8 +172,6 @@ export async function patchYoutubeJs(videoId: string): Promise { }); } - console.log(video); - return { type: 'video', title: video.primary_info.title?.toString() || '', diff --git a/materialious/src/lib/watch.ts b/materialious/src/lib/watch.ts index 38299bee..1f4803db 100644 --- a/materialious/src/lib/watch.ts +++ b/materialious/src/lib/watch.ts @@ -28,6 +28,12 @@ export async function getWatchDetails(videoId: string, url: URL) { if (video.premium) { error(400, get(_)('premium')); + return; + } + + if (video.isUpcoming) { + error(400, get(_)('isUpcoming')); + return; } let personalPlaylists;