mirror of
https://github.com/sussy-code/providers.git
synced 2026-04-21 00:22:07 +00:00
hardset cookie
This commit is contained in:
parent
d5194d21e8
commit
f0bfccaa6f
1 changed files with 13 additions and 7 deletions
|
|
@ -10,14 +10,20 @@ export async function login(
|
||||||
pass: string,
|
pass: string,
|
||||||
ctx: ShowScrapeContext | MovieScrapeContext,
|
ctx: ShowScrapeContext | MovieScrapeContext,
|
||||||
): Promise<string | null> {
|
): Promise<string | null> {
|
||||||
const req = await ctx.proxiedFetcher.full<string>('/login', {
|
let req;
|
||||||
baseUrl,
|
if (user && pass)
|
||||||
method: 'POST',
|
req = await ctx.proxiedFetcher.full<string>('/login', {
|
||||||
body: new URLSearchParams({ user, pass, action: 'login' }),
|
baseUrl,
|
||||||
readHeaders: ['Set-Cookie'],
|
method: 'POST',
|
||||||
});
|
body: new URLSearchParams({ user, pass, action: 'login' }),
|
||||||
|
readHeaders: ['Set-Cookie'],
|
||||||
|
});
|
||||||
|
|
||||||
const cookies = parseSetCookie(req.headers.get('Set-Cookie') || '');
|
const cookies = parseSetCookie(
|
||||||
|
req?.headers.get('Set-Cookie') ||
|
||||||
|
// we don't wan't our creds to be in the code
|
||||||
|
'PHPSESSID=phmje3cqeft42rckf8mj7illhc;',
|
||||||
|
);
|
||||||
|
|
||||||
return cookies.PHPSESSID.value;
|
return cookies.PHPSESSID.value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue