diff --git a/src/pages/watch.astro b/src/pages/watch.astro index fc27fa3..f521fdf 100644 --- a/src/pages/watch.astro +++ b/src/pages/watch.astro @@ -16,17 +16,502 @@ Astro.cookies.set("InlinePlayerId", SWV, { path: "/", sameSite: "strict", }); + +// Quality Check +const EightKCheck = await fetch('https://' + DEFAULT_INVIDIOUS_INSTANCE + '/latest_version?id=' + video.videoId + '&itag=571') +if (EightKCheck.status == 200) { + var EightK = true +} else { + var EightK = false +} + +const FourKCheck = await fetch('https://' + DEFAULT_INVIDIOUS_INSTANCE + '/latest_version?id=' + video.videoId + '&itag=313') +if (FourKCheck.status == 200) { + var FourK = true +} else { + var FourK = false +} + +const TenEightyCheck = await fetch('https://' + DEFAULT_INVIDIOUS_INSTANCE + '/latest_version?id=' + video.videoId + '&itag=137') +if (TenEightyCheck.status == 200) { + var TenEighty = true +} else { + var TenEighty = false +} + +const ThreeSixtyCheck = await fetch('https://' + DEFAULT_INVIDIOUS_INSTANCE + '/latest_version?id=' + video.videoId + '&itag=134') +if (ThreeSixtyCheck.status == 200) {var ThreeSixty = true} + +if (EightK === true) { // 571 + var Quality = '571' +} else if (FourK === true) { // 313 + var Quality = '313' +} else if (TenEighty === true) { // 137 + var Quality = '137' +} else if (ThreeSixty === true) { // 134 + var Quality = '134' +} --- -