Git Product home page Git Product logo

nateshmbhat / pyyify Goto Github PK

View Code? Open in Web Editor NEW
58.0 4.0 19.0 42 KB

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.

License: MIT License

Python 100.00%
torrent yify python-torrent yify-torrents yifysubtitles python-yify movie-collection torrent-management

pyyify's Introduction

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 :

  • Search for movie torrents

  • Get the details of any movie which includes :

    • Torrent details of 720p,1080p,3D quality
    • Torrent Magnet links and hashes along with their size and seeds
    • imdb_code
    • Imdb Rating and MPA rating
    • Year
    • Runtime
    • Summary
    • Movie Description

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

  • Get the Top Most Seeded Torrents listed in the Yify Website

  • Download the torrent file of a corresponding torrent.

  • Start the torrent download directly without having to download it from the user's default torrent client.

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() ;
  • Each movie Object has the following data :

    • id
    • url
    • imdb_code
    • title
    • title_long
    • slug
    • year
    • rating
    • runtime
    • genres
    • summary
    • description
    • language
    • mpa_rating
    • image_links
    • torrents

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' )

  • Each torrent has the following data :

    • name
    • url
    • magnet
    • hash
    • quality
    • seeds
    • peers
    • size
    • date_uploaded
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()

pyyify's People

Contributors

nateshmbhat avatar r12habh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyyify's Issues

Typo: download

The function start download has a typo in the code: in "yify.py" is written "start_downlod"

how do i use download ???

i have a magnet link from which I wanna download the movie and when I try that it shows error then I found the file has a typo but still no result if someone has done this please add code example Thanks.

Cannot install: "Could not find a version that satisfies the requirement urllib"

When trying to install pyYify via pip, I get:

Collecting pyYify
  Using cached https://files.pythonhosted.org/packages/33/0e/e315e9d156abf4ed522c74ca003c753ac7337be1422e9bf750b728bf5135/pyYify-1.9.1-py3-none-any.whl
Collecting bs4 (from pyYify)
  Using cached https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Requirement already satisfied: requests in /usr/lib/python3.7/site-packages (from pyYify) (2.20.1)
Collecting urllib (from pyYify)
  Could not find a version that satisfies the requirement urllib (from pyYify) (from versions: )
No matching distribution found for urllib (from pyYify)

Can't get any information

This methods are all there, just can't read any info...


import urllib

import urllib3
import bs4
import requests
import re
from pyYify import yify

movies_list = yify.search_movies("superman")

movies_list
[<class 'pyYify.yify.movie'>, <class 'pyYify.yify.movie'>, <class 'pyYify.yify.movie'>, <class 'pyYify.yify.movie'>, <class 'pyYify.yify.movie'>, <class 'pyYify.yify.movie'>, <class 'pyYify.yify.movie'>]

movies_list[0].name
AttributeError: type object 'movie' has no attribute 'name'

movies_list[0].getinfo()
TypeError: getinfo() missing 1 required positional argument: 'self'

movies_list[0].getinfo(name)
NameError: name 'name' is not defined

movies_list[0].getinfo(id)
  File "C:\Users\\Downloads\pyYify-master\pyYify-master\pyYify\yify.py", line 102, in getinfo
    self.name = re.search("^[^\(]+" ,self.name).group(0).strip() ;
AttributeError: 'builtin_function_or_method' object has no attribute 'name'

I used this installation: #2

'NoneType' object has no attribute 'find_all'

I ran this code
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
from pyYify import yify
movies_list = yify.search_movies('avengers', '720p' , 8.0 , 'Romance')
movies_list = yify.get_top_seeded_torrents() ;
for movie in movies_list:
movie.getinfo() ;
movie1 = movies_list[0]

torrent1 = movie1.torrents[0]

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

Error
::::::::::::

AttributeError Traceback (most recent call last)
in
1 from pyYify import yify
2 movies_list = yify.search_movies('avengers', '720p' , 8.0 , 'Romance')
----> 3 movies_list = yify.get_top_seeded_torrents() ;
4 for movie in movies_list:
5 movie.getinfo() ;

~\Anaconda3\New\lib\site-packages\pyYify\yify.py in get_top_seeded_torrents()
198
199 soup = BeautifulSoup(get(homepage , timeout=3).text , 'html.parser') ;
--> 200 topseeds = soup.find(id="topseed").find_all('a');
201
202 top_torrents = []

AttributeError: 'NoneType' object has no attribute 'find_all'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.