what is yts?.

YTS is a python package that allows you to download HD movie torrents from web.It is also a python binding for the official movie torrents https://yts.re.

from yts import YTS y = YTS() y.torrents() # view all latest torrents y.download( 6581 ) #Downloads the movie torrent with movieID and adds it to your default torrent client

See how simple it is to download a movie within seconds.

Installation

You can install yts with a single pip command else download and run ./setup.py install from zip extracted.

$ sudo pip install yts C:> pip install yts

Features

Download movies with a single method

Download latest torrents

Search and download torrents

Query the information of interested movie

Chose movies with quality,ratings,name,date added etc.

Redirect torrent to your favorite torrent client

100% magnets authenticity

API

The main classes in the yts library are

YTS

Movie

YTS

YTS is a class that deals with listing of latest,upcoming,requested torrents from official yify website.It also provides methods for:

Searching movie torrent

Logging in to https://yts.re

comment upon a movie torrent

Get all confirmed request torrents list

class YTS(username=None,password=None)

YTS class can be instantiated with username,password of yify website.arguments are optional.Some functions like post comment,etc will only work if you are logged in.

torrents(self,limit=20,page=1,quality='ALL',rating=0,genre='ALL',sort='date')

torrents method lists the torrents to download.select movieID from that listing to download movie torrent on flash.Default display is 20 recently uploaded movies.optional parameters are:

limit (1-50) : specify limit of torrents displayed for a page

page (default 1): page no or step.If page=2 then next 20 results will be displayed.

quality ('720p' or '1080p'): select only movies with specified quality

genre ('comedy','action' etc): select movies only from specified genres

sort ('date','seeds' etc): factor on which sorting should occur

download(movieId)

Downloads the movie torrent whose movieID is specified.movieID is observed from listed torrents

Ex:

y = YTS() y.download( 466 ) #466 is ID of movie

login(username,password)

login method takes username and password for https://yts.re.It is essential if user needs to post comments on a movie torrent.

Ex:

y = YTS() y.login( ' example_uname ' , ' example_pwd ' )

search(movie)

search method lists all torrents consisting movie name passed as argument.

Ex:

y = YTS() y.search( ' matrix ' ) #lists all movies with matrix in their title

upcoming()

upcoming method lists all torrents those are ready to be uploaded by uploaders.

Ex:

y = YTS() y.upload()

requests_confirmed()

This method lists all confirmed movie requests in the format of {User:Movie Name}.

Ex:

y = YTS() y.requests_confirmed()

request(movieName)

You should log in first to access the method.This method submits your movieName to yify for consideration.

Ex:

y = YTS() y.request( ' django unchained ' ) #submits request to upload Django Unchained movie

fails if not logged in

comment(movieID,text)

You should log in first to access the method.This method selects movie torrent specified and apply text as comment to it.

Ex:

y = YTS() y.comment( 466 , ' Awesome! ' ) #comments as Awesome! for The Matrix Reloaded

fails if not logged in

Movie

Movie is a class that deals with all the attributes of a movie that available as a torrent to download.First you can check the things like,must be initialized with a movieID

movie details summary

no of seeds

IMDB link

YouTube official trailer

Cast

Genres

Description

movie()

Displays the summary of the movie.

Ex:

from yts import Movie m = Movie( 466 ) m.movie() #summary of The Matrix reloaded

imdb()

Opens IMDB link of movie in browser to explore details

Ex:

m = Movie( 466 ) m.imdb()

trailer()

Opens official YouTube trailer of the movie in browser

Ex:

m = Movie( 466 ) m.trailer()

cast()

Displays cast and their roles in the movie.

Ex:

m = Movie( 466 ) m.cast()

seeds()

Returns no of seeds available for a movie ,which tells the probable speed of downloading

Ex:

m = Movie( 466 ) print m.seeds()

genres()

Returns genres to which movie belongs to

Ex:

m = Movie( 466 ) print m.genres()

description()

Returns the description of movie in a brief manner

Ex:

m = Movie( 466 ) m.description()

download()

Each movie instance has a download method by which we can download the torrent and add it to torrent client.It is almost similar to download method of YTS.

Ex:

m = Movie( 466 ) m.download() #Downloads movie torrent for you and adds it to client

In order to get movieIDs we need to list all torrents by applying filters and chose favorite one.Then by observing that movieID we need to create an instance of message and access information about it.

Raw Data

You can also get many other details for movies and yify movie torrents using raw methods on the YTS and Movie classes. A dictionary with all details will be returned,you can use that in your applications.remember raw methods are faster than high level methods.Because of this methods yts python downloader is also a python binding for YIFY API.

YTS

raw_torrents() raw_latest() raw_upcoming() raw_search() raw_requests_confirmed()

All arguments are similar to the native methods above.

Movie

raw_movie()

Author

yts is created by Naren Arya @ https://github.com/narenaryan a programmer,a blogger and an absolutely funny guy.

Source & Contribute

yts project is open for contribution.For contributing visit https://github.com/narenaryan/yts

Support or Contact

Having trouble with API? mail me at narenarya@live.com. Checkout the API and experiment with it.