Launch of v2.0.0

pull/1/head
Jéluchu 5 years ago
parent 88d2838949
commit 31f34a7c5f

@ -1,2 +1,124 @@
# AruppiAPI # **Aruppi API** (v2.0.0)
Aruppi is a custom API for use on android app (Under Construction)
> This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture
>
> These are the services used for the Aruppi App (only available in Spanish language)
![node version](https://img.shields.io/badge/node->=12.17.x-brightgreen.svg)
![npm version](https://img.shields.io/badge/npm->=6.14.x-brightgreen.svg)
![type code](https://img.shields.io/badge/aruppi-API-brightgreen.svg)
![maintenance](https://img.shields.io/badge/maintained-Yes-brightgreen.svg)
![now](https://badgen.net/badge/icon/now?icon=now&label)
![gitrepo](https://img.shields.io/github/stars/aruppi/aruppi-api?style=social)
---
<img src="./assets/img/logo.png" width="100%" alt="">
## 📖 API Documentation
Soon we will add the documentation information in a link
## :rocket: Custom Aruppi API Link
Link to access the [Aruppi API](https://aruppi-api.jeluchu.now.sh/api/v2)
## 📚 **Development Diary**
Describe the purpose of the project and give clues about what the code does.
For more information go to the following link [Diary Reference](./development_diary/README.md).
## **:wrench: Developer usage**
### **Set up project**
Before cloning the repo **be sure** you have installed:
- [**NODE**](https://www.google.com/search?q=how+to+install+node) (version >= 12.17.x)
- [**NPM**](https://www.google.com/search?q=how+to+install+npm) (version >= 6.14.x)
Then:
- Choose a folder project in your system and switch in `cd [folder path]`
- Clone the repo in your folder path `git clone https://github.com/aruppi/aruppi-api`
---
### **Installation**
In order to install the project and all dependencies, enter in the project folder and run `npm install`
---
### Start the project
```bash
npm start
```
### Test the project
```bash
npm test
```
---
## Deprecated v1 for API
Aruppi has grown since it was launched and we need to continue improving the application along with the services to be able to give new features.
But if you need to see the code or the operation of the old version you can do it
- [Aruppi API GitHub (v1) [Deprecated]](https://github.com/aruppi/aruppi-api-v1)
- [Aruppi API Custom Link(v1) [Deprecated]](https://aruppi.herokuapp.com/api/Aruppi/)
## **:handshake: Contributing**
- Fork it!
- Create your feature branch: `git checkout -b my-new-feature`
- Commit your changes: `git commit -am 'Add some feature'`
- Push to the branch: `git push origin my-new-feature`
- Submit a pull request
---
### **:busts_in_silhouette: Credits**
- [Darkangeel](https://github.com/Darkangeel-hd) (System administration authority (SYSADM))
- [Jéluchu](https://github.com/Jeluchu) (Android Developer, designer, and others)
---
### **:heart: Show your support**
Please :star: this repository if you like it or this project helped you!\
Feel free to open issues or submit pull-requests to help me improving my work.
---
### **📚 Projects that use the API**
<table>
<tr>
<td align="center">
<a href="https://aruppi.jeluchu.com/">
<img src="https://avatars2.githubusercontent.com/u/38753425?s=200&v=4" width="75px;" alt="Jeluchu"/><br />
<sub>
<b>Aruppi</b>
</sub>
</a><br/>
<sub>Anime y Manga</sub>
</a>
</td>
</tr>
</table>
### **:robot: Author**
_*Jéluchu*_
> You can follow me on
[github](https://github.com/Jeluchu)&nbsp;&middot;&nbsp;[twitter](https://twitter.com/Jeluchu)
---
Copyright © 2020 [Jéluchu](https://about.jeluchu.com/).

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 KiB

220
package-lock.json generated

@ -4,15 +4,60 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@sindresorhus/is": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.1.tgz",
"integrity": "sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg=="
},
"@szmarczak/http-timer": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz",
"integrity": "sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==",
"requires": {
"defer-to-connect": "^2.0.0"
}
},
"@types/cacheable-request": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz",
"integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==",
"requires": {
"@types/http-cache-semantics": "*",
"@types/keyv": "*",
"@types/node": "*",
"@types/responselike": "*"
}
},
"@types/debug": { "@types/debug": {
"version": "0.0.31", "version": "0.0.31",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-0.0.31.tgz", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-0.0.31.tgz",
"integrity": "sha512-LS1MCPaQKqspg7FvexuhmDbWUhE2yIJ+4AgVIyObfc06/UKZ8REgxGNjZc82wPLWmbeOm7S+gSsLgo75TanG4A==" "integrity": "sha512-LS1MCPaQKqspg7FvexuhmDbWUhE2yIJ+4AgVIyObfc06/UKZ8REgxGNjZc82wPLWmbeOm7S+gSsLgo75TanG4A=="
}, },
"@types/http-cache-semantics": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz",
"integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A=="
},
"@types/keyv": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz",
"integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==",
"requires": {
"@types/node": "*"
}
},
"@types/node": { "@types/node": {
"version": "14.0.10", "version": "14.0.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.10.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz",
"integrity": "sha512-Bz23oN/5bi0rniKT24ExLf4cK0JdvN3dH/3k0whYkdN4eI4vS2ZW/2ENNn2uxHCzWcbdHIa/GRuWQytfzCjRYw==" "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA=="
},
"@types/responselike": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz",
"integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==",
"requires": {
"@types/node": "*"
}
}, },
"accepts": { "accepts": {
"version": "1.3.7", "version": "1.3.7",
@ -128,6 +173,25 @@
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
}, },
"cacheable-lookup": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.3.tgz",
"integrity": "sha512-W+JBqF9SWe18A72XFzN/V/CULFzPm7sBXzzR6ekkE+3tLG72wFZrBiBZhrZuDoYexop4PHJVdFAKb/Nj9+tm9w=="
},
"cacheable-request": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.1.tgz",
"integrity": "sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw==",
"requires": {
"clone-response": "^1.0.2",
"get-stream": "^5.1.0",
"http-cache-semantics": "^4.0.0",
"keyv": "^4.0.0",
"lowercase-keys": "^2.0.0",
"normalize-url": "^4.1.0",
"responselike": "^2.0.0"
}
},
"camelize": { "camelize": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz",
@ -151,6 +215,14 @@
"parse5": "^3.0.1" "parse5": "^3.0.1"
} }
}, },
"clone-response": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
"integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=",
"requires": {
"mimic-response": "^1.0.0"
}
},
"cloudscraper": { "cloudscraper": {
"version": "4.6.0", "version": "4.6.0",
"resolved": "https://registry.npmjs.org/cloudscraper/-/cloudscraper-4.6.0.tgz", "resolved": "https://registry.npmjs.org/cloudscraper/-/cloudscraper-4.6.0.tgz",
@ -278,6 +350,26 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"decompress-response": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
"integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
"requires": {
"mimic-response": "^3.1.0"
},
"dependencies": {
"mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
}
}
},
"defer-to-connect": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz",
"integrity": "sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg=="
},
"delayed-stream": { "delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
@ -353,6 +445,14 @@
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
}, },
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"requires": {
"once": "^1.4.0"
}
},
"entities": { "entities": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
@ -514,6 +614,14 @@
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
}, },
"get-stream": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz",
"integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==",
"requires": {
"pump": "^3.0.0"
}
},
"getpass": { "getpass": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
@ -522,6 +630,25 @@
"assert-plus": "^1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"got": {
"version": "11.3.0",
"resolved": "https://registry.npmjs.org/got/-/got-11.3.0.tgz",
"integrity": "sha512-yi/kiZY2tNMtt5IfbfX8UL3hAZWb2gZruxYZ72AY28pU5p0TZjZdl0uRsuaFbnC0JopdUi3I+Mh1F3dPQ9Dh0Q==",
"requires": {
"@sindresorhus/is": "^2.1.1",
"@szmarczak/http-timer": "^4.0.5",
"@types/cacheable-request": "^6.0.1",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^5.0.3",
"cacheable-request": "^7.0.1",
"decompress-response": "^6.0.0",
"get-stream": "^5.1.0",
"http2-wrapper": "^1.0.0-beta.4.5",
"lowercase-keys": "^2.0.0",
"p-cancelable": "^2.0.0",
"responselike": "^2.0.0"
}
},
"har-schema": { "har-schema": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
@ -624,6 +751,11 @@
"readable-stream": "^3.1.1" "readable-stream": "^3.1.1"
} }
}, },
"http-cache-semantics": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
"integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ=="
},
"http-errors": { "http-errors": {
"version": "1.7.2", "version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
@ -646,6 +778,15 @@
"sshpk": "^1.7.0" "sshpk": "^1.7.0"
} }
}, },
"http2-wrapper": {
"version": "1.0.0-beta.4.6",
"resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.0-beta.4.6.tgz",
"integrity": "sha512-9oB4BiGDTI1FmIBlOF9OJ5hwJvcBEmPCqk/hy314Uhy2uq5TjekUZM8w8SPLLlUEM+mxNhXdPAXfrJN2Zbb/GQ==",
"requires": {
"quick-lru": "^5.0.0",
"resolve-alpn": "^1.0.0"
}
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -709,6 +850,11 @@
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
}, },
"json-buffer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
"integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="
},
"json-schema": { "json-schema": {
"version": "0.2.3", "version": "0.2.3",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
@ -735,11 +881,24 @@
"verror": "1.10.0" "verror": "1.10.0"
} }
}, },
"keyv": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.1.tgz",
"integrity": "sha512-xz6Jv6oNkbhrFCvCP7HQa8AaII8y8LRpoSm661NOKLr4uHuBwhX4epXrPQgF3+xdJnN4Esm5X0xwY4bOlALOtw==",
"requires": {
"json-buffer": "3.0.1"
}
},
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
}, },
"lowercase-keys": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
"integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
},
"media-typer": { "media-typer": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@ -773,6 +932,11 @@
"mime-db": "1.44.0" "mime-db": "1.44.0"
} }
}, },
"mimic-response": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -810,6 +974,11 @@
"nan": "^2.13.2" "nan": "^2.13.2"
} }
}, },
"normalize-url": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ=="
},
"nth-check": { "nth-check": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
@ -836,6 +1005,19 @@
"ee-first": "1.1.1" "ee-first": "1.1.1"
} }
}, },
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"p-cancelable": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.0.0.tgz",
"integrity": "sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg=="
},
"parse5": { "parse5": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz",
@ -873,6 +1055,15 @@
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
}, },
"pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"punycode": { "punycode": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
@ -883,6 +1074,11 @@
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
}, },
"quick-lru": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz",
"integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA=="
},
"range-parser": { "range-parser": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@ -967,6 +1163,19 @@
"lodash": "^4.17.15" "lodash": "^4.17.15"
} }
}, },
"resolve-alpn": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.0.0.tgz",
"integrity": "sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA=="
},
"responselike": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz",
"integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==",
"requires": {
"lowercase-keys": "^2.0.0"
}
},
"rss-to-json": { "rss-to-json": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/rss-to-json/-/rss-to-json-1.1.1.tgz", "resolved": "https://registry.npmjs.org/rss-to-json/-/rss-to-json-1.1.1.tgz",
@ -1157,6 +1366,11 @@
"extsprintf": "^1.2.0" "extsprintf": "^1.2.0"
} }
}, },
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"x-xss-protection": { "x-xss-protection": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz",

@ -30,8 +30,8 @@
} }
], ],
"engines": { "engines": {
"node": ">= 10.16.x", "node": ">= 12.17.x",
"npm": ">= 6.9.x" "npm": ">= 6.14.x"
}, },
"bugs": { "bugs": {
"url": "https://github.com/aruppi/aruppi-api/issues" "url": "https://github.com/aruppi/aruppi-api/issues"
@ -47,6 +47,7 @@
"compose-middleware": "^5.0.1", "compose-middleware": "^5.0.1",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.16.4", "express": "^4.16.4",
"got": "^11.3.0",
"helmet": "^3.22.0", "helmet": "^3.22.0",
"node-base64-image": "^2.0.1", "node-base64-image": "^2.0.1",
"request": "^2.88.2", "request": "^2.88.2",

@ -1,5 +1,5 @@
const rss = require('rss-to-json'); const rss = require('rss-to-json');
const cloudscraper = require('cloudscraper'); const html = require('got');
const { const {
animeflvInfo, animeflvInfo,
@ -10,17 +10,18 @@ const {
searchAnime, searchAnime,
transformUrlServer, transformUrlServer,
obtainPreviewNews, obtainPreviewNews,
structureThemes structureThemes,
getAnimes
} = require('../utils/index'); } = require('../utils/index');
const { const {
BASE_ANIMEFLV, BASE_ANIMEFLV_JELU, BASE_JIKAN, BASE_IVOOX, BASE_QWANT, BASE_YOUTUBE, BASE_THEMEMOE BASE_ANIMEFLV_JELU, BASE_JIKAN, BASE_IVOOX, BASE_QWANT, BASE_YOUTUBE, BASE_THEMEMOE
} = require('./urls'); } = require('./urls');
const schedule = async (day) =>{ const schedule = async (day) =>{
const data = await cloudscraper.get(`${BASE_JIKAN}schedule/${day.current}`); const data = await html(`${BASE_JIKAN}schedule/${day.current}`).json();
const body = JSON.parse(data)[day.current] const body = data[day.current];
const promises = [] const promises = []
body.map(doc =>{ body.map(doc =>{
@ -38,18 +39,15 @@ const schedule = async (day) =>{
}; };
const top = async (type, subtype, page) =>{ const top = async (type, subtype, page) =>{
const data = await html(`${BASE_JIKAN}top/${type}/${page}/${subtype}`).json();
const data = await cloudscraper.get(`${BASE_JIKAN}top/${type}/${page}/${subtype}`); return data.top;
return JSON.parse(data).top;
}; };
const getAllAnimes = async () =>{ const getAllAnimes = async () =>{
const data = await cloudscraper.get(`${BASE_ANIMEFLV}api/animes/list`); let data = await getAnimes()
const body = JSON.parse(data);
return body.map(item => ({ return data.map(item => ({
index: item[0], index: item[0],
animeId: item[3], animeId: item[3],
title: item[1], title: item[1],
@ -127,8 +125,8 @@ const getNews = async (pageRss) =>{
const season = async (year, type) =>{ const season = async (year, type) =>{
const data = await cloudscraper.get(`${BASE_JIKAN}season/${year}/${type}`); const data = await html(`${BASE_JIKAN}season/${year}/${type}`).json();
let body = JSON.parse(data).anime; let body = data.anime;
const promises = [] const promises = []
body.map(doc =>{ body.map(doc =>{
@ -147,8 +145,8 @@ const season = async (year, type) =>{
const getLastEpisodes = async () =>{ const getLastEpisodes = async () =>{
const data = await cloudscraper.get(`${BASE_ANIMEFLV_JELU}LatestEpisodesAdded`); const data = await html(`${BASE_ANIMEFLV_JELU}LatestEpisodesAdded`).json();
let body = JSON.parse(data).episodes; let body = data.episodes;
const promises = [] const promises = []
body.map(doc =>{ body.map(doc =>{
@ -168,8 +166,8 @@ const getLastEpisodes = async () =>{
const getSpecials = async (type, subType, page) =>{ const getSpecials = async (type, subType, page) =>{
const data = await cloudscraper.get(`${BASE_ANIMEFLV_JELU}${type.url}/${subType}/${page}`); const data = await html(`${BASE_ANIMEFLV_JELU}${type.url}/${subType}/${page}`).json();
let body = JSON.parse(data)[type.prop]; let body = data[type.prop];
const promises = [] const promises = []
body.map(doc =>{ body.map(doc =>{
@ -214,59 +212,10 @@ const getMoreInfo = async (title) =>{
) )
}); });
try{ try{
switch (animeType) { if (animeType === 'tv') {
promises.push(await animeflvInfo(animeId, animeIndex).then(async extra => ({
case "tv":
promises.push(await animeflvInfo(animeId, animeIndex).then(async extra => ({
title: animeTitle || null,
poster: await imageUrlToBase64(extra.animeExtraInfo[0].poster) || null,
synopsis: extra.animeExtraInfo[0].synopsis || null,
status: extra.animeExtraInfo[0].debut || null,
type: extra.animeExtraInfo[0].type || null,
rating: extra.animeExtraInfo[0].rating || null,
genres: extra.genres || null,
episodes: extra.listByEps || null,
moreInfo: await animeExtraInfo(title).then(info =>{
return info || null
}),
promo: await getAnimeVideoPromo(title).then(promo =>{
return promo || null
}),
characters: await getAnimeCharacters(animeTitle).then(characters =>{
return characters || null
})
})));
break;
case "movie":
promises.push(await animeflvInfo(animeId).then(async extra => ({
title: animeTitle || null,
poster: await imageUrlToBase64(extra.animeExtraInfo[0].poster) || null,
synopsis: extra.animeExtraInfo[0].synopsis || null,
status: extra.animeExtraInfo[0].debut || null,
type: extra.animeExtraInfo[0].type || null,
rating: extra.animeExtraInfo[0].rating || null,
genres: extra.genres || null,
episodes: extra.listByEps || null,
})));
break;
case "ova":
promises.push(await animeflvInfo(animeId).then(async extra => ({
title: animeTitle || null,
poster: await imageUrlToBase64(extra.animeExtraInfo[0].poster) || null,
synopsis: extra.animeExtraInfo[0].synopsis || null,
status: extra.animeExtraInfo[0].debut || null,
type: extra.animeExtraInfo[0].type || null,
rating: extra.animeExtraInfo[0].rating || null,
genres: extra.genres || null,
episodes: extra.listByEps || null,
})));
break;
default:
promises.push(await animeflvInfo(animeId).then(async extra => ({
title: animeTitle || null, title: animeTitle || null,
poster: await imageUrlToBase64(extra.animeExtraInfo[0].poster) || null, poster: await imageUrlToBase64(extra.animeExtraInfo[0].poster) || null,
synopsis: extra.animeExtraInfo[0].synopsis || null, synopsis: extra.animeExtraInfo[0].synopsis || null,
@ -275,7 +224,27 @@ const getMoreInfo = async (title) =>{
rating: extra.animeExtraInfo[0].rating || null, rating: extra.animeExtraInfo[0].rating || null,
genres: extra.genres || null, genres: extra.genres || null,
episodes: extra.listByEps || null, episodes: extra.listByEps || null,
moreInfo: await animeExtraInfo(title).then(info =>{
return info || null
}),
promo: await getAnimeVideoPromo(title).then(promo =>{
return promo || null
}),
characters: await getAnimeCharacters(animeTitle).then(characters =>{
return characters || null
})
}))); })));
} else {
promises.push(await animeflvInfo(animeId).then(async extra => ({
title: animeTitle || null,
poster: await imageUrlToBase64(extra.animeExtraInfo[0].poster) || null,
synopsis: extra.animeExtraInfo[0].synopsis || null,
status: extra.animeExtraInfo[0].debut || null,
type: extra.animeExtraInfo[0].type || null,
rating: extra.animeExtraInfo[0].rating || null,
genres: extra.genres || null,
episodes: extra.listByEps || null,
})));
} }
}catch(err){ }catch(err){
@ -288,8 +257,8 @@ const getMoreInfo = async (title) =>{
const getAnimeServers = async (id) => { const getAnimeServers = async (id) => {
const data = await cloudscraper.get(`${BASE_ANIMEFLV_JELU}GetAnimeServers/${id}`); const data = await html(`${BASE_ANIMEFLV_JELU}GetAnimeServers/${id}`).json();
let body = JSON.parse(data).servers; let body = data.servers;
return await transformUrlServer(body); return await transformUrlServer(body);
@ -299,8 +268,8 @@ const search = async (title) =>{ return await searchAnime(title); };
const getImages = async (query) => { const getImages = async (query) => {
const data = await cloudscraper.get(`${BASE_QWANT}count=${query.count}&q=${query.title}&t=${query.type}&safesearch=${query.safesearch}&locale=${query.country}&uiv=4`); const data = await html(`${BASE_QWANT}count=${query.count}&q=${query.title}&t=${query.type}&safesearch=${query.safesearch}&locale=${query.country}&uiv=4`).json();
const body = JSON.parse(data).data.result.items; const body = data.data.result.items;
const promises = [] const promises = []
body.map(doc =>{ body.map(doc =>{
@ -319,8 +288,8 @@ const getImages = async (query) => {
const getYoutubeVideos = async (channelId) => { const getYoutubeVideos = async (channelId) => {
const data = await cloudscraper.get(`${BASE_YOUTUBE}${channelId.id}&part=${channelId.part}&order=${channelId.order}&maxResults=${channelId.maxResults}`); const data = await html(`${BASE_YOUTUBE}${channelId.id}&part=${channelId.part}&order=${channelId.order}&maxResults=${channelId.maxResults}`).json();
const body = JSON.parse(data)[channelId.prop]; const body = data[channelId.prop];
const promises = [] const promises = []
body.map(doc =>{ body.map(doc =>{
@ -344,12 +313,8 @@ const getRadioStations = async () => {
} }
const getOpAndEd = async (title) => { const getOpAndEd = async (title) => {
const data = await html(`${BASE_THEMEMOE}anime/search/${title}`).json();
const data = await cloudscraper.get(`${BASE_THEMEMOE}anime/search/${title}`); return await structureThemes(data, true, 0)
const body = JSON.parse(data);
return await structureThemes(body, true, 0)
}; };
const getThemesSeason = async (year, season) => { const getThemesSeason = async (year, season) => {
@ -357,37 +322,29 @@ const getThemesSeason = async (year, season) => {
let data let data
if (season === undefined) { if (season === undefined) {
data = await cloudscraper.get(`${BASE_THEMEMOE}seasons/${year}`); data = await html(`${BASE_THEMEMOE}seasons/${year}`).json();
} else { } else {
data = await cloudscraper.get(`${BASE_THEMEMOE}seasons/${year}/${season}`); data = await html(`${BASE_THEMEMOE}seasons/${year}/${season}`).json();
} }
const body = JSON.parse(data);
return await structureThemes(body, false, 0) return await structureThemes(data, false, 0)
}; };
const getRandomTheme = async () => { const getRandomTheme = async () => {
const data = await html(`${BASE_THEMEMOE}roulette`).json();
const data = await cloudscraper.get(`${BASE_THEMEMOE}roulette`); return await structureThemes(data, true)
const body = JSON.parse(data);
return await structureThemes(body, true)
}; };
const getArtist = async (id) => { const getArtist = async (id) => {
let data let data
let body
let promises = [] let promises = []
if (id === undefined) { if (id === undefined) {
data = await cloudscraper.get(`${BASE_THEMEMOE}artists`); data = await html(`${BASE_THEMEMOE}artists`).json();
body = JSON.parse(data); data.map(doc => {
body.map(doc => {
promises.push({ promises.push({
id: doc.artistID, id: doc.artistID,
@ -399,11 +356,8 @@ const getArtist = async (id) => {
return promises; return promises;
} else { } else {
data = await html(`${BASE_THEMEMOE}artists/${id}`).json();
data = await cloudscraper.get(`${BASE_THEMEMOE}artists/${id}`); return await structureThemes(data, false, 1)
body = JSON.parse(data);
return await structureThemes(body, false, 1)
} }
}; };

@ -10,9 +10,13 @@ router.get('/schedule/:day' , (req, res) =>{
api.schedule(day) api.schedule(day)
.then(day =>{ .then(day =>{
res.status(200).json({ if (day.length > 0) {
day res.status(200).json({
}); day
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -27,9 +31,13 @@ router.get('/top/:type/:subtype/:page' , (req, res) =>{
api.top(type, subtype, page) api.top(type, subtype, page)
.then(top =>{ .then(top =>{
res.status(200).json({ if (top.length > 0) {
top res.status(200).json({
}); top
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -40,9 +48,13 @@ router.get('/allAnimes' , (req, res) =>{
api.getAllAnimes() api.getAllAnimes()
.then(animes =>{ .then(animes =>{
res.status(200).json({ if (animes.length > 0) {
animes res.status(200).json({
}); animes
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -53,9 +65,13 @@ router.get('/anitakume' , (req, res) =>{
api.getAnitakume() api.getAnitakume()
.then(podcast =>{ .then(podcast =>{
res.status(200).json({ if (podcast.length > 0) {
podcast res.status(200).json({
}); podcast
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -73,9 +89,13 @@ router.get('/news' , (req, res) =>{
api.getNews(pagesRss) api.getNews(pagesRss)
.then(news =>{ .then(news =>{
res.status(200).json({ if (news.length > 0) {
news res.status(200).json({
}); news
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -89,9 +109,13 @@ router.get('/season/:year/:type' , (req, res) =>{
api.season(year, type) api.season(year, type)
.then(season =>{ .then(season =>{
res.status(200).json({ if (season.length > 0) {
season res.status(200).json({
}); season
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -102,9 +126,13 @@ router.get('/lastEpisodes' , (req, res) =>{
api.getLastEpisodes() api.getLastEpisodes()
.then(episodes =>{ .then(episodes =>{
res.status(200).json({ if (episodes.length > 0) {
episodes res.status(200).json({
}); episodes
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -119,9 +147,13 @@ router.get('/movies/:type/:page' , (req, res) =>{
api.getSpecials(type, subType, page) api.getSpecials(type, subType, page)
.then(movies =>{ .then(movies =>{
res.status(200).json({ if (movies.length > 0) {
movies res.status(200).json({
}); movies
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -136,9 +168,13 @@ router.get('/ovas/:type/:page' , (req, res) =>{
api.getSpecials(type, subType, page) api.getSpecials(type, subType, page)
.then(ovas =>{ .then(ovas =>{
res.status(200).json({ if (ovas.length > 0) {
ovas res.status(200).json({
}); ovas
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -153,9 +189,13 @@ router.get('/specials/:type/:page' , (req, res) =>{
api.getSpecials(type, subType, page) api.getSpecials(type, subType, page)
.then(specials =>{ .then(specials =>{
res.status(200).json({ if (specials.length > 0) {
specials res.status(200).json({
}); specials
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -170,9 +210,13 @@ router.get('/tv/:type/:page' , (req, res) =>{
api.getSpecials(type, subType, page) api.getSpecials(type, subType, page)
.then(tv =>{ .then(tv =>{
res.status(200).json({ if (tv.length > 0) {
tv res.status(200).json({
}); tv
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -190,7 +234,7 @@ router.get('/moreInfo/:title' , (req, res) =>{
info info
}); });
} else ( } else (
res.status(404).json({ message: 'Aruppi lost in the shell'}) res.status(500).json({ message: 'Aruppi lost in the shell'})
) )
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
@ -204,9 +248,13 @@ router.get('/getAnimeServers/:id([^/]+/[^/]+)' , (req, res) =>{
api.getAnimeServers(id) api.getAnimeServers(id)
.then(servers =>{ .then(servers =>{
res.status(200).json({ if (servers.length > 0) {
servers res.status(200).json({
}); servers
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -219,9 +267,13 @@ router.get('/search/:title' , (req, res) =>{
api.search(title) api.search(title)
.then(search =>{ .then(search =>{
res.status(200).json({ if (search.length > 0) {
search res.status(200).json({
}); search
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -234,9 +286,13 @@ router.get('/images/:query' , (req, res) =>{
api.getImages(query) api.getImages(query)
.then(images =>{ .then(images =>{
res.status(200).json({ if (images.length > 0) {
images res.status(200).json({
}); images
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -249,9 +305,13 @@ router.get('/videos/:channelId' , (req, res) =>{
api.getYoutubeVideos(channelId) api.getYoutubeVideos(channelId)
.then(videos =>{ .then(videos =>{
res.status(200).json({ if (videos.length > 0) {
videos res.status(200).json({
}); videos
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -262,9 +322,13 @@ router.get('/radio' , (req, res) =>{
api.getRadioStations() api.getRadioStations()
.then(stations =>{ .then(stations =>{
res.status(200).json({ if (stations.length > 0) {
stations res.status(200).json({
}); stations
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -277,9 +341,13 @@ router.get('/themes/:title' , (req, res) =>{
api.getOpAndEd(title) api.getOpAndEd(title)
.then(themes =>{ .then(themes =>{
res.status(200).json({ if (themes.length > 0) {
themes res.status(200).json({
}); themes
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -293,9 +361,13 @@ router.get('/themeSeason/:year/:season?', (req, res) =>{
api.getThemesSeason(year, season) api.getThemesSeason(year, season)
.then(themes =>{ .then(themes =>{
res.status(200).json({ if (themes.length > 0) {
themes res.status(200).json({
}); themes
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -306,9 +378,13 @@ router.get('/randomTheme', (req, res) =>{
api.getRandomTheme() api.getRandomTheme()
.then(random =>{ .then(random =>{
res.status(200).json({ if (random.length > 0) {
random res.status(200).json({
}); random
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -321,9 +397,13 @@ router.get('/artists/:id?', (req, res) =>{
api.getArtist(id) api.getArtist(id)
.then(artists =>{ .then(artists =>{
res.status(200).json({ if (artists.length > 0) {
artists res.status(200).json({
}); artists
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });

@ -15,6 +15,10 @@ app.use(bodyParser.urlencoded({ extended: false }));
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.redirect('/api/')
});
app.get('/api/', (req, res) => {
res.json({ res.json({
message: 'Tu~tu~ruuu! You have traveled to the API Black Hole' message: 'Tu~tu~ruuu! You have traveled to the API Black Hole'
}); });

@ -1,6 +1,7 @@
const cloudscraper = require('cloudscraper') const cloudscraper = require('cloudscraper')
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const base64 = require('node-base64-image'); const base64 = require('node-base64-image');
const html = require('got');
const { const {
BASE_ANIMEFLV, BASE_JIKAN, BASE_EPISODE_IMG_URL, SEARCH_URL, BASE_ARUPPI, BASE_THEMEMOE BASE_ANIMEFLV, BASE_JIKAN, BASE_EPISODE_IMG_URL, SEARCH_URL, BASE_ARUPPI, BASE_THEMEMOE
@ -15,12 +16,19 @@ const animeflvInfo = async (id, index) => {
let debut = "" let debut = ""
let type = "" let type = ""
let res
let $
try { try {
const res = await cloudscraper(`${BASE_ANIMEFLV}anime/${id}`); try {
const body = await res; res = await html(`${BASE_ANIMEFLV}anime/${id}`);
$ = await cheerio.load(res.body);
} catch (error) {
res = await cloudscraper.get(`${BASE_ANIMEFLV}anime/${id}`);
$ = await cheerio.load(res)
}
const $ = await cheerio.load(body);
const scripts = $('script'); const scripts = $('script');
const anime_info_ids = []; const anime_info_ids = [];
const anime_eps_data = []; const anime_eps_data = [];
@ -109,15 +117,14 @@ const animeflvInfo = async (id, index) => {
}; };
const getAnimeCharacters = async (title) => { const getAnimeCharacters = async (title) => {
const res = await cloudscraper(`${BASE_JIKAN}search/anime?q=${title}`); const res = await html(`${BASE_JIKAN}search/anime?q=${title}`).json();
const matchAnime = JSON.parse(res).results.filter(x => x.title === title); const matchAnime = res.results.filter(x => x.title === title);
const malId = matchAnime[0].mal_id; const malId = matchAnime[0].mal_id;
if (typeof matchAnime[0].mal_id === 'undefined') return null; if (typeof matchAnime[0].mal_id === 'undefined') return null;
const jikanCharactersURL = `${BASE_JIKAN}anime/${malId}/characters_staff`; const data = await html(`${BASE_JIKAN}anime/${malId}/characters_staff`).json();
const data = await cloudscraper.get(jikanCharactersURL); let body = data.characters;
let body = JSON.parse(data).characters;
if (typeof body === 'undefined') return null; if (typeof body === 'undefined') return null;
@ -147,15 +154,14 @@ const getAnimeCharacters = async (title) => {
}; };
const getAnimeVideoPromo = async (title) => { const getAnimeVideoPromo = async (title) => {
const res = await cloudscraper(`${BASE_JIKAN}search/anime?q=${title}`); const res = await html(`${BASE_JIKAN}search/anime?q=${title}`).json();
const matchAnime = JSON.parse(res).results.filter(x => x.title === title); const matchAnime = res.results.filter(x => x.title === title);
const malId = matchAnime[0].mal_id; const malId = matchAnime[0].mal_id;
if (typeof matchAnime[0].mal_id === 'undefined') return null; if (typeof matchAnime[0].mal_id === 'undefined') return null;
const jikanCharactersURL = `${BASE_JIKAN}anime/${malId}/videos`; const data = await html(`${BASE_JIKAN}anime/${malId}/videos`).json();
const data = await cloudscraper.get(jikanCharactersURL); const body = data.promo;
const body = JSON.parse(data).promo;
const promises = []; const promises = [];
body.map(doc => { body.map(doc => {
@ -170,67 +176,35 @@ const getAnimeVideoPromo = async (title) => {
}; };
const animeExtraInfo = async (title) => { const animeExtraInfo = async (title) => {
const res = await cloudscraper(`${BASE_JIKAN}search/anime?q=${title}`); const res = await html(`${BASE_JIKAN}search/anime?q=${title}`).json();
const matchAnime = JSON.parse(res).results.filter(x => x.title === title); const matchAnime = res.results.filter(x => x.title === title);
const malId = matchAnime[0].mal_id; const malId = matchAnime[0].mal_id;
if (typeof matchAnime[0].mal_id === 'undefined') return null; if (typeof matchAnime[0].mal_id === 'undefined') return null;
const animeDetails = `${BASE_JIKAN}anime/${malId}`; const data = await html(`${BASE_JIKAN}anime/${malId}`).json();
const data = await cloudscraper.get(animeDetails); const body = Array(data);
const body = Array(JSON.parse(data));
const promises = []; const promises = [];
body.map(doc => { body.map(doc => {
let airDay let airDay = {
'mondays': 'Lunes',
switch (doc.broadcast.split('at')[0].replace(" ", "").toLowerCase()) { 'monday': 'Lunes',
case "mondays": 'tuesdays': 'Martes',
airDay = "Lunes"; 'tuesday': 'Martes',
break; 'wednesdays': 'Miércoles',
case "monday": 'wednesday': 'Miércoles',
airDay = "Lunes"; 'thursdays': 'Jueves',
break; 'thursday': 'Jueves',
case "tuesdays": 'fridays': 'Viernes',
airDay = "Martes"; 'friday': 'Viernes',
break; 'saturdays': 'Sábados',
case "tuesday": 'saturday': 'Sábados',
airDay = "Martes"; 'sundays': 'Domingos',
break; 'sunday': 'Domingos',
case "wednesdays": 'default': 'Sin emisión'
airDay = "Miércoles"; };
break;
case "wednesday":
airDay = "Miércoles";
break;
case "thursdays":
airDay = "Jueves";
break;
case "thursday":
airDay = "Jueves";
break;
case "fridays":
airDay = "Viernes";
break;
case "friday":
airDay = "Viernes";
break;
case "saturdays":
airDay = "Sábados";
break;
case "saturday":
airDay = "Sábados";
break;
case "sundays":
airDay = "Domingos";
break;
case "sunday":
airDay = "Domingos";
break;
default:
airDay = "Sin emisión";
}
promises.push({ promises.push({
titleJapanese: doc.title_japanese, titleJapanese: doc.title_japanese,
@ -240,9 +214,9 @@ const animeExtraInfo = async (title) => {
from: doc.aired.from, from: doc.aired.from,
to: doc.aired.to to: doc.aired.to
}, },
duration: doc.duration.split('per')[0].replace(" ", ""), duration: doc.duration.split('per')[0],
rank: doc.rank, rank: doc.rank,
broadcast: airDay, broadcast: airDay[doc.broadcast.split('at')[0].replace(" ", "").toLowerCase()],
producers: doc.producers.map(x => x.name) || null, producers: doc.producers.map(x => x.name) || null,
licensors: doc.licensors.map(x => x.name) || null, licensors: doc.licensors.map(x => x.name) || null,
studios: doc.studios.map(x => x.name) || null, studios: doc.studios.map(x => x.name) || null,
@ -257,15 +231,21 @@ const imageUrlToBase64 = async (url) => {
return await base64.encode(url, {string: true}); return await base64.encode(url, {string: true});
}; };
const search = async () => { const search = async () => {}
}
const searchAnime = async (query) => { const searchAnime = async (query) => {
const res = await cloudscraper(`${SEARCH_URL}${query}`); let res
const body = await res; let $
const $ = await cheerio.load(body); let promises = []
const promises = [];
try {
res = await html(`${SEARCH_URL}${query}`);
$ = await cheerio.load(res.body);
} catch (error) {
res = await cloudscraper.get(`${SEARCH_URL}${query}`);
$ = await cheerio.load(res)
}
$('div.Container ul.ListAnimes li article').each((index, element) => { $('div.Container ul.ListAnimes li article').each((index, element) => {
const $element = $(element); const $element = $(element);
@ -274,7 +254,7 @@ const searchAnime = async (query) => {
let poster = $element.find('a div.Image figure img').attr('src') || $element.find('a div.Image figure img').attr('data-cfsrc'); let poster = $element.find('a div.Image figure img').attr('src') || $element.find('a div.Image figure img').attr('data-cfsrc');
const type = $element.find('div.Description p span.Type').text(); const type = $element.find('div.Description p span.Type').text();
promises.push(search().then(async extra => ({ promises.push(search().then(async () => ({
id: id || null, id: id || null,
title: title || null, title: title || null,
type: type || null, type: type || null,
@ -290,21 +270,18 @@ const searchAnime = async (query) => {
const transformUrlServer = async (urlReal) => { const transformUrlServer = async (urlReal) => {
let res let res
let body
const promises = [] const promises = []
for (i = 0; i <= urlReal.length - 1; i++) { for (i = 0; i <= urlReal.length - 1; i++) {
switch (urlReal[i].server) { switch (urlReal[i].server) {
case "amus": case "amus":
res = await cloudscraper(urlReal[i].code.replace("embed", "check")); res = await html(urlReal[i].code.replace("embed", "check")).json();
body = await res; urlReal[i].code = res.file
urlReal[i].code = JSON.parse(body).file
urlReal[i].direct = true urlReal[i].direct = true
break; break;
case "natsuki": case "natsuki":
res = await cloudscraper(urlReal[i].code.replace("embed", "check")); res = await html(urlReal[i].code.replace("embed", "check")).json();
body = await res; urlReal[i].code = res.file
urlReal[i].code = JSON.parse(body).file
urlReal[i].direct = true urlReal[i].direct = true
break; break;
default: default:
@ -357,21 +334,20 @@ const structureThemes = async (body, indv, task) => {
const promises = [] const promises = []
let themes let themes
let respFinal let data
if (task === 0) { if (task === 0) {
for (let i = 0; i <= body.length - 1; i++) { for (let i = 0; i <= body.length - 1; i++) {
if (indv === true) { if (indv === true) {
const data = await cloudscraper.get(`${BASE_THEMEMOE}themes/${body[i]}`); data = await html(`${BASE_THEMEMOE}themes/${body[i]}`).json();
respFinal = JSON.parse(data) themes = await getThemes(data[0].themes)
themes = await getThemes(respFinal[0].themes)
} else { } else {
respFinal = body data = body
themes = await getThemes(body[0].themes) themes = await getThemes(body[0].themes)
} }
respFinal.map(doc => { data.map(doc => {
promises.push({ promises.push({
title: doc.name, title: doc.name,
@ -383,25 +359,26 @@ const structureThemes = async (body, indv, task) => {
}); });
} }
} else if (task === 1) { } else if (task === 1) {
respFinal = body
themes = await getHeaderTheme(respFinal.themes) data = body
themes = await getHeaderTheme(data.themes)
promises.push({ promises.push({
title: respFinal.artistName, title: data.artistName,
season: respFinal.season, season: data.season,
year: respFinal.year, year: data.year,
series: themes, series: themes,
}); });
} else { } else {
respFinal = body data = body
themes = await getThemes(respFinal.themes) themes = await getThemes(data.themes)
promises.push({ promises.push({
title: respFinal.name, title: data.name,
season: respFinal.season, season: data.season,
year: respFinal.year, year: data.year,
themes: themes, themes: themes,
}); });
@ -451,6 +428,22 @@ const getThemes = async (themes) => {
}; };
const getAnimes = async () => {
let res
let data
try {
data = await html(`${BASE_ANIMEFLV}api/animes/list`).json();
} catch (error) {
res = await cloudscraper.get(`${BASE_ANIMEFLV}api/animes/list`);
data = JSON.parse(res);
}
return data;
};
module.exports = { module.exports = {
animeflvInfo, animeflvInfo,
getAnimeCharacters, getAnimeCharacters,
@ -461,5 +454,6 @@ module.exports = {
transformUrlServer, transformUrlServer,
obtainPreviewNews, obtainPreviewNews,
structureThemes, structureThemes,
getThemes getThemes,
getAnimes
} }

Loading…
Cancel
Save