Code Monkey home page Code Monkey logo

disney-plus-api-wrapper's Introduction

Disney+ API wrapper

A Feature rich API wrapper for Disney+ made with python.

Requirements

Library was tested on following versions, however feel free to try different ones.

pip install pysubs2==1.6.1
pip install m3u8==3.6.0
pip install requests

Usage/Examples

Simple search

from DisneyAPI import DisneyAPI

api = DisneyAPI(email="email", password="password")
searches = api.search("Star wars")
print(searches[0].title) # prints title of the first search hit

Advanced usage

from DisneyAPI import DisneyAPI
from models.HitType import HitType
from models.Language import Language
from models.Rating import Rating

# forces to use Disney's login api instead of cached access and refresh tokens
# sets proxies
api = DisneyAPI(email="email", password="password", proxies={}, force_login=True)

profileId = api.get_profiles()[0].id  # grabs the first profile's id
print(api.set_active_profile(profileId)) # if profile is locked, pass pin as an argument
print(api.get_active_profile())

api.set_language(Language.POLISH)  # sets language to Polish, from now all data will be returned in that language

searches = api.search("Star wars", rating=Rating.AGE9PLUS)
print(searches[0].title)

# checks if the search hit is a series or a movie
if searches[0].type == HitType.SERIES:
    # prints s01e01's full description
    print(searches[0].get_seasons()[0].get_episodes()[0].full_description)

if searches[0].type == HitType.MOVIE:
    print(searches[0].length)  # returns in milliseconds
    print(searches[0].cast)
    print(searches[0].audio_tracks)
    print(searches[0].subtitles)

More examples

from models.ProgramType import MovieType, SeriesType

# Search by program type
print(api.search_program_type(MovieType.ALL))
# or
print(api.search_program_type(SeriesType.KIDS))

Downloading subtitles

# by default download path is downloads/
api.set_download_path("custom/downloads")
search = api.search_movies("star wars")[0]
subs = search.subtitles
for sub in subs:
    if sub.language == "pl":
        sub.download(name="name")

Downloading audio

search = api.search_series("marvel")[0].get_seasons()[0].get_episodes()[0]
audios = search.audio_tracks
for audio in audios:
    if audio.language == "pl":
        audio.download(name="name", quality="max")  # allowed max or min, feel free to make a PR to add custom ones

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Disclaimer

This project can only be used for educational purposes. Using this software for malicious intent is illegal, and any damages from misuse of this software will not be the responsibility of the author.

License

MIT

disney-plus-api-wrapper's People

Contributors

pam-param-pam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mushishi06

disney-plus-api-wrapper's Issues

api requests return empty list

Hi, from the half of this week I get empty lists returned when I search, do you experience this as well?
Been using it for a couple of weeks now and it worked great. But I can't seem to find where it is coming from...

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.