mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +01:00
Upload
This commit is contained in:
commit
09c423e95a
276 changed files with 54396 additions and 0 deletions
115
hianime/hianime.js
Normal file
115
hianime/hianime.js
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
async function searchResults(keyword) {
|
||||
try {
|
||||
const encodedKeyword = encodeURIComponent(keyword);
|
||||
const responseText = await fetchv2(`https://bshar1865-hianime2.vercel.app/api/v2/hianime/search?q=${encodedKeyword}`);
|
||||
const data = await responseText.json();
|
||||
|
||||
console.log("Search results:", data);
|
||||
|
||||
const transformedResults = data.data.animes.map(anime => ({
|
||||
title: anime.name,
|
||||
image: anime.poster,
|
||||
href: `https://hianime.to/watch/${anime.id}`
|
||||
}));
|
||||
|
||||
console.log("Transformed results:", transformedResults);
|
||||
return JSON.stringify(transformedResults);
|
||||
} catch (error) {
|
||||
console.log('Fetch error:', error);
|
||||
return JSON.stringify([{ title: 'Error', image: '', href: '' }]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const match = url.match(/https:\/\/hianime\.to\/watch\/(.+)$/);
|
||||
const encodedID = match[1];
|
||||
const response = await fetchv2(`https://bshar1865-hianime2.vercel.app/api/v2/hianime/anime/${encodedID}`);
|
||||
const data = await response.json();
|
||||
|
||||
const animeInfo = data.data.anime.info;
|
||||
const moreInfo = data.data.anime.moreInfo;
|
||||
|
||||
const transformedResults = [{
|
||||
description: animeInfo.description || 'No description available',
|
||||
aliases: `Duration: ${animeInfo.stats?.duration || 'Unknown'}`,
|
||||
airdate: `Aired: ${moreInfo?.aired || 'Unknown'}`
|
||||
}];
|
||||
|
||||
console.log("Transformed results:", transformedResults);
|
||||
return JSON.stringify(transformedResults);
|
||||
} catch (error) {
|
||||
console.log('Details error:', error);
|
||||
return JSON.stringify([{
|
||||
description: 'Error loading description',
|
||||
aliases: 'Duration: Unknown',
|
||||
airdate: 'Aired: Unknown'
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractEpisodes(url) {
|
||||
try {
|
||||
const match = url.match(/https:\/\/hianime\.to\/watch\/(.+)$/);
|
||||
const encodedID = match[1];
|
||||
const response = await fetchv2(`https://bshar1865-hianime2.vercel.app/api/v2/hianime/anime/${encodedID}/episodes`);
|
||||
const data = await response.json();
|
||||
|
||||
const transformedResults = data.data.episodes.map(episode => ({
|
||||
href: episode.episodeId,
|
||||
number: episode.number
|
||||
}));
|
||||
|
||||
console.log("Transformed results:" + transformedResults);
|
||||
return JSON.stringify(transformedResults);
|
||||
} catch (error) {
|
||||
console.log('Fetch error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractStreamUrl(id) {
|
||||
try {
|
||||
const subRes = await fetchv2(`https://animeapiiiii.vercel.app/api/stream?id=${id}&server=hd-1&type=sub`);
|
||||
const subJson = await subRes.json();
|
||||
|
||||
const streamSub = subJson.results.streamingLink.link.file;
|
||||
const englishSubtitles = (subJson.results.streamingLink.tracks || []).find(
|
||||
track => track.kind === "captions" && track.label.toLowerCase().includes("english")
|
||||
)?.file || "";
|
||||
|
||||
let streamDub = null;
|
||||
try {
|
||||
const dubRes = await fetchv2(`https://animeapiiiii.vercel.app/api/stream?id=${id}&server=hd-1&type=dub`);
|
||||
const dubJson = await dubRes.json();
|
||||
streamDub = dubJson.results?.streamingLink?.link?.file || null;
|
||||
} catch (e) {
|
||||
streamDub = null;
|
||||
}
|
||||
|
||||
const streams = [];
|
||||
|
||||
if (streamDub) {
|
||||
streams.push("DUB", streamDub);
|
||||
}
|
||||
|
||||
if (streamSub) {
|
||||
streams.push("SUB", streamSub);
|
||||
}
|
||||
|
||||
const final = {
|
||||
streams,
|
||||
subtitles: englishSubtitles
|
||||
};
|
||||
|
||||
console.log("RETURN: " + JSON.stringify(final));
|
||||
return JSON.stringify(final);
|
||||
|
||||
} catch (error) {
|
||||
console.log("Error in extractStreamUrl:", error);
|
||||
return JSON.stringify({
|
||||
streams: [],
|
||||
subtitles: ""
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
18
hianime/hianime.json
Normal file
18
hianime/hianime.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"sourceName": "HiAnime",
|
||||
"iconUrl": "https://gitlab.com/50n50/sources/-/raw/main/hianime/iconapp.png",
|
||||
"author": {
|
||||
"name": "50/50",
|
||||
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
|
||||
},
|
||||
"version": "3.0.2",
|
||||
"language": "English (DUB/SUB)",
|
||||
"streamType": "HLS",
|
||||
"quality": "1080p",
|
||||
"baseUrl": "https://megacloud.blog/",
|
||||
"searchBaseUrl": "https://bshar1865-hianime.vercel.app/api/v2/hianime/search?q=%s",
|
||||
"scriptUrl": "https://gitlab.com/50n50/sources/-/raw/main/hianime/hianime.js",
|
||||
"type": "anime",
|
||||
"asyncJS": true,
|
||||
"softsub": true
|
||||
}
|
||||
98
hianime/hianimetemp.js
Normal file
98
hianime/hianimetemp.js
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
async function searchResults(keyword) {
|
||||
try {
|
||||
const encodedKeyword = encodeURIComponent(keyword);
|
||||
const responseText = await fetch(`https://bshar1865-hianime.vercel.app/api/v2/hianime/search?q=${encodedKeyword}&language=dub`);
|
||||
const data = JSON.parse(responseText);
|
||||
|
||||
const filteredAnimes = data.data.animes.filter(anime => anime.episodes.dub !== null);
|
||||
|
||||
|
||||
const transformedResults = data.data.animes.map(anime => ({
|
||||
title: anime.name,
|
||||
image: anime.poster,
|
||||
href: `https://hianime.to/watch/${anime.id}`
|
||||
}));
|
||||
|
||||
return JSON.stringify(transformedResults);
|
||||
|
||||
} catch (error) {
|
||||
console.log('Fetch error:', error);
|
||||
return JSON.stringify([{ title: 'Error', image: '', href: '' }]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const match = url.match(/https:\/\/hianime\.to\/watch\/(.+)$/);
|
||||
const encodedID = match[1];
|
||||
const response = await fetch(`https://bshar1865-hianime.vercel.app/api/v2/hianime/anime/${encodedID}`);
|
||||
const data = JSON.parse(response);
|
||||
|
||||
const animeInfo = data.data.anime.info;
|
||||
const moreInfo = data.data.anime.moreInfo;
|
||||
|
||||
const transformedResults = [{
|
||||
description: animeInfo.description || 'No description available',
|
||||
aliases: `Duration: ${animeInfo.stats?.duration || 'Unknown'}`,
|
||||
airdate: `Aired: ${moreInfo?.aired || 'Unknown'}`
|
||||
}];
|
||||
|
||||
return JSON.stringify(transformedResults);
|
||||
} catch (error) {
|
||||
console.log('Details error:', error);
|
||||
return JSON.stringify([{
|
||||
description: 'Error loading description',
|
||||
aliases: 'Duration: Unknown',
|
||||
airdate: 'Aired: Unknown'
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractEpisodes(url) {
|
||||
try {
|
||||
const match = url.match(/https:\/\/hianime\.to\/watch\/(.+)$/);
|
||||
const encodedID = match[1];
|
||||
const response = await fetch(`https://bshar1865-hianime.vercel.app/api/v2/hianime/anime/${encodedID}/episodes`);
|
||||
const data = JSON.parse(response);
|
||||
|
||||
const transformedResults = data.data.episodes.map(episode => ({
|
||||
href: `https://hianime.to/watch/${encodedID}?ep=${episode.episodeId.split('?ep=')[1]}`,
|
||||
number: episode.number
|
||||
}));
|
||||
|
||||
return JSON.stringify(transformedResults);
|
||||
|
||||
} catch (error) {
|
||||
console.log('Fetch error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractStreamUrl(url) {
|
||||
try {
|
||||
const match = url.match(/https:\/\/hianime\.to\/watch\/(.+)$/);
|
||||
if (!match) throw new Error("Invalid URL format");
|
||||
const encodedID = match[1];
|
||||
|
||||
const response = await fetch(`https://bshar1865-hianime.vercel.app/api/v2/hianime/episode/sources?animeEpisodeId=${encodedID}&category=dub`);
|
||||
const responseTwo = await fetch(`https://bshar1865-hianime.vercel.app/api/v2/hianime/episode/sources?animeEpisodeId=${encodedID}&category=sub`);
|
||||
|
||||
const data = JSON.parse(response);
|
||||
const dataTwo = JSON.parse(responseTwo);
|
||||
|
||||
const hlsSource = data.data.sources.find(source => source.type === 'hls');
|
||||
const subtitleTrack = dataTwo.data.tracks?.find(track => track.label === 'English');
|
||||
|
||||
const result = {
|
||||
stream: hlsSource ? hlsSource.url : null,
|
||||
subtitles: subtitleTrack ? subtitleTrack.file : null
|
||||
};
|
||||
|
||||
return JSON.stringify(result);
|
||||
} catch (error) {
|
||||
console.error('Fetch error:', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
18
hianime/hianimetemp.json
Normal file
18
hianime/hianimetemp.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"sourceName": "HiAnimeTemp",
|
||||
"iconUrl": "https://gitlab.com/50n50/sources/-/raw/main/hianime/iconapp.png",
|
||||
"author": {
|
||||
"name": "50/50",
|
||||
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
|
||||
},
|
||||
"version": "1.0.4",
|
||||
"language": "English (DUB + SUB)",
|
||||
"streamType": "HLS",
|
||||
"quality": "720p",
|
||||
"baseUrl": "https://megacloud.blog/",
|
||||
"searchBaseUrl": "https://bshar1865-hianime.vercel.app/api/v2/hianime/search?q=%s",
|
||||
"scriptUrl": "https://gitlab.com/50n50/sources/-/raw/main/hianime/hianimetemp.js",
|
||||
"asyncJS": true,
|
||||
"softsub": true,
|
||||
"type": "anime"
|
||||
}
|
||||
BIN
hianime/icon.png
Normal file
BIN
hianime/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
BIN
hianime/iconapp.png
Normal file
BIN
hianime/iconapp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
Loading…
Add table
Add a link
Reference in a new issue