Fix Goojara Scraping and Capitilization

This commit is contained in:
memecornucopia 2024-02-01 12:19:28 -05:00
parent 28b15e5a36
commit ccb029db1d
2 changed files with 5 additions and 18 deletions

View File

@ -20,8 +20,8 @@ async function universalScraper(ctx: ShowScrapeContext | MovieScrapeContext): Pr
}
export const goojaraScraper = makeSourcerer({
id: 'goojara',
name: 'goojara',
id: 'Goojara',
name: 'Goojara',
rank: 225,
flags: [],
scrapeShow: universalScraper,

View File

@ -49,7 +49,6 @@ export async function searchAndFindMedia(
});
const result = results.find((res: Result) => compareMedia(media, res.title, Number(res.year)));
return result;
}
@ -67,29 +66,17 @@ export async function scrapeIds(
baseUrl,
headers: headersData,
method: 'GET',
});
const $1 = load(data);
const dataId = $1('#seon').attr('data-id');
if (!dataId) throw new NotFoundError('Not found');
data = await ctx.fetcher<string>(`/xhrc.php`, {
baseUrl,
headers: headersData,
method: 'POST',
body: new URLSearchParams({ s: media.season.number.toString(), t: dataId }),
query: { s: media.season.number.toString() },
});
let episodeId = '';
const $2 = load(data);
$2('.seho').each((index, element) => {
$2('.seho').each((_index: any, element: any) => {
// Extracting the episode number as a string
const episodeNumber = $2(element).find('.seep .sea').text().trim();
console.log(episodeNumber);
// Comparing with the desired episode number as a string
if (parseInt(episodeNumber, 10) === media.episode.number) {
const href = $2(element).find('.snfo h1 a').attr('href');