@kaguya-anime/parsers
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -122,3 +122,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return { | ||
sources: sources.map((source) => (Object.assign(Object.assign({}, source), { useEdgeProxy: true }))), | ||
sources: sources.map((source) => (Object.assign(Object.assign({}, source), { useProxy: true }))), | ||
}; | ||
@@ -125,0 +125,0 @@ }); |
import { IAnimeResult, ISearch } from '@consumet/extensions'; | ||
import { AxiosInstance } from 'axios'; | ||
import AnimeScraper, { AnimeServer, AnimeSource, GetServersQuery, GetSourcesQuery } from '../../core/AnimeScraper'; | ||
import { SourceAnime } from '../../types/data'; | ||
export default class AnimeNineAnimeScraper extends AnimeScraper { | ||
consumetClient: AxiosInstance; | ||
constructor(); | ||
@@ -6,0 +8,0 @@ shouldMonitorChange(oldPage: ISearch<IAnimeResult>, newPage: ISearch<IAnimeResult>): boolean; |
@@ -16,2 +16,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
this.monitor.interval = 1800000; | ||
this.consumetClient = axios_1.default.create({ | ||
baseURL: 'https://api.consumet.org', | ||
}); | ||
} | ||
@@ -45,3 +48,3 @@ shouldMonitorChange(oldPage, newPage) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield axios_1.default.get(`https://api.consumet.org/anime/9anime/info/${sourceId}`); | ||
const { data } = yield this.consumetClient.get(`/anime/9anime/info/${sourceId}`); | ||
if (!(data === null || data === void 0 ? void 0 : data.title)) | ||
@@ -85,9 +88,17 @@ return; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const priorityServer = [ | ||
'vizcloud', | ||
'streamtape', | ||
'mycloud', | ||
'filemoon', | ||
'mp4upload', | ||
]; | ||
try { | ||
const { episode_id } = query; | ||
const { data } = yield axios_1.default.get(`https://api.consumet.org/anime/9anime/servers/${episode_id}`); | ||
return data.map(({ name }) => { | ||
const { data } = yield this.consumetClient.get(`/anime/9anime/servers/${episode_id}`); | ||
const servers = data.map(({ name }) => { | ||
name = name.replace('vidstream', 'vizcloud'); | ||
return { id: name, name: (0, lodash_1.capitalize)(name) }; | ||
}); | ||
return this.sortServers(servers, priorityServer); | ||
} | ||
@@ -105,3 +116,3 @@ catch (err) { | ||
const { episode_id, server_id } = query; | ||
const { data } = yield axios_1.default.get(`https://api.consumet.org/anime/9anime/watch/${episode_id}?server=${server_id}`); | ||
const { data } = yield this.consumetClient.get(`/anime/9anime/watch/${episode_id}?server=${server_id}`); | ||
if (!((_a = data === null || data === void 0 ? void 0 : data.sources) === null || _a === void 0 ? void 0 : _a.length)) | ||
@@ -111,2 +122,12 @@ return { | ||
}; | ||
if (server_id !== 'vizcloud') { | ||
return { | ||
sources: [ | ||
{ | ||
file: data.embedURL, | ||
isEmbed: true, | ||
}, | ||
], | ||
}; | ||
} | ||
return { | ||
@@ -121,2 +142,3 @@ sources: data.sources.map((source) => { | ||
appendReqHeaders: data.headers || {}, | ||
ignoreReqHeaders: true, | ||
}, | ||
@@ -123,0 +145,0 @@ }); |
@@ -63,3 +63,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
label: source.quality, | ||
useEdgeProxy: true, | ||
useProxy: true, | ||
})), | ||
@@ -66,0 +66,0 @@ subtitles: data.subtitles |
@@ -93,3 +93,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
image, | ||
useEdgeProxy: true, | ||
useProxy: true, | ||
proxy: { | ||
@@ -96,0 +96,0 @@ appendReqHeaders: { |
@@ -108,3 +108,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
image: `${data.baseUrl}/data/${data.chapter.hash}/${hash}`, | ||
useEdgeProxy: true, | ||
useProxy: true, | ||
proxy: { | ||
@@ -111,0 +111,0 @@ appendReqHeaders: { |
{ | ||
"name": "@kaguya-anime/parsers", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"main": "build/index.js", | ||
@@ -43,3 +43,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "bf43a165fb1ad2e3642b1db18d561a43e91892b8" | ||
"gitHead": "4e317dfaa13e2e3751151c997623ca148bad58f5" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
430384
7666