nateshmbhat / pyYify

This is a python library used to get the Top seeded torrents at any given time and get the entire movie details and ratings . Its also useful to search for any movie using different parameters and obtain their magnet link or torrent file of any preferred quality.
MIT License
58 stars 19 forks source link
movie-collection python-torrent python-yify torrent torrent-management yify yify-torrents yifysubtitles

Yify for Python

Downloads Downloads

This is Python Library which is used to get the Top seeded torrents at any given time and get the entire movie details and ratings .

Its also useful to search for any movie using different parameters and obtain their magnet link or torrent file of any preferred quality.

Features :

All the above Details are obtained in the form of attributes of Yify.movie object each object representing a movie.

Installation :

Python3

pip install pyYify

or

pip3 install pyYify

Usage :

First import yify to use its functions.

from pyYify import yify

There are two classes in yify namely 'movie' and 'torrent'.

Search for movies.

On searching , it returns a list of movies (movie objects).

movies_list = yify.search_movies(search_string , quality , minimum_rating , genre)

The search_string for the movie can be 'Movie Title,IMDb Code, Actor Name, Director Name'. quality = 'All' , '720p' , '1080p' , '3D'. minimum_rating is an imdb_rating. genre = See https://www.imdb.com/genre/ for a list of genres.

Get the top seeded movies from Yify

movies_list  = yify.get_top_seeded_torrents() ;

Returns a list of movies, each movie object only contains its Name and Webpage unlike the searching method which has all the details in the returned movies. To get the rest of the movie details use getinfo() method.

for movie in movies_list:
    movie.getinfo() ;

The movie.torrents is a list of torrents each of which corresponds to the torrent of same movie but of different quality. ('720p' , '1080p' or '3D' )

movie1 = movies_list[0] 

torrent1 = movie1.torrents[0]

print("Magnet link = " , torrent1.magnet)

Downloading the Torrent file of a movie

torrent1.download_torrent_file( savepath , filename )

Starting the download directly using magnet link without downloading the torrent file .

This starts the default torrent client prompting the download dialog :

torrent1.start_download()