Skip to main content

Package mainly used by SmartTV, contains APIs for Movies,TV Shows, Torrents, Weather andLocation info as well as torrent client

Project description

Welcome to entertainment-package 👋

Version Made in Python Maintenance License: MIT Codacy Badge Travis CI Twitter: GrbavaCigla

Package mainly used by SmartTV, contains APIs for Movies, TV Shows, Torrents, Weather and Location info as well as torrent client

🏠 Homepage

Prerequisites

  • python >= 3.4
  • python-libtorrent (pip)

Install

pip install entertainment

Usage

Importing

import entertainment

Movie API - YTS.LT

Search

from entertainment import searchMovies

list_of_movies = searchMovies("Avengers") # Returns list of Movies (class Movie)

Movie class

from entertainment import Movie

movie = Movie.fromId(13106)
>>> movie.trailer_code                             # Returns youtube trailer video ID
'hA6hldpSTF8'
>>> movie.id                                       # Returns YTS id
13106
>>> movie.url                                      # Returns YTS URL
'https://yts.lt/movie/avengers-endgame-2019'
>>> movie.imdb_code                                # Returns IMDB ID code
'tt4154796'
>>> movie.title                                    # Returns title
'Avengers: Endgame'
>>> movie.titleEn                                  # Returns title
'Avengers: Endgame'
>>> movie.slug                                     # Returns slug
'avengers-endgame-2019'
>>> movie.year                                     # Returns year
2019
>>> movie.rating                                   # Returns IMDB rating
8.5
>>> movie.genres                                   # Returns list of genres
['Action', 'Adventure', 'Drama', 'Sci-Fi']
>>> movie.description                              # Returns description
"After the devastating events of Avengers: Infinity War (2018), the universe is in ruins due to the efforts of the Mad Titan, Thanos. With the help of remaining allies, the Avengers must assemble once more in order to undo Thanos's actions and undo the chaos to the universe, no matter what consequences may be in store, and no matter who they face..."
>>> movie.language                                 # Returns language
'English'
>>> movie.covers                                   # Returns cover images (small,medium,large)
[
 'https://yts.lt/assets/images/movies/avengers_endgame_2019/small-cover.jpg',
 'https://yts.lt/assets/images/movies/avengers_endgame_2019/medium-cover.jpg',
 'https://yts.lt/assets/images/movies/avengers_endgame_2019/large-cover.jpg'
]
>>> movie.torrent_data                             # Returns list of TorrentMovieDatas
[
  entertainment.torrent.TorrentMovieData object at ...
]
>>> movie.runtime                                  # Returns runtime in minutes
181

TV Show API

Search

from entertainment import searchSeries

list_of_tv_shows = searchSeries("Silicon Valley")

Serie class

from entertainment import Serie

serie = Serie.fromId(143)
>>> serie.id
143
>>> serie.title
'Silicon Valley'
>>> serie.url
'http://www.tvmaze.com/shows/143/silicon-valley'
>>> serie.type
'Scripted'
>>> serie.language
'English'
>>> serie.genres
['Comedy']
>>> serie.status
'Ended'
>>> serie.runtime
30
>>> serie.premiered
'2014-04-06'
>>> serie.official_site
'http://www.hbo.com/silicon-valley/'
>>> serie.rating
8.5
>>> serie.network
'HBO'
>>> serie.timezone
'America/New_York'
>>> serie.country
'United States'
>>> serie.country_code
'US'
>>> serie.tvrage_code
33759
>>> serie.thetvdb_code
277165
>>> serie.imdb_code
'tt2575988'
>>> serie.covers
[
 'http://static.tvmaze.com/uploads/images/medium_portrait/215/538434.jpg',
 'http://static.tvmaze.com/uploads/images/original_untouched/215/538434.jpg'
]
>>> serie.description
'In the high-tech gold rush of modern Silicon Valley, the people most qualified to succeed are the least capable of handling success. From Mike Judge comes this satire about a programmer whose game-changing algorithm becomes the subject of a valley-wide bidding war.'
>>> serie.previous_episode
'http://api.tvmaze.com/episodes/1757884'
>>> serie.next_episode
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/entertainment/serie.py", line 125, in next_episode
    return self.parsed["_links"]["nextepisode"]
KeyError: 'nextepisode'
# ToDo: Fix, make custom error when episode, doesn't exist

Author

👤 Alexa Ognjanovic

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Alexa Ognjanovic.
This project is GPLv3 licensed.


This README was generated with ❤️ by readme-md-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for entertainment, version 1.0.7
Filename, size File type Python version Upload date Hashes
Filename, size entertainment-1.0.7-py3-none-any.whl (20.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size entertainment-1.0.7.tar.gz (9.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page