mirror of https://github.com/aruppi/aruppi-api.git
Compare commits
88 Commits
Author | SHA1 | Date |
---|---|---|
|
6c44d5a712 | 2 years ago |
|
cef7574083 | 2 years ago |
|
7c6307cb1e | 2 years ago |
|
58ac761098 | 2 years ago |
|
3a633b2ff2 | 2 years ago |
|
e39bb486b0 | 2 years ago |
|
189a5bfb79 | 2 years ago |
|
df30fd785e | 2 years ago |
|
656d4ce1ba | 2 years ago |
|
a90e522c21 | 2 years ago |
|
faf0afee8c | 3 years ago |
|
736ff79707 | 3 years ago |
|
2b4e3d0d7d | 3 years ago |
|
fdb744582f | 3 years ago |
|
c3fa6cd854 | 3 years ago |
|
868a958e36 | 3 years ago |
|
99d636fa3f | 4 years ago |
|
361d0553e9 | 4 years ago |
|
08fb60749b | 4 years ago |
|
5f3720446b | 4 years ago |
|
6912a2eddd | 4 years ago |
|
033b35aee9 | 4 years ago |
|
9ba3e1035e | 4 years ago |
|
11ed6d5731 | 4 years ago |
|
dafe02215a | 4 years ago |
|
90cb8bab66 | 4 years ago |
|
31075ce33d | 4 years ago |
|
5c06108a3e | 4 years ago |
|
78315e4017 | 4 years ago |
|
7be55d1f87 | 4 years ago |
|
3bcdc34012 | 4 years ago |
|
24fa86de87 | 4 years ago |
|
a9bca94952 | 4 years ago |
|
22141c16f8 | 4 years ago |
|
5719ef1b17 | 4 years ago |
|
f32ca2bdcf | 4 years ago |
|
57dedd3ab5 | 4 years ago |
|
0a60814065 | 4 years ago |
|
2afd59cf7a | 4 years ago |
|
10cdb63ac4 | 4 years ago |
|
327c635467 | 4 years ago |
|
116e89e6c5 | 4 years ago |
|
c46b5eeb9d | 4 years ago |
|
c0d4fbe317 | 4 years ago |
|
bcc22b436d | 4 years ago |
|
21e8fc2637 | 4 years ago |
|
e53fefd653 | 4 years ago |
|
b529f6f13a | 4 years ago |
|
d5550bbaeb | 4 years ago |
|
f2e13f5201 | 4 years ago |
|
5708086201 | 4 years ago |
|
c1c33cb4a9 | 4 years ago |
|
177ddcb924 | 4 years ago |
|
fdef7d04e2 | 4 years ago |
|
6480c272ab | 4 years ago |
|
3fc5ddab5d | 4 years ago |
|
04b30632f8 | 4 years ago |
|
f8ab77b289 | 4 years ago |
|
77513c4820 | 4 years ago |
|
adad49eaae | 4 years ago |
|
b0e5b4c7bc | 4 years ago |
|
ea1ee08c78 | 4 years ago |
|
c0e1e5172b | 4 years ago |
|
893a9e7386 | 4 years ago |
|
87cecdafec | 4 years ago |
|
0be12412ce | 4 years ago |
|
a4d9332510 | 4 years ago |
|
482891e39b | 4 years ago |
|
76994fdbe9 | 4 years ago |
|
44afd0c085 | 4 years ago |
|
4f2bbbd417 | 4 years ago |
|
d34241a0ac | 4 years ago |
|
533ae5da2d | 4 years ago |
|
8bd8be8370 | 4 years ago |
|
526a24c3d7 | 4 years ago |
|
27955db82e | 4 years ago |
|
9bdbc458fc | 4 years ago |
|
d64e2df268 | 4 years ago |
|
e7d45c19d2 | 4 years ago |
|
cda086a583 | 4 years ago |
|
d8cc3626f2 | 4 years ago |
|
133e800b75 | 4 years ago |
|
a2f1a08d0d | 4 years ago |
|
fcd1ddc87b | 4 years ago |
|
db943834e8 | 4 years ago |
|
a634921de8 | 4 years ago |
|
841c5ad166 | 4 years ago |
|
4a7b775159 | 4 years ago |
@ -0,0 +1,32 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
node: true,
|
||||
},
|
||||
extends: ['prettier', 'eslint:recommended'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: false,
|
||||
},
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||
rules: {
|
||||
'no-underscore-dangle': 'off',
|
||||
'class-methods-use-this': 'off',
|
||||
camelcase: 'off',
|
||||
'no-unused-vars': 'warn',
|
||||
'no-undef': 'warn',
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
node: {
|
||||
extensions: ['.ts'],
|
||||
typescript: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
@ -1,47 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"airbnb-base",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"rules": {
|
||||
"no-underscore-dangle": "off",
|
||||
"prettier/prettier": "error",
|
||||
"class-methods-use-this": "off",
|
||||
"camelcase": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
"argsIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"import/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
{
|
||||
"ts": "never"
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".ts"],
|
||||
"typescript": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
trailingComma: 'all',
|
||||
arrowParens: 'avoid',
|
||||
};
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"arrowParens": "avoid"
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
Before Width: | Height: | Size: 425 KiB |
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,52 @@
|
||||
import got from 'got';
|
||||
import cheerio from 'cheerio';
|
||||
import { CookieJar } from 'tough-cookie';
|
||||
// @ts-ignore
|
||||
import * as got_pjson from 'got/package.json'
|
||||
const pjson = require('../../package.json');
|
||||
|
||||
const cookieJar = new CookieJar();
|
||||
const aruppi_options: any = {
|
||||
cookieJar,
|
||||
'headers': {
|
||||
'user-agent': `Aruppi-API/${pjson.version} ${got_pjson.name}/${got_pjson.version}`,
|
||||
'x-client': 'aruppi-api'
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
interface Options {
|
||||
scrapy: boolean;
|
||||
parse: boolean;
|
||||
scrapy?: boolean,
|
||||
parse?: boolean,
|
||||
spoof?: boolean
|
||||
}
|
||||
|
||||
export const requestGot = async (
|
||||
url: string,
|
||||
options: Options,
|
||||
url: string,
|
||||
options?: Options,
|
||||
): Promise<any> => {
|
||||
if (options !== undefined) {
|
||||
if (options.scrapy) {
|
||||
const response = await got(url, { cookieJar });
|
||||
return await cheerio.load(response.body);
|
||||
}
|
||||
const got_options: any = {...got.defaults.options, ...aruppi_options}
|
||||
if (options) {
|
||||
if (options.spoof != null) {
|
||||
got_options.headers["user-agent"] = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/69.0";
|
||||
delete got_options.headers['x-client'];
|
||||
if (!options.spoof)
|
||||
got_options.headers['user-agent'] = got.defaults.options.headers['user-agent'];
|
||||
} else if (process.env.ALPI_KEY && (new URL(url)).hostname.match(/\.jeluchu\.xyz$/)) {
|
||||
got_options.headers['x-aruppi-key'] = process.env.ALPI_KEY;
|
||||
}
|
||||
|
||||
if (options.scrapy) {
|
||||
const response = await got(url, got_options);
|
||||
return cheerio.load(response.body);
|
||||
}
|
||||
|
||||
if (options.parse) {
|
||||
return await got(url, { cookieJar }).json();
|
||||
if (options.parse) {
|
||||
got_options.responseType = 'json';
|
||||
const response = await got(url, got_options);
|
||||
return response.body;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return await got.get(url, { cookieJar });
|
||||
}
|
||||
const response = await got.get(url, got_options);
|
||||
return response;
|
||||
};
|
||||
|
@ -1,22 +1,23 @@
|
||||
export default {
|
||||
BASE_ARUPPI: 'https://aruppi.jeluchu.xyz/',
|
||||
BASE_ANIMEFLV: 'https://animeflv.net/',
|
||||
BASE_ANIMEFLV: 'https://www3.animeflv.net/',
|
||||
BASE_MONOSCHINOS: 'https://monoschinos2.com/',
|
||||
BASE_TIOANIME: 'https://tioanime.com/',
|
||||
BASE_JKANIME: 'https://jkanime.net/',
|
||||
BASE_ANIMEFLV_JELU: 'https://aruppi.jeluchu.xyz/apis/animeflv/v1/',
|
||||
BASE_YOUTUBE: 'https://aruppi.jeluchu.xyz/api/Youtube/?channelId=',
|
||||
BASE_JIKAN: 'https://aruppi.jeluchu.xyz/apis/jikan/v3/',
|
||||
BASE_IVOOX:
|
||||
'https://www.ivoox.com/podcast-anitakume_fg_f1660716_filtro_1.xml',
|
||||
BASE_YOUTUBE_PLAYLIST: 'https://aruppi.jeluchu.xyz/api/Youtube/playlist/?playlistId=',
|
||||
BASE_JIKAN: 'https://aruppi.jeluchu.xyz/apis/jikan/v4/',
|
||||
BASE_IVOOX: 'https://www.ivoox.com/podcast-anitakume_fg_f1660716_filtro_1.xml',
|
||||
BASE_KUDASAI: 'https://somoskudasai.com/feed/',
|
||||
BASE_PALOMITRON: 'https://elpalomitron.com/category/animemanga/feed/',
|
||||
BASE_RAMENPARADOS: 'https://ramenparados.com/category/noticias/anime/feed/',
|
||||
BASE_CRUNCHYROLL: 'https://www.crunchyroll.com/newsrss?lang=esES',
|
||||
JKANIME_SEARCH: 'https://jkanime.net/buscar/',
|
||||
ANIMEFLV_SEARCH: 'https://animeflv.net/browse?',
|
||||
SEARCH_DIRECTORY: 'https://animeflv.net/browse?order=title&page=',
|
||||
BASE_EPISODE_IMG_URL: 'https://cdn.animeflv.net/screenshots/',
|
||||
BASE_QWANT: 'https://api.qwant.com/search/images?',
|
||||
BASE_QWANT: 'https://api.qwant.com/v3/search/images?',
|
||||
REDDIT_ANIMETHEMES: 'https://reddit.com/r/AnimeThemes/wiki/',
|
||||
BASE_THEMEMOE: 'https://themes.moe/api/',
|
||||
BASE_ARUPPI_MONOSCHINOS: 'https://aruppi.jeluchu.xyz/apis/monoschinos/',
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue