Socket
Socket
Sign inDemoInstall

yts

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 2.0.0

.eslintrc.js

45

package.json
{
"name": "yts",
"version": "1.0.0",
"description": "a simple wrapper for the yts.re API",
"main": "lib/yts.js",
"version": "2.0.0",
"description": "Node.js promise-based library for interacting with the YTS YIFY movies API.",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jest",
"lint": "eslint **/*.js",
"lint:fix": "eslint --fix **/*.js"
},
"author": "Toota Toota",
"license": "MIT",
"dependencies": {
"request": "^2.53.0"
},
"directories": {
"example": "example"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/toota-toota/yts.git"
},
"keywords": [
"yts",
"yts.re",
"torrents",
"movies",
"torrent",
"rest",
"api",
"wrapper"
"YIFY",
"YTS"
],
"bugs": {
"url": "https://github.com/toota-toota/yts/issues"
"author": "Travis Horn (https://travishorn.com)",
"license": "MIT",
"devDependencies": {
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.1",
"jest": "^26.6.3",
"prettier": "^2.2.1"
},
"homepage": "https://github.com/toota-toota/yts"
"dependencies": {
"axios": "^0.21.1"
}
}

@@ -1,33 +0,193 @@

#yts
A node wrapper module for the [yts.re](http://yts.re) [API]
# YTS
##Installing
```javascript
npm install yts
Node.js promise-based library for interacting with the YTS YIFY movies API.
## Installation
Install via npm.
```
npm i yts
```
-------
Require yts in your project.
```
const yts = require("yts");
```
## Usage
### List movies
List the 20 most recently added movies.
```
const main = async () => {
const res = await yts.listMovies();
}
```
The result will look like this:
```
{
"movie_count": 25489,
"limit": 20,
"page_number": 1,
"movies": [
{
"id": 00000,
"url": "yts.mx URL",
"imdb_code": "tt0000000",
"title": "Movie Title",
"title_english": "Movie Title in English",
"title_long": "Movie Title (2021)",
"slug": "movie-title-2021",
"year": 2021,
"rating": 0,
"runtime": 0,
"genres": [
"Array of genre strings"
],
"summary": "Movie summary",
"description_full": "Movie description",
"synopsis": "Movie synopsis",
"yt_trailer_code": "YouTube video ID for trailer",
"language": "en",
"mpa_rating": "",
"background_image": "yts.mx URL for background image JPG",
"background_image_original": "yts.mx URL for background image JPG",
"small_cover_image": "yts.mx URL for cover image JPG",
"medium_cover_image": "yts.mx URL for cover image JPG",
"large_cover_image": "yts.mx URL for cover image JPG",
"state": "ok",
"torrents": [
{
"url": "yts.mx torrent URL",
"hash": "torrent hash",
"quality": "720p",
"type": "web",
"seeds": 0,
"peers": 0,
"size": "1.00 MB",
"size_bytes": 1000000,
"date_uploaded": "2021-01-14 13:29:52",
"date_uploaded_unix": 1610627392,
"magnet_url: "magnet:url for torrent"
},{
// Possibly more torrent files for various qualities
}
],
"date_uploaded": "2021-01-14 13:29:52",
"date_uploaded_unix": 1610627392
},
{
// More movies
}
]
}
```
#### Narrow the list with parameters
```
const main = async () => {
const res = await yts.listMovies({ limit: 10, query_term: "Avengers" });
}
```
There are other parameters to use with `listMovies()`. Full documentation can be found at https://yts.mx/api#list_movies
### Get movie details
First get the movie's YTS ID. You might get this from `listMovies()`. Then call `movieDetails()`.
```
const main = async () => {
const res = await yts.movieDetails({ movie_id: 0000 });
}
```
The result will look like this:
```
{
"movie": {
"id": 0000,
"url": "yts.mx URL",
"imdb_code": "tt0000000",
"title": "Movie Title",
"title_english": "Movie Title in English",
"title_long": "Movie Title (2021)",
"slug": "movie-title-2021",
"year": 2021,
"rating": 0,
"runtime": 0,
"genres": [
"Array of genre strings"
],
"download_count": 0,
"like_count": 0,
"description_intro": "First part of description",
"description_full": "Full description of movie",
"yt_trailer_code": "YouTube video ID for trailer",
"language": "en",
"mpa_rating": "",
"background_image": "yts.mx JPG URL",
"background_image_original": "yts.mx JPG URL",
"small_cover_image": "yts.mx JPG URL",
"medium_cover_image": "yts.mx JPG URL",
"large_cover_image": "yts.mx JPG URL",
"torrents": [
{
"url": "yts.mx torrent URL",
"hash": "torrent hash",
"quality": "720p",
"type": "web",
"seeds": 0,
"peers": 0,
"size": "1.00 MB",
"size_bytes": 1000000,
"date_uploaded": "2021-01-14 13:29:52",
"date_uploaded_unix": 1610627392,
"magnet_url: "magnet:url for torrent"
},
{
// Possibly more torrent files for various qualities
},
],
"date_uploaded": "2021-01-14 13:29:52",
"date_uploaded_unix": 1610627392
}
}
```
## Tests
Full tests are available for this library and the YTS API.
```
npm test
```
Note that this will invoke quite a few simultaneous HTTP requests to the YTS API.
## To Do
- Comments, parental guides, reviews, upcoming movie list, and user details: These features are described in the YTS API documentation. However, they either return 404s or messages stating that they will be reublished soon.
- Getting a user key (logging a user in), registering user, issuing forgot password email, resetting a password: These features require an application key which is only provided by contacting them
- Getting a user profile: requires a user key which is only available by using the API to get a user key (see bullet point above)
- Editing user settings, liking a movie, adding/getting/deleting bookmarks, making/liking/reporting/deleting comments, and making requests: These features require an application key and a user key
## License
(The MIT License)
The MIT License
Copyright (c) by Toota Toota <dontbother@interwebz>
Copyright 2021 Travis Horn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc