change rank and add comments

This commit is contained in:
TPN
2024-04-15 19:25:05 +05:30
parent 423c07cc56
commit c8b2ea3e81
2 changed files with 6 additions and 2 deletions

View File

@@ -9,9 +9,11 @@ export function parseSearch(page: string): { title: string; year?: number; url:
$('.items .poster').each((_, element) => { $('.items .poster').each((_, element) => {
const $link = $(element).find('a'); const $link = $(element).find('a');
const url = $link.attr('href'); const url = $link.attr('href');
// ex title: Home Alone (1990)
const [, title, year] = $link.attr('title')?.match(/^(.*?)\s*(?:\((\d{4})\))?\s*$/) || []; const [, title, year] = $link.attr('title')?.match(/^(.*?)\s*(?:\((\d{4})\))?\s*$/) || [];
if (!title || !url) return; if (!title || !url) return;
// tiles dont always have the year
results.push({ title, year: year ? parseInt(year, 10) : undefined, url }); results.push({ title, year: year ? parseInt(year, 10) : undefined, url });
}); });

View File

@@ -10,7 +10,7 @@ import { baseUrl, parseSearch } from './common';
export const tugaflixScraper = makeSourcerer({ export const tugaflixScraper = makeSourcerer({
id: 'tugaflix', id: 'tugaflix',
name: 'Tugaflix', name: 'Tugaflix',
rank: 112, rank: 73,
flags: [flags.IP_LOCKED], flags: [flags.IP_LOCKED],
scrapeMovie: async (ctx) => { scrapeMovie: async (ctx) => {
const searchResults = parseSearch( const searchResults = parseSearch(
@@ -50,6 +50,8 @@ export const tugaflixScraper = makeSourcerer({
embedId: 'streamtape', embedId: 'streamtape',
url: finalUrl, url: finalUrl,
}); });
// found doodstream on a few shows, maybe movies use it too?
// the player 2 is just streamtape in a custom player
} else if (finalUrl.includes('dood')) { } else if (finalUrl.includes('dood')) {
embeds.push({ embeds.push({
embedId: 'dood', embedId: 'dood',
@@ -84,7 +86,7 @@ export const tugaflixScraper = makeSourcerer({
}); });
const embedUrl = load(videoPage)('iframe[name="player"]').attr('src'); const embedUrl = load(videoPage)('iframe[name="player"]').attr('src');
if (!embedUrl) throw new Error('Failed to find taprUrl'); if (!embedUrl) throw new Error('Failed to find iframe');
const playerPage = await ctx.proxiedFetcher(embedUrl.startsWith('https:') ? embedUrl : `https:${embedUrl}`, { const playerPage = await ctx.proxiedFetcher(embedUrl.startsWith('https:') ? embedUrl : `https:${embedUrl}`, {
method: 'POST', method: 'POST',