Release v0.4: Add PornHub support / Server-side streaming / Plyr.js / Video srcset #96

Merged
lamacchinadesiderante merged 18 commits from feature/pornhub-support into develop 2024-05-25 11:46:42 +00:00
1 changed files with 11 additions and 1 deletions
Showing only changes of commit 7b1d712904 - Show all commits

View File

@ -28,6 +28,16 @@ export async function GET(req: Request, { params }: GetParams) {
responseType: "stream",
});
return new Response(response.data);
const headers = new Headers();
headers.set('Content-Type', 'video/mp4');
headers.set('Cache-Control', 'no-cache');
headers.set('Accept-Ranges', 'bytes');
headers.set('Content-Length', response.headers['content-length']);
headers.set('Content-Disposition', 'inline');
return new Response(response.data, {
headers,
});
}