mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:03:25 +00:00
Fix Goojara Scraping and Capitilization
This commit is contained in:
@@ -20,8 +20,8 @@ async function universalScraper(ctx: ShowScrapeContext | MovieScrapeContext): Pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const goojaraScraper = makeSourcerer({
|
export const goojaraScraper = makeSourcerer({
|
||||||
id: 'goojara',
|
id: 'Goojara',
|
||||||
name: 'goojara',
|
name: 'Goojara',
|
||||||
rank: 225,
|
rank: 225,
|
||||||
flags: [],
|
flags: [],
|
||||||
scrapeShow: universalScraper,
|
scrapeShow: universalScraper,
|
||||||
|
@@ -49,7 +49,6 @@ export async function searchAndFindMedia(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const result = results.find((res: Result) => compareMedia(media, res.title, Number(res.year)));
|
const result = results.find((res: Result) => compareMedia(media, res.title, Number(res.year)));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,29 +66,17 @@ export async function scrapeIds(
|
|||||||
baseUrl,
|
baseUrl,
|
||||||
headers: headersData,
|
headers: headersData,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
query: { s: media.season.number.toString() },
|
||||||
|
|
||||||
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 }),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let episodeId = '';
|
let episodeId = '';
|
||||||
|
|
||||||
const $2 = load(data);
|
const $2 = load(data);
|
||||||
|
|
||||||
$2('.seho').each((index, element) => {
|
$2('.seho').each((_index: any, element: any) => {
|
||||||
// Extracting the episode number as a string
|
// Extracting the episode number as a string
|
||||||
const episodeNumber = $2(element).find('.seep .sea').text().trim();
|
const episodeNumber = $2(element).find('.seep .sea').text().trim();
|
||||||
|
console.log(episodeNumber);
|
||||||
// Comparing with the desired episode number as a string
|
// Comparing with the desired episode number as a string
|
||||||
if (parseInt(episodeNumber, 10) === media.episode.number) {
|
if (parseInt(episodeNumber, 10) === media.episode.number) {
|
||||||
const href = $2(element).find('.snfo h1 a').attr('href');
|
const href = $2(element).find('.snfo h1 a').attr('href');
|
||||||
|
Reference in New Issue
Block a user