mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
feat: add a111477 provider
This commit is contained in:
1
dist/a111477/catalog.js
vendored
Normal file
1
dist/a111477/catalog.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Movies",filter:"/movies/"},{title:"TV Shows",filter:"/tvs/"},{title:"K-Drama",filter:"/kdrama/"},{title:"Asian Drama",filter:"/asiandrama/"},{title:"Misc",filter:"/misc/"}],exports.genres=[];
|
||||||
1
dist/a111477/episodes.js
vendored
Normal file
1
dist/a111477/episodes.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio}=providerContext;try{const html=(yield axios.get(url)).data,$=cheerio.load(html),episodeLinks=[];return $("table tbody tr").each((i,element)=>{const linkElement=$(element).find("td:first-child a"),fileName=linkElement.text().trim(),fileLink=linkElement.attr("href");if(fileName&&fileLink&&"../"!==fileName&&"Parent Directory"!==fileName&&(fileName.includes(".mp4")||fileName.includes(".mkv")||fileName.includes(".avi")||fileName.includes(".mov"))){const fullLink=url+fileLink;let episodeTitle=fileName;const episodeMatch=fileName.match(/[Ss](\d+)[Ee](\d+)/),simpleEpisodeMatch=fileName.match(/[Ee](\d+)/);if(episodeMatch)episodeTitle=`S${episodeMatch[1]}E${episodeMatch[2]} - ${fileName}`;else if(simpleEpisodeMatch)episodeTitle=`Episode ${simpleEpisodeMatch[1]} - ${fileName}`;else{const numberMatch=fileName.match(/(\d+)/);numberMatch&&(episodeTitle=`Episode ${numberMatch[1]} - ${fileName}`)}episodeLinks.push({title:episodeTitle,link:fullLink})}}),episodeLinks}catch(err){return[]}})};exports.getEpisodes=getEpisodes;
|
||||||
1
dist/a111477/meta.js
vendored
Normal file
1
dist/a111477/meta.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){try{const{axios:axios,cheerio:cheerio}=providerContext,url=link,data=(yield axios.get(url)).data,$=cheerio.load(data),title=($("h1").text().trim()||url.split("/").filter(Boolean).pop()||"").replace("Index of /","").replace(/\/$/,""),links=[],directLinks=[];$("table tbody tr").each((i,element)=>{const linkElement=$(element).find("td:first-child a"),itemTitle=linkElement.text().trim(),itemLink=linkElement.attr("href");if(itemTitle&&itemLink&&"../"!==itemTitle&&"Parent Directory"!==itemTitle){const fullLink=link+itemLink;if(itemTitle.endsWith("/")){const cleanTitle=itemTitle.replace(/\/$/,"");links.push({episodesLink:fullLink,title:cleanTitle})}else(itemTitle.includes(".mp4")||itemTitle.includes(".mkv")||itemTitle.includes(".avi")||itemTitle.includes(".mov"))&&directLinks.push({title:itemTitle,link:fullLink})}}),directLinks.length>0&&links.push({title:title+" (Direct Files)",directLinks:directLinks});const type=links.some(link=>{var _a,_b;return(null===(_a=link.episodesLink)||void 0===_a?void 0:_a.includes("Season"))||(null===(_b=link.episodesLink)||void 0===_b?void 0:_b.includes("S0"))})||directLinks.length>1?"series":"movie";return{title:title,synopsis:"Content from 111477.xyz directory",image:`https://placehold.jp/23/000000/ffffff/300x450.png?text=${encodeURIComponent(title)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`,imdbId:"",type:type,linkList:links}}catch(err){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||||
1
dist/a111477/posts.js
vendored
Normal file
1
dist/a111477/posts.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(_a){return __awaiter(this,arguments,void 0,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{axios:axios,cheerio:cheerio}=providerContext;if(page>1)return[];return posts({baseUrl:"https://a.111477.xyz",url:`https://a.111477.xyz${filter}`,signal:signal,axios:axios,cheerio:cheerio})})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{axios:axios,cheerio:cheerio}=providerContext,baseUrl="https://a.111477.xyz";if(page>1)return[];return[...yield posts({baseUrl:baseUrl,url:`${baseUrl}/movies/`,signal:signal,axios:axios,cheerio:cheerio}),...yield posts({baseUrl:baseUrl,url:`${baseUrl}/tvs/`,signal:signal,axios:axios,cheerio:cheerio})].filter(post=>post.title.toLowerCase().includes(searchQuery.toLowerCase()))})};function posts(_a){return __awaiter(this,arguments,void 0,function*({baseUrl:baseUrl,url:url,signal:signal,axios:axios,cheerio:cheerio}){try{const data=(yield axios.get(url,{signal:signal})).data,$=cheerio.load(data),catalog=[];return $("table tbody tr").each((i,element)=>{const linkElement=$(element).find("td:first-child a"),title=linkElement.text().trim(),link=linkElement.attr("href");if(title&&link&&"../"!==title&&"Parent Directory"!==title&&title.endsWith("/")){const cleanTitle=title.replace(/\/$/,""),fullLink=url+link,imageTitle=cleanTitle.length>30?cleanTitle.slice(0,30).replace(/\./g," "):cleanTitle.replace(/\./g," "),image=`https://placehold.jp/23/000000/ffffff/200x400.png?text=${encodeURIComponent(imageTitle)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`;catalog.push({title:cleanTitle,link:fullLink,image:image})}}),catalog}catch(err){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||||
1
dist/a111477/stream.js
vendored
Normal file
1
dist/a111477/stream.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(_a){return __awaiter(this,arguments,void 0,function*({link:url}){var _b;try{const stream=[],fileExtension=(null===(_b=url.split(".").pop())||void 0===_b?void 0:_b.toLowerCase())||"mp4";let streamType="mp4";return["mkv","avi","mov","webm"].includes(fileExtension)&&(streamType=fileExtension),stream.push({server:"111477.xyz",link:url,type:streamType,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",Referer:"https://a.111477.xyz/"}}),stream}catch(err){return[]}})};exports.getStream=getStream;
|
||||||
@@ -135,13 +135,21 @@
|
|||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"display_name": "a.111477",
|
||||||
|
"value": "a111477",
|
||||||
|
"version": "1.0",
|
||||||
|
"icon": "",
|
||||||
|
"type": "english",
|
||||||
|
"disabled": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"display_name": "VadaPav",
|
"display_name": "VadaPav",
|
||||||
"value": "vadapav",
|
"value": "vadapav",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MoviesApi",
|
"display_name": "MoviesApi",
|
||||||
|
|||||||
24
providers/a111477/catalog.ts
Normal file
24
providers/a111477/catalog.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
export const catalog = [
|
||||||
|
{
|
||||||
|
title: "Movies",
|
||||||
|
filter: "/movies/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "TV Shows",
|
||||||
|
filter: "/tvs/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "K-Drama",
|
||||||
|
filter: "/kdrama/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Asian Drama",
|
||||||
|
filter: "/asiandrama/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Misc",
|
||||||
|
filter: "/misc/",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const genres = [];
|
||||||
69
providers/a111477/episodes.ts
Normal file
69
providers/a111477/episodes.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import { EpisodeLink, ProviderContext } from "../types";
|
||||||
|
|
||||||
|
export const getEpisodes = async function ({
|
||||||
|
url,
|
||||||
|
providerContext,
|
||||||
|
}: {
|
||||||
|
url: string;
|
||||||
|
providerContext: ProviderContext;
|
||||||
|
}): Promise<EpisodeLink[]> {
|
||||||
|
const { axios, cheerio } = providerContext;
|
||||||
|
try {
|
||||||
|
const res = await axios.get(url);
|
||||||
|
const html = res.data;
|
||||||
|
const $ = cheerio.load(html);
|
||||||
|
const episodeLinks: EpisodeLink[] = [];
|
||||||
|
|
||||||
|
// Parse episode files from directory
|
||||||
|
$("table tbody tr").each((i, element) => {
|
||||||
|
const $row = $(element);
|
||||||
|
const linkElement = $row.find("td:first-child a");
|
||||||
|
const fileName = linkElement.text().trim();
|
||||||
|
const fileLink = linkElement.attr("href");
|
||||||
|
|
||||||
|
if (
|
||||||
|
fileName &&
|
||||||
|
fileLink &&
|
||||||
|
fileName !== "../" &&
|
||||||
|
fileName !== "Parent Directory"
|
||||||
|
) {
|
||||||
|
// Check if it's a video file
|
||||||
|
if (
|
||||||
|
fileName.includes(".mp4") ||
|
||||||
|
fileName.includes(".mkv") ||
|
||||||
|
fileName.includes(".avi") ||
|
||||||
|
fileName.includes(".mov")
|
||||||
|
) {
|
||||||
|
const fullLink = url + fileLink;
|
||||||
|
|
||||||
|
// Try to extract episode information from filename
|
||||||
|
let episodeTitle = fileName;
|
||||||
|
const episodeMatch = fileName.match(/[Ss](\d+)[Ee](\d+)/);
|
||||||
|
const simpleEpisodeMatch = fileName.match(/[Ee](\d+)/);
|
||||||
|
|
||||||
|
if (episodeMatch) {
|
||||||
|
episodeTitle = `S${episodeMatch[1]}E${episodeMatch[2]} - ${fileName}`;
|
||||||
|
} else if (simpleEpisodeMatch) {
|
||||||
|
episodeTitle = `Episode ${simpleEpisodeMatch[1]} - ${fileName}`;
|
||||||
|
} else {
|
||||||
|
// Try to extract episode number from various patterns
|
||||||
|
const numberMatch = fileName.match(/(\d+)/);
|
||||||
|
if (numberMatch) {
|
||||||
|
episodeTitle = `Episode ${numberMatch[1]} - ${fileName}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
episodeLinks.push({
|
||||||
|
title: episodeTitle,
|
||||||
|
link: fullLink,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return episodeLinks;
|
||||||
|
} catch (err) {
|
||||||
|
console.error("111477 episodes error:", err);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
};
|
||||||
103
providers/a111477/meta.ts
Normal file
103
providers/a111477/meta.ts
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import { EpisodeLink, Info, Link, ProviderContext } from "../types";
|
||||||
|
|
||||||
|
export const getMeta = async function ({
|
||||||
|
link,
|
||||||
|
providerContext,
|
||||||
|
}: {
|
||||||
|
link: string;
|
||||||
|
providerContext: ProviderContext;
|
||||||
|
}): Promise<Info> {
|
||||||
|
try {
|
||||||
|
const { axios, cheerio } = providerContext;
|
||||||
|
const url = link;
|
||||||
|
const res = await axios.get(url);
|
||||||
|
const data = res.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
|
||||||
|
// Extract title from the page header or URL
|
||||||
|
const pageTitle =
|
||||||
|
$("h1").text().trim() || url.split("/").filter(Boolean).pop() || "";
|
||||||
|
const title = pageTitle.replace("Index of /", "").replace(/\/$/, "");
|
||||||
|
|
||||||
|
const links: Link[] = [];
|
||||||
|
const directLinks: EpisodeLink[] = [];
|
||||||
|
|
||||||
|
// Parse directory structure
|
||||||
|
$("table tbody tr").each((i, element) => {
|
||||||
|
const $row = $(element);
|
||||||
|
const linkElement = $row.find("td:first-child a");
|
||||||
|
const itemTitle = linkElement.text().trim();
|
||||||
|
const itemLink = linkElement.attr("href");
|
||||||
|
|
||||||
|
if (
|
||||||
|
itemTitle &&
|
||||||
|
itemLink &&
|
||||||
|
itemTitle !== "../" &&
|
||||||
|
itemTitle !== "Parent Directory"
|
||||||
|
) {
|
||||||
|
const fullLink = link + itemLink;
|
||||||
|
|
||||||
|
// If it's a directory (ends with /)
|
||||||
|
if (itemTitle.endsWith("/")) {
|
||||||
|
const cleanTitle = itemTitle.replace(/\/$/, "");
|
||||||
|
links.push({
|
||||||
|
episodesLink: fullLink,
|
||||||
|
title: cleanTitle,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// If it's a video file
|
||||||
|
else if (
|
||||||
|
itemTitle.includes(".mp4") ||
|
||||||
|
itemTitle.includes(".mkv") ||
|
||||||
|
itemTitle.includes(".avi") ||
|
||||||
|
itemTitle.includes(".mov")
|
||||||
|
) {
|
||||||
|
directLinks.push({
|
||||||
|
title: itemTitle,
|
||||||
|
link: fullLink,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// If there are direct video files, add them as a direct link group
|
||||||
|
if (directLinks.length > 0) {
|
||||||
|
links.push({
|
||||||
|
title: title + " (Direct Files)",
|
||||||
|
directLinks: directLinks,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if this is a movie or series based on structure
|
||||||
|
const type = links.some(
|
||||||
|
(link) =>
|
||||||
|
link.episodesLink?.includes("Season") ||
|
||||||
|
link.episodesLink?.includes("S0")
|
||||||
|
)
|
||||||
|
? "series"
|
||||||
|
: directLinks.length > 1
|
||||||
|
? "series"
|
||||||
|
: "movie";
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
synopsis: `Content from 111477.xyz directory`,
|
||||||
|
image: `https://placehold.jp/23/000000/ffffff/300x450.png?text=${encodeURIComponent(
|
||||||
|
title
|
||||||
|
)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`,
|
||||||
|
imdbId: "",
|
||||||
|
type: type,
|
||||||
|
linkList: links,
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
console.error("111477 meta error:", err);
|
||||||
|
return {
|
||||||
|
title: "",
|
||||||
|
synopsis: "",
|
||||||
|
image: "",
|
||||||
|
imdbId: "",
|
||||||
|
type: "movie",
|
||||||
|
linkList: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
128
providers/a111477/posts.ts
Normal file
128
providers/a111477/posts.ts
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
import { Post, ProviderContext } from "../types";
|
||||||
|
|
||||||
|
export const getPosts = async function ({
|
||||||
|
filter,
|
||||||
|
page,
|
||||||
|
signal,
|
||||||
|
providerContext,
|
||||||
|
}: {
|
||||||
|
filter: string;
|
||||||
|
page: number;
|
||||||
|
providerValue: string;
|
||||||
|
signal: AbortSignal;
|
||||||
|
providerContext: ProviderContext;
|
||||||
|
}): Promise<Post[]> {
|
||||||
|
const { axios, cheerio } = providerContext;
|
||||||
|
const baseUrl = "https://a.111477.xyz";
|
||||||
|
if (page > 1) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
const url = `${baseUrl}${filter}`;
|
||||||
|
return posts({ baseUrl, url, signal, axios, cheerio });
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getSearchPosts = async function ({
|
||||||
|
searchQuery,
|
||||||
|
page,
|
||||||
|
signal,
|
||||||
|
providerContext,
|
||||||
|
}: {
|
||||||
|
searchQuery: string;
|
||||||
|
page: number;
|
||||||
|
providerValue: string;
|
||||||
|
signal: AbortSignal;
|
||||||
|
providerContext: ProviderContext;
|
||||||
|
}): Promise<Post[]> {
|
||||||
|
const { axios, cheerio } = providerContext;
|
||||||
|
const baseUrl = "https://a.111477.xyz";
|
||||||
|
if (page > 1) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search through both movies and TV shows directories
|
||||||
|
const moviesPosts = await posts({
|
||||||
|
baseUrl,
|
||||||
|
url: `${baseUrl}/movies/`,
|
||||||
|
signal,
|
||||||
|
axios,
|
||||||
|
cheerio,
|
||||||
|
});
|
||||||
|
const tvsPosts = await posts({
|
||||||
|
baseUrl,
|
||||||
|
url: `${baseUrl}/tvs/`,
|
||||||
|
signal,
|
||||||
|
axios,
|
||||||
|
cheerio,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Combine all posts
|
||||||
|
const allPosts = [...moviesPosts, ...tvsPosts];
|
||||||
|
|
||||||
|
// Filter posts based on search query
|
||||||
|
const filteredPosts = allPosts.filter((post) =>
|
||||||
|
post.title.toLowerCase().includes(searchQuery.toLowerCase())
|
||||||
|
);
|
||||||
|
|
||||||
|
return filteredPosts;
|
||||||
|
};
|
||||||
|
|
||||||
|
async function posts({
|
||||||
|
baseUrl,
|
||||||
|
url,
|
||||||
|
signal,
|
||||||
|
axios,
|
||||||
|
cheerio,
|
||||||
|
}: {
|
||||||
|
baseUrl: string;
|
||||||
|
url: string;
|
||||||
|
signal: AbortSignal;
|
||||||
|
axios: ProviderContext["axios"];
|
||||||
|
cheerio: ProviderContext["cheerio"];
|
||||||
|
}): Promise<Post[]> {
|
||||||
|
try {
|
||||||
|
const res = await axios.get(url, { signal });
|
||||||
|
const data = res.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const catalog: Post[] = [];
|
||||||
|
|
||||||
|
// Parse the directory listing
|
||||||
|
$("table tbody tr").each((i, element) => {
|
||||||
|
const $row = $(element);
|
||||||
|
const linkElement = $row.find("td:first-child a");
|
||||||
|
const title = linkElement.text().trim();
|
||||||
|
const link = linkElement.attr("href");
|
||||||
|
|
||||||
|
// Skip parent directory and files, only get folders
|
||||||
|
if (
|
||||||
|
title &&
|
||||||
|
link &&
|
||||||
|
title !== "../" &&
|
||||||
|
title !== "Parent Directory" &&
|
||||||
|
title.endsWith("/")
|
||||||
|
) {
|
||||||
|
const cleanTitle = title.replace(/\/$/, ""); // Remove trailing slash
|
||||||
|
const fullLink = url + link;
|
||||||
|
|
||||||
|
// Generate a placeholder image based on title
|
||||||
|
const imageTitle =
|
||||||
|
cleanTitle.length > 30
|
||||||
|
? cleanTitle.slice(0, 30).replace(/\./g, " ")
|
||||||
|
: cleanTitle.replace(/\./g, " ");
|
||||||
|
const image = `https://placehold.jp/23/000000/ffffff/200x400.png?text=${encodeURIComponent(
|
||||||
|
imageTitle
|
||||||
|
)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`;
|
||||||
|
|
||||||
|
catalog.push({
|
||||||
|
title: cleanTitle,
|
||||||
|
link: fullLink,
|
||||||
|
image: image,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return catalog;
|
||||||
|
} catch (err) {
|
||||||
|
console.error("111477 directory listing error:", err);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
38
providers/a111477/stream.ts
Normal file
38
providers/a111477/stream.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import { Stream, ProviderContext } from "../types";
|
||||||
|
|
||||||
|
export const getStream = async function ({
|
||||||
|
link: url,
|
||||||
|
}: {
|
||||||
|
link: string;
|
||||||
|
type: string;
|
||||||
|
providerContext: ProviderContext;
|
||||||
|
}): Promise<Stream[]> {
|
||||||
|
try {
|
||||||
|
const stream: Stream[] = [];
|
||||||
|
|
||||||
|
// Get file extension from URL
|
||||||
|
const fileExtension = url.split(".").pop()?.toLowerCase() || "mp4";
|
||||||
|
|
||||||
|
// Determine stream type based on file extension
|
||||||
|
let streamType = "mp4";
|
||||||
|
if (["mkv", "avi", "mov", "webm"].includes(fileExtension)) {
|
||||||
|
streamType = fileExtension;
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.push({
|
||||||
|
server: "111477.xyz",
|
||||||
|
link: url,
|
||||||
|
type: streamType,
|
||||||
|
headers: {
|
||||||
|
"User-Agent":
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
||||||
|
Referer: "https://a.111477.xyz/",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return stream;
|
||||||
|
} catch (err) {
|
||||||
|
console.error("111477 stream error:", err);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user