initial netflix service

This commit is contained in:
stratuma 2024-05-15 18:51:59 +02:00
parent d97233056f
commit f9be77b0aa
3 changed files with 24 additions and 0 deletions

View File

View File

@ -0,0 +1,24 @@
export async function getNetflixBuildID() {
try {
const response = await fetch(`https://www.netflix.com/buildIdentifier`, {
method: 'GET',
})
if (response.ok) {
const raw = await response.text();
const parsed: {
BUILD_IDENTIFIER: string,
isProdVersion: boolean
} = await JSON.parse(raw);
return parsed
} else {
throw new Error(await response.text())
}
} catch (e) {
console.log('Getting Netflix Build ID failed')
throw new Error(e as string)
}
}