mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
renaming
This commit is contained in:
16
providers/filmyfly/catalog.ts
Normal file
16
providers/filmyfly/catalog.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export const catalog = [
|
||||
{
|
||||
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 genres = [];
|
||||
@@ -1,6 +1,6 @@
|
||||
import {EpisodeLink, ProviderContext} from '../types';
|
||||
import { EpisodeLink, ProviderContext } from "../types";
|
||||
|
||||
export const ffEpisodeLinks = async function ({
|
||||
export const getEpisodes = async function ({
|
||||
url,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -9,19 +9,19 @@ export const ffEpisodeLinks = async function ({
|
||||
}): Promise<EpisodeLink[]> {
|
||||
try {
|
||||
const headers = providerContext.commonHeaders;
|
||||
const {axios, cheerio} = providerContext;
|
||||
const res = await axios.get(url, {headers});
|
||||
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) => {
|
||||
$(".dlink.dl").map((i, element) => {
|
||||
const title = $(element)
|
||||
.find('a')
|
||||
.find("a")
|
||||
.text()
|
||||
?.replace('Download', '')
|
||||
?.replace("Download", "")
|
||||
?.trim();
|
||||
const link = $(element).find('a').attr('href');
|
||||
const link = $(element).find("a").attr("href");
|
||||
|
||||
if (title && link) {
|
||||
episodeLinks.push({
|
||||
@@ -32,7 +32,7 @@ export const ffEpisodeLinks = async function ({
|
||||
});
|
||||
return episodeLinks;
|
||||
} catch (err) {
|
||||
console.error('cl episode links', err);
|
||||
console.error("cl episode links", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
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 = [];
|
||||
@@ -1,56 +0,0 @@
|
||||
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: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
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,
|
||||
};
|
||||
56
providers/filmyfly/meta.ts
Normal file
56
providers/filmyfly/meta.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Info, Link, ProviderContext } from "../types";
|
||||
|
||||
export const getMeta = 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: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Post, ProviderContext} from '../types';
|
||||
import { Post, ProviderContext } from "../types";
|
||||
|
||||
export const ffGetPosts = async function ({
|
||||
export const getPosts = async function ({
|
||||
filter,
|
||||
page,
|
||||
signal,
|
||||
@@ -12,13 +12,13 @@ export const ffGetPosts = async function ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> {
|
||||
const {getBaseUrl} = providerContext;
|
||||
const baseUrl = await getBaseUrl('filmyfly');
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("filmyfly");
|
||||
const url = `${baseUrl + filter}/${page}`;
|
||||
return posts({url, signal, baseUrl, providerContext});
|
||||
return posts({ url, signal, baseUrl, providerContext });
|
||||
};
|
||||
|
||||
export const ffGetPostsSearch = async function ({
|
||||
export const getSearchPosts = async function ({
|
||||
searchQuery,
|
||||
page,
|
||||
signal,
|
||||
@@ -30,13 +30,13 @@ export const ffGetPostsSearch = async function ({
|
||||
providerContext: ProviderContext;
|
||||
signal: AbortSignal;
|
||||
}): Promise<Post[]> {
|
||||
const {getBaseUrl} = providerContext;
|
||||
const baseUrl = await getBaseUrl('filmyfly');
|
||||
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});
|
||||
return posts({ url, signal, baseUrl, providerContext });
|
||||
};
|
||||
|
||||
async function posts({
|
||||
@@ -51,16 +51,16 @@ async function posts({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> {
|
||||
try {
|
||||
const {cheerio, commonHeaders: headers} = providerContext;
|
||||
const res = await fetch(url, {headers, signal});
|
||||
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) => {
|
||||
$(".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');
|
||||
$(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,
|
||||
@@ -71,7 +71,7 @@ async function posts({
|
||||
});
|
||||
return catalog;
|
||||
} catch (err) {
|
||||
console.error('ff error ', err);
|
||||
console.error("ff error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Stream, ProviderContext} from '../types';
|
||||
import { Stream, ProviderContext } from "../types";
|
||||
|
||||
export const ffGetStream = async function ({
|
||||
export const getStream = async function ({
|
||||
link,
|
||||
signal,
|
||||
providerContext,
|
||||
@@ -11,34 +11,34 @@ export const ffGetStream = async function ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Stream[]> {
|
||||
try {
|
||||
const res = await providerContext.axios.get(link, {signal});
|
||||
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 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) {
|
||||
let link = $(element).attr("href");
|
||||
if (title.includes("GDFLIX") && link) {
|
||||
const gdLinks = await providerContext.extractors.gdFlixExtracter(
|
||||
link,
|
||||
signal,
|
||||
signal
|
||||
);
|
||||
streams.push(...gdLinks);
|
||||
}
|
||||
const alreadyAdded = streams.find(s => s.link === link);
|
||||
const alreadyAdded = streams.find((s) => s.link === link);
|
||||
if (
|
||||
title &&
|
||||
link &&
|
||||
!title.includes('Watch') &&
|
||||
!title.includes('Login') &&
|
||||
!title.includes('GoFile') &&
|
||||
!title.includes("Watch") &&
|
||||
!title.includes("Login") &&
|
||||
!title.includes("GoFile") &&
|
||||
!alreadyAdded
|
||||
) {
|
||||
streams.push({
|
||||
server: title,
|
||||
link: link,
|
||||
type: 'mkv',
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user