mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
minify
This commit is contained in:
15
dist/tokyoInsider/catalog.js
vendored
15
dist/tokyoInsider/catalog.js
vendored
@@ -1,14 +1 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Top Anime",
|
||||
filter: "anime/search?r=5",
|
||||
},
|
||||
{
|
||||
title: "Popular Anime",
|
||||
filter: "anime/",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Top Anime",filter:"anime/search?r=5"},{title:"Popular Anime",filter:"anime/"}],exports.genres=[];
|
||||
69
dist/tokyoInsider/meta.js
vendored
69
dist/tokyoInsider/meta.js
vendored
@@ -1,68 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
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) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
try {
|
||||
const { cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = yield fetch(url);
|
||||
const data = yield res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const meta = {
|
||||
title: $('.c_h2:contains("Title(s):")')
|
||||
.text()
|
||||
.replace("Title(s):", "")
|
||||
.trim()
|
||||
.split("\n")[0],
|
||||
synopsis: $('.c_h2b:contains("Summary:"),.c_h2:contains("Summary:")')
|
||||
.text()
|
||||
.replace("Summary:", "")
|
||||
.trim(),
|
||||
image: $(".a_img").attr("src") || "",
|
||||
imdbId: "",
|
||||
type: "series",
|
||||
};
|
||||
const episodesList = [];
|
||||
$(".episode").map((i, element) => {
|
||||
const link = "https://www.tokyoinsider.com" + $(element).find("a").attr("href") ||
|
||||
$(".download-link").attr("href");
|
||||
let title = $(element).find("a").find("em").text() +
|
||||
" " +
|
||||
$(element).find("a").find("strong").text();
|
||||
if (!title.trim()) {
|
||||
title = $(".download-link").text();
|
||||
}
|
||||
if (link && title.trim()) {
|
||||
episodesList.push({ title, link });
|
||||
}
|
||||
});
|
||||
return Object.assign(Object.assign({}, meta), { linkList: [
|
||||
{
|
||||
title: meta.title,
|
||||
directLinks: episodesList,
|
||||
},
|
||||
] });
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "series",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function o(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,o)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){try{const{cheerio:i}=e,n=t,r=yield fetch(n),a=yield r.text(),s=i.load(a),o={title:s('.c_h2:contains("Title(s):")').text().replace("Title(s):","").trim().split("\n")[0],synopsis:s('.c_h2b:contains("Summary:"),.c_h2:contains("Summary:")').text().replace("Summary:","").trim(),image:s(".a_img").attr("src")||"",imdbId:"",type:"series"},c=[];return s(".episode").map((t,e)=>{const i="https://www.tokyoinsider.com"+s(e).find("a").attr("href")||s(".download-link").attr("href");let n=s(e).find("a").find("em").text()+" "+s(e).find("a").find("strong").text();n.trim()||(n=s(".download-link").text()),i&&n.trim()&&c.push({title:n,link:i})}),Object.assign(Object.assign({},o),{linkList:[{title:o.title,directLinks:c}]})}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"series",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
66
dist/tokyoInsider/posts.js
vendored
66
dist/tokyoInsider/posts.js
vendored
@@ -1,65 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
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) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseURL = yield getBaseUrl("tokyoinsider");
|
||||
const start = page < 2 ? 0 : (page - 1) * 20;
|
||||
const url = `${baseURL}/${filter}&start=${start}`;
|
||||
return posts({ baseURL, url, signal, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseURL = yield getBaseUrl("tokyoinsider");
|
||||
const start = page < 2 ? 0 : (page - 1) * 20;
|
||||
const url = `${baseURL}/anime/search?k=${searchQuery}&start=${start}`;
|
||||
return posts({ baseURL, url, signal, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ baseURL, url, signal, axios, cheerio, }) {
|
||||
try {
|
||||
const res = yield axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('td.c_h2[width="40"]').map((i, element) => {
|
||||
var _a;
|
||||
const image = (_a = $(element)
|
||||
.find(".a_img")
|
||||
.attr("src")) === null || _a === void 0 ? void 0 : _a.replace("small", "default");
|
||||
const title = $(element).find("a").attr("title");
|
||||
const link = baseURL + $(element).find("a").attr("href");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(s,o){function n(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(n,a)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,page:e,signal:r,providerContext:i}){const{getBaseUrl:s,axios:o,cheerio:n}=i,a=yield s("tokyoinsider");return posts({baseURL:a,url:`${a}/${t}&start=${e<2?0:20*(e-1)}`,signal:r,axios:o,cheerio:n})})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:r,providerContext:i}){const{getBaseUrl:s,axios:o,cheerio:n}=i,a=yield s("tokyoinsider");return posts({baseURL:a,url:`${a}/anime/search?k=${t}&start=${e<2?0:20*(e-1)}`,signal:r,axios:o,cheerio:n})})};function posts(t){return __awaiter(this,arguments,void 0,function*({baseURL:t,url:e,signal:r,axios:i,cheerio:s}){try{const o=(yield i.get(e,{signal:r})).data,n=s.load(o),a=[];return n('td.c_h2[width="40"]').map((e,r)=>{var i;const s=null===(i=n(r).find(".a_img").attr("src"))||void 0===i?void 0:i.replace("small","default"),o=n(r).find("a").attr("title"),c=t+n(r).find("a").attr("href");o&&c&&s&&a.push({title:o,link:c,image:s})}),a}catch(t){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
42
dist/tokyoInsider/stream.js
vendored
42
dist/tokyoInsider/stream.js
vendored
@@ -1,41 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
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) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
try {
|
||||
const { cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = yield fetch(url);
|
||||
const data = yield res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const streamLinks = [];
|
||||
$(".c_h1,.c_h2").map((i, element) => {
|
||||
$(element).find("span").remove();
|
||||
const title = $(element).find("a").text() || "";
|
||||
const link = $(element).find("a").attr("href") || "";
|
||||
if (title && link.includes("media")) {
|
||||
streamLinks.push({
|
||||
server: title,
|
||||
link,
|
||||
type: link.split(".").pop() || "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function c(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,c)}s((r=r.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){try{const{cheerio:n}=e,r=t,i=yield fetch(r),o=yield i.text(),a=n.load(o),c=[];return a(".c_h1,.c_h2").map((t,e)=>{a(e).find("span").remove();const n=a(e).find("a").text()||"",r=a(e).find("a").attr("href")||"";n&&r.includes("media")&&c.push({server:n,link:r,type:r.split(".").pop()||"mkv"})}),c}catch(t){return[]}})};exports.getStream=getStream;
|
||||
Reference in New Issue
Block a user