This commit is contained in:
himanshu8443
2025-06-15 21:29:40 +05:30
commit 3f3e12f5df
299 changed files with 18729 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
export const ffCatalog = [
{
title: 'Home',
filter: '',
},
{
title: 'Web Series',
filter: '/page-cat/42/Web-Series.html',
},
{
title: 'Hollywood',
filter: '/page-cat/9/New-Hollywood-Hindi-Dubbed-Movie-2016-2025.html',
},
];
export const ffGenresList = [];

View File

@@ -0,0 +1,38 @@
import {EpisodeLink, ProviderContext} from '../types';
export const ffEpisodeLinks = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
try {
const headers = providerContext.commonHeaders;
const {axios, cheerio} = providerContext;
const res = await axios.get(url, {headers});
const data = res.data;
const $ = cheerio.load(data);
const episodeLinks: EpisodeLink[] = [];
$('.dlink.dl').map((i, element) => {
const title = $(element)
.find('a')
.text()
?.replace('Download', '')
?.trim();
const link = $(element).find('a').attr('href');
if (title && link) {
episodeLinks.push({
title,
link,
});
}
});
return episodeLinks;
} catch (err) {
console.error('cl episode links', err);
return [];
}
};

View File

@@ -0,0 +1,56 @@
import {Info, Link, ProviderContext} from '../types';
export const ffGetInfo = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, cheerio, commonHeaders: headers} = providerContext;
const url = link;
const res = await axios.get(url, {headers});
const data = res.data;
const $ = cheerio.load(data);
const type = url.includes('tvshows') ? 'series' : 'movie';
const imdbId = '';
const title = $('.fname:contains("Name")').find('.colora').text().trim();
const image = $('.ss').find('img').attr('src') || '';
const synopsis = $('.fname:contains("Description")')
.find('.colorg')
.text()
.trim();
const tags =
$('.fname:contains("Genre")').find('.colorb').text().split(',') || [];
const rating = '';
const links: Link[] = [];
const downloadLink = $('.dlbtn').find('a').attr('href');
if (downloadLink) {
links.push({
title: title,
episodesLink: downloadLink,
});
}
return {
title,
tags,
rating,
synopsis,
image,
imdbId,
type,
linkList: links,
};
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
linkList: [],
};
}
};

View File

@@ -0,0 +1,77 @@
import {Post, ProviderContext} from '../types';
export const ffGetPosts = async function ({
filter,
page,
signal,
providerContext,
}: {
filter: string;
page: number;
providerValue: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('filmyfly');
const url = `${baseUrl + filter}/${page}`;
return posts({url, signal, baseUrl, providerContext});
};
export const ffGetPostsSearch = async function ({
searchQuery,
page,
signal,
providerContext,
}: {
searchQuery: string;
page: number;
providerValue: string;
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('filmyfly');
const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`;
if (page > 1) {
return [];
}
return posts({url, signal, baseUrl, providerContext});
};
async function posts({
url,
signal,
baseUrl,
providerContext,
}: {
url: string;
signal: AbortSignal;
baseUrl: string;
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
const {cheerio, commonHeaders: headers} = providerContext;
const res = await fetch(url, {headers, signal});
const data = await res.text();
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.A2,.A10,.fl').map((i, element) => {
const title =
$(element).find('a').eq(1).text() || $(element).find('b').text();
const link = $(element).find('a').attr('href');
const image = $(element).find('img').attr('src');
if (title && link && image) {
catalog.push({
title: title,
link: baseUrl + link,
image: image,
});
}
});
return catalog;
} catch (err) {
console.error('ff error ', err);
return [];
}
}

View File

@@ -0,0 +1,51 @@
import {Stream, ProviderContext} from '../types';
export const ffGetStream = async function ({
link,
signal,
providerContext,
}: {
link: string;
type: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Stream[]> {
try {
const res = await providerContext.axios.get(link, {signal});
const data = res.data;
const $ = providerContext.cheerio.load(data);
const streams: Stream[] = [];
const elements = $('.button2,.button1,.button3,.button4,.button').toArray();
const promises = elements.map(async element => {
const title = $(element).text();
let link = $(element).attr('href');
if (title.includes('GDFLIX') && link) {
const gdLinks = await providerContext.extractors.gdFlixExtracter(
link,
signal,
);
streams.push(...gdLinks);
}
const alreadyAdded = streams.find(s => s.link === link);
if (
title &&
link &&
!title.includes('Watch') &&
!title.includes('Login') &&
!title.includes('GoFile') &&
!alreadyAdded
) {
streams.push({
server: title,
link: link,
type: 'mkv',
});
}
});
await Promise.all(promises);
return streams;
} catch (err) {
console.error(err);
return [];
}
};

View File

@@ -0,0 +1,16 @@
import {ProviderType} from '../types';
import {ffCatalog, ffGenresList} from './ffCatalog';
import {ffEpisodeLinks} from './ffGetEpisodes';
import {ffGetInfo} from './ffGetMeta';
import {ffGetPosts, ffGetPostsSearch} from './ffGetPosts';
import {ffGetStream} from './ffGetStream';
export const filmyfly: ProviderType = {
catalog: ffCatalog,
genres: ffGenresList,
GetHomePosts: ffGetPosts,
GetMetaData: ffGetInfo,
GetSearchPosts: ffGetPostsSearch,
GetEpisodeLinks: ffEpisodeLinks,
GetStream: ffGetStream,
};