mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
renaming
This commit is contained in:
12
providers/dooflix/catalog.ts
Normal file
12
providers/dooflix/catalog.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export const catalog = [
|
||||
{
|
||||
title: "Series",
|
||||
filter: "/rest-api//v130/tvseries",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/rest-api//v130/movies",
|
||||
},
|
||||
];
|
||||
|
||||
export const genres = [];
|
||||
@@ -1,12 +0,0 @@
|
||||
export const dooCatalog = [
|
||||
{
|
||||
title: 'Series',
|
||||
filter: '/rest-api//v130/tvseries',
|
||||
},
|
||||
{
|
||||
title: 'Movies',
|
||||
filter: '/rest-api//v130/movies',
|
||||
},
|
||||
];
|
||||
|
||||
export const dooGenresList = [];
|
||||
@@ -1,14 +0,0 @@
|
||||
import {ProviderType} from '../types';
|
||||
import {dooCatalog, dooGenresList} from './dooCatalog';
|
||||
import {dooGetInfo} from './dooGetInfo';
|
||||
import {dooGetPost, dooGetSearchPost} from './dooGetPosts';
|
||||
import {dooGetStream} from './dooGetSteam';
|
||||
|
||||
export const dooflixProvider: ProviderType = {
|
||||
catalog: dooCatalog,
|
||||
genres: dooGenresList,
|
||||
GetMetaData: dooGetInfo,
|
||||
GetStream: dooGetStream,
|
||||
GetHomePosts: dooGetPost,
|
||||
GetSearchPosts: dooGetSearchPost,
|
||||
};
|
||||
@@ -1,14 +1,14 @@
|
||||
import {EpisodeLink, Info, Link, ProviderContext} from '../types';
|
||||
import { EpisodeLink, Info, Link, ProviderContext } from "../types";
|
||||
|
||||
const headers = {
|
||||
'Accept-Encoding': 'gzip',
|
||||
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo',
|
||||
Connection: 'Keep-Alive',
|
||||
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT',
|
||||
'User-Agent': 'okhttp/3.14.9',
|
||||
"Accept-Encoding": "gzip",
|
||||
"API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
|
||||
Connection: "Keep-Alive",
|
||||
"If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
|
||||
"User-Agent": "okhttp/3.14.9",
|
||||
};
|
||||
|
||||
export const dooGetInfo = async function ({
|
||||
export const getMeta = async function ({
|
||||
link,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -16,25 +16,25 @@ export const dooGetInfo = async function ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Info> {
|
||||
try {
|
||||
const {axios} = providerContext;
|
||||
const res = await axios.get(link, {headers});
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(link, { headers });
|
||||
const resData = res.data;
|
||||
const jsonStart = resData?.indexOf('{');
|
||||
const jsonEnd = resData?.lastIndexOf('}') + 1;
|
||||
const jsonStart = resData?.indexOf("{");
|
||||
const jsonEnd = resData?.lastIndexOf("}") + 1;
|
||||
const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title
|
||||
? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
|
||||
: resData;
|
||||
const title = data?.title || '';
|
||||
const synopsis = data?.description || '';
|
||||
const image = data?.poster_url || '';
|
||||
const title = data?.title || "";
|
||||
const synopsis = data?.description || "";
|
||||
const image = data?.poster_url || "";
|
||||
const cast = data?.cast || [];
|
||||
const rating = data?.imdb_rating || '';
|
||||
const type = Number(data?.is_tvseries) ? 'series' : 'movie';
|
||||
const rating = data?.imdb_rating || "";
|
||||
const type = Number(data?.is_tvseries) ? "series" : "movie";
|
||||
const tags = data?.genre?.map((genre: any) => genre?.name) || [];
|
||||
const links: Link[] = [];
|
||||
if (type === 'series') {
|
||||
if (type === "series") {
|
||||
data?.season?.map((season: any) => {
|
||||
const title = season?.seasons_name || '';
|
||||
const title = season?.seasons_name || "";
|
||||
const directLinks: EpisodeLink[] =
|
||||
season?.episodes?.map((episode: any) => ({
|
||||
title: episode?.episodes_name,
|
||||
@@ -48,10 +48,10 @@ export const dooGetInfo = async function ({
|
||||
} else {
|
||||
data?.videos?.map((video: any) => {
|
||||
links.push({
|
||||
title: title + ' ' + video?.label,
|
||||
title: title + " " + video?.label,
|
||||
directLinks: [
|
||||
{
|
||||
title: 'Play',
|
||||
title: "Play",
|
||||
link: video?.file_url,
|
||||
},
|
||||
],
|
||||
@@ -59,11 +59,11 @@ export const dooGetInfo = async function ({
|
||||
});
|
||||
}
|
||||
return {
|
||||
image: image?.includes('https') ? image : image?.replace('http', 'https'),
|
||||
image: image?.includes("https") ? image : image?.replace("http", "https"),
|
||||
synopsis: synopsis,
|
||||
title: title,
|
||||
rating: rating,
|
||||
imdbId: '',
|
||||
imdbId: "",
|
||||
cast: cast,
|
||||
tags: tags,
|
||||
type: type,
|
||||
@@ -72,11 +72,11 @@ export const dooGetInfo = async function ({
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
import {Post, ProviderContext} from '../types';
|
||||
import { Post, ProviderContext } from "../types";
|
||||
|
||||
const headers = {
|
||||
'Accept-Encoding': 'gzip',
|
||||
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo',
|
||||
Connection: 'Keep-Alive',
|
||||
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT',
|
||||
'User-Agent': 'okhttp/3.14.9',
|
||||
"Accept-Encoding": "gzip",
|
||||
"API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
|
||||
Connection: "Keep-Alive",
|
||||
"If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
|
||||
"User-Agent": "okhttp/3.14.9",
|
||||
};
|
||||
|
||||
export const dooGetPost = async function ({
|
||||
export const getPosts = async function ({
|
||||
filter,
|
||||
page,
|
||||
signal,
|
||||
@@ -21,23 +21,23 @@ export const dooGetPost = async function ({
|
||||
signal: AbortSignal;
|
||||
}): Promise<Post[]> {
|
||||
try {
|
||||
const {axios, getBaseUrl} = providerContext;
|
||||
const baseUrl = await getBaseUrl('dooflix');
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("dooflix");
|
||||
const catalog: Post[] = [];
|
||||
const url = `${baseUrl + filter + `?page=${page}`}`;
|
||||
|
||||
const res = await axios.get(url, {headers, signal});
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const resData = res.data;
|
||||
|
||||
if (!resData || typeof resData !== 'string') {
|
||||
console.warn('Unexpected response format from dooflix API');
|
||||
if (!resData || typeof resData !== "string") {
|
||||
console.warn("Unexpected response format from dooflix API");
|
||||
return [];
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
const jsonStart = resData.indexOf('[');
|
||||
const jsonEnd = resData.lastIndexOf(']') + 1;
|
||||
const jsonStart = resData.indexOf("[");
|
||||
const jsonEnd = resData.lastIndexOf("]") + 1;
|
||||
|
||||
if (jsonStart === -1 || jsonEnd <= jsonStart) {
|
||||
// If we can't find valid JSON array markers, try parsing the entire response
|
||||
@@ -48,12 +48,12 @@ export const dooGetPost = async function ({
|
||||
data = parsedArray.length > 0 ? parsedArray : resData;
|
||||
}
|
||||
} catch (parseError) {
|
||||
console.error('Error parsing dooflix response:', parseError);
|
||||
console.error("Error parsing dooflix response:", parseError);
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!Array.isArray(data)) {
|
||||
console.warn('Unexpected data format from dooflix API');
|
||||
console.warn("Unexpected data format from dooflix API");
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -61,16 +61,16 @@ export const dooGetPost = async function ({
|
||||
const id = result?.videos_id;
|
||||
if (!id) return;
|
||||
|
||||
const type = !result?.is_tvseries ? 'tvseries' : 'movie';
|
||||
const type = !result?.is_tvseries ? "tvseries" : "movie";
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`;
|
||||
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes('https')
|
||||
const image = thumbnailUrl?.includes("https")
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace('http', 'https');
|
||||
: thumbnailUrl?.replace("http", "https");
|
||||
|
||||
catalog.push({
|
||||
title: result?.title || '',
|
||||
title: result?.title || "",
|
||||
link,
|
||||
image,
|
||||
});
|
||||
@@ -78,12 +78,12 @@ export const dooGetPost = async function ({
|
||||
|
||||
return catalog;
|
||||
} catch (err) {
|
||||
console.error('dooflix error:', err);
|
||||
console.error("dooflix error:", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
export const dooGetSearchPost = async function ({
|
||||
export const getSearchPosts = async function ({
|
||||
searchQuery,
|
||||
page,
|
||||
providerContext,
|
||||
@@ -99,23 +99,23 @@ export const dooGetSearchPost = async function ({
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const {axios, getBaseUrl} = providerContext;
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const catalog: Post[] = [];
|
||||
const baseUrl = await getBaseUrl('dooflix');
|
||||
const baseUrl = await getBaseUrl("dooflix");
|
||||
const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`;
|
||||
|
||||
const res = await axios.get(url, {headers, signal});
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const resData = res.data;
|
||||
|
||||
if (!resData || typeof resData !== 'string') {
|
||||
console.warn('Unexpected search response format from dooflix API');
|
||||
if (!resData || typeof resData !== "string") {
|
||||
console.warn("Unexpected search response format from dooflix API");
|
||||
return [];
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
const jsonStart = resData.indexOf('{');
|
||||
const jsonEnd = resData.lastIndexOf('}') + 1;
|
||||
const jsonStart = resData.indexOf("{");
|
||||
const jsonEnd = resData.lastIndexOf("}") + 1;
|
||||
|
||||
if (jsonStart === -1 || jsonEnd <= jsonStart) {
|
||||
data = resData;
|
||||
@@ -125,7 +125,7 @@ export const dooGetSearchPost = async function ({
|
||||
data = parsedData?.movie ? parsedData : resData;
|
||||
}
|
||||
} catch (parseError) {
|
||||
console.error('Error parsing dooflix search response:', parseError);
|
||||
console.error("Error parsing dooflix search response:", parseError);
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -136,12 +136,12 @@ export const dooGetSearchPost = async function ({
|
||||
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes('https')
|
||||
const image = thumbnailUrl?.includes("https")
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace('http', 'https');
|
||||
: thumbnailUrl?.replace("http", "https");
|
||||
|
||||
catalog.push({
|
||||
title: result?.title || '',
|
||||
title: result?.title || "",
|
||||
link,
|
||||
image,
|
||||
});
|
||||
@@ -154,12 +154,12 @@ export const dooGetSearchPost = async function ({
|
||||
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes('https')
|
||||
const image = thumbnailUrl?.includes("https")
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace('http', 'https');
|
||||
: thumbnailUrl?.replace("http", "https");
|
||||
|
||||
catalog.push({
|
||||
title: result?.title || '',
|
||||
title: result?.title || "",
|
||||
link,
|
||||
image,
|
||||
});
|
||||
@@ -167,7 +167,7 @@ export const dooGetSearchPost = async function ({
|
||||
|
||||
return catalog;
|
||||
} catch (error) {
|
||||
console.error('dooflix search error:', error);
|
||||
console.error("dooflix search error:", error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Stream} from '../types';
|
||||
import { Stream } from "../types";
|
||||
|
||||
export const dooGetStream = async function ({
|
||||
export const getStream = async function ({
|
||||
link,
|
||||
}: {
|
||||
link: string;
|
||||
@@ -8,19 +8,19 @@ export const dooGetStream = async function ({
|
||||
try {
|
||||
const streams: Stream[] = [];
|
||||
streams.push({
|
||||
server: 'Dooflix',
|
||||
server: "Dooflix",
|
||||
link: link,
|
||||
type: 'm3u8',
|
||||
type: "m3u8",
|
||||
headers: {
|
||||
Connection: 'Keep-Alive',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37',
|
||||
Referer: 'https://molop.art/',
|
||||
Connection: "Keep-Alive",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37",
|
||||
Referer: "https://molop.art/",
|
||||
Cookie:
|
||||
'cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o',
|
||||
"cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o",
|
||||
},
|
||||
});
|
||||
console.log('doo streams', streams);
|
||||
console.log("doo streams", streams);
|
||||
return streams;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
Reference in New Issue
Block a user