mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
init
This commit is contained in:
15
dist/kissKh/index.js
vendored
Normal file
15
dist/kissKh/index.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.kissKhProvider = void 0;
|
||||
const kissKhCatalog_1 = require("./kissKhCatalog");
|
||||
const kissKhGetInfo_1 = require("./kissKhGetInfo");
|
||||
const kissKhGetPosts_1 = require("./kissKhGetPosts");
|
||||
const kissKhGetStream_1 = require("./kissKhGetStream");
|
||||
exports.kissKhProvider = {
|
||||
catalog: kissKhCatalog_1.kisskhCatalog,
|
||||
genres: kissKhCatalog_1.kisskhGenresList,
|
||||
GetHomePosts: kissKhGetPosts_1.kissKhGetPosts,
|
||||
GetMetaData: kissKhGetInfo_1.kissKhGetInfo,
|
||||
GetStream: kissKhGetStream_1.kissKhGetStream,
|
||||
GetSearchPosts: kissKhGetPosts_1.kissKhGetPostsSearch,
|
||||
};
|
||||
22
dist/kissKh/kissKhCatalog.js
vendored
Normal file
22
dist/kissKh/kissKhCatalog.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.kisskhGenresList = exports.kisskhCatalog = void 0;
|
||||
exports.kisskhCatalog = [
|
||||
{
|
||||
title: 'Latest',
|
||||
filter: '/api/DramaList/List?type=0&sub=0&country=0&status=0&order=2',
|
||||
},
|
||||
{
|
||||
title: 'Hollywood',
|
||||
filter: '/api/DramaList/List?type=4&sub=0&country=0&status=0&order=2',
|
||||
},
|
||||
{
|
||||
title: 'Anime',
|
||||
filter: '/api/DramaList/List?type=3&sub=0&country=0&status=0&order=2',
|
||||
},
|
||||
{
|
||||
title: 'K Drama',
|
||||
filter: '/api/DramaList/List?type=0&sub=0&country=0&status=0&order=2',
|
||||
},
|
||||
];
|
||||
exports.kisskhGenresList = [];
|
||||
50
dist/kissKh/kissKhGetInfo.js
vendored
Normal file
50
dist/kissKh/kissKhGetInfo.js
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.kissKhGetInfo = void 0;
|
||||
const kissKhGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(link);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description,
|
||||
image: data.thumbnail,
|
||||
tags: [data?.releaseDate?.split('-')[0], data?.status, data?.type],
|
||||
imdbId: '',
|
||||
type: data.episodesCount > 1 ? 'series' : 'movie',
|
||||
};
|
||||
const linkList = [];
|
||||
const subLinks = [];
|
||||
data?.episodes?.reverse().map((episode) => {
|
||||
const title = 'Episode ' + episode?.number;
|
||||
const link = episode?.id?.toString();
|
||||
if (link && title) {
|
||||
subLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title,
|
||||
directLinks: subLinks,
|
||||
});
|
||||
return {
|
||||
...meta,
|
||||
linkList: linkList,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.kissKhGetInfo = kissKhGetInfo;
|
||||
59
dist/kissKh/kissKhGetPosts.js
vendored
Normal file
59
dist/kissKh/kissKhGetPosts.js
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.kissKhGetPostsSearch = exports.kissKhGetPosts = void 0;
|
||||
const kissKhGetPosts = async function ({ filter, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl('kissKh');
|
||||
const url = `${baseUrl + filter}&type=0`;
|
||||
try {
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.data;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = baseUrl + `/api/DramaList/Drama/${element?.id}?isq=false`;
|
||||
const image = element.thumbnail;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('kiss error ', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.kissKhGetPosts = kissKhGetPosts;
|
||||
const kissKhGetPostsSearch = async function ({ searchQuery, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl('kissKh');
|
||||
const url = `${baseUrl}/api/DramaList/Search?q=${searchQuery}&type=0`;
|
||||
try {
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = baseUrl + `/api/DramaList/Drama/${element?.id}?isq=false`;
|
||||
const image = element.thumbnail;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('kiss error ', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.kissKhGetPostsSearch = kissKhGetPostsSearch;
|
||||
42
dist/kissKh/kissKhGetStream.js
vendored
Normal file
42
dist/kissKh/kissKhGetStream.js
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.kissKhGetStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const kissKhGetStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const streamLinks = [];
|
||||
const subtitles = [];
|
||||
const baseUrl = await getBaseUrl('kissKh');
|
||||
const streamUrl = 'https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=' +
|
||||
id;
|
||||
const res = await axios.get(streamUrl);
|
||||
const stream = res.data?.source?.Video;
|
||||
const subData = res.data?.subtitles;
|
||||
subData?.map((sub) => {
|
||||
subtitles.push({
|
||||
title: sub?.label,
|
||||
language: sub?.land,
|
||||
type: sub?.src?.includes('.vtt')
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
uri: sub?.src,
|
||||
});
|
||||
});
|
||||
streamLinks.push({
|
||||
server: 'kissKh',
|
||||
link: stream,
|
||||
type: 'm3u8',
|
||||
subtitles,
|
||||
headers: {
|
||||
referer: baseUrl,
|
||||
},
|
||||
});
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.kissKhGetStream = kissKhGetStream;
|
||||
Reference in New Issue
Block a user