mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +00:00
delete unused files for ee3
This commit is contained in:
parent
2a77f87760
commit
35199c5b8e
2 changed files with 0 additions and 77 deletions
|
|
@ -1,31 +0,0 @@
|
|||
export interface itemDetails {
|
||||
status: number;
|
||||
message: {
|
||||
id: string;
|
||||
imdbID: string;
|
||||
title: string;
|
||||
video: string;
|
||||
server: string;
|
||||
year: string;
|
||||
image: string;
|
||||
glow: string;
|
||||
rating: string;
|
||||
watch_count: string;
|
||||
datetime?: string | null;
|
||||
requested_by?: string | null;
|
||||
subs?: string | null;
|
||||
time?: string | null;
|
||||
duration?: string | null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface renewResponse {
|
||||
k: string;
|
||||
msg?: string | null;
|
||||
status: number | string | null;
|
||||
}
|
||||
|
||||
export interface loginResponse {
|
||||
status: number;
|
||||
message: string;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
import { load } from 'cheerio';
|
||||
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { parseSetCookie } from '@/utils/cookie';
|
||||
|
||||
import { baseUrl } from './common';
|
||||
import { loginResponse } from './types';
|
||||
|
||||
export async function login(
|
||||
user: string,
|
||||
pass: string,
|
||||
ctx: ShowScrapeContext | MovieScrapeContext,
|
||||
): Promise<string | null> {
|
||||
const req = await ctx.proxiedFetcher.full<string>('/login', {
|
||||
baseUrl,
|
||||
method: 'POST',
|
||||
body: new URLSearchParams({ user, pass, action: 'login' }),
|
||||
readHeaders: ['Set-Cookie'],
|
||||
});
|
||||
const res: loginResponse = JSON.parse(req.body);
|
||||
|
||||
const cookie = parseSetCookie(
|
||||
// It retruns a cookie even when the login failed
|
||||
// I have the backup cookie here just in case
|
||||
res.status === 1 ? (req.headers.get('Set-Cookie') ?? '') : 'PHPSESSID=mk2p73c77qc28o5i5120843ruu;',
|
||||
);
|
||||
|
||||
return cookie.PHPSESSID.value;
|
||||
}
|
||||
|
||||
export function parseSearch(body: string): { title: string; year: number; id: string }[] {
|
||||
const result: { title: string; year: number; id: string }[] = [];
|
||||
|
||||
const $ = load(body);
|
||||
$('div').each((_, element) => {
|
||||
const title = $(element).find('.title').text().trim();
|
||||
const year = parseInt($(element).find('.details span').first().text().trim(), 10);
|
||||
const id = $(element).find('.control-buttons').attr('data-id');
|
||||
|
||||
if (title && year && id) {
|
||||
result.push({ title, year, id });
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
Loading…
Reference in a new issue