Skip to main content

Python library for interacting with the E2E encrypted Hulu API

Project description


Build Status License: GPL v3

Python library for interacting with the E2E encrypted Hulu API


First, initialize the HuluClient class with a device code, device key, and cookies:

client = pyhulu.HuluClient(device_code, device_key, cookies)

device_code is a three-digit string or integer (doesn't matter) denoting the device you will make requests as.

device_key is a 16-byte AES key that corresponds to the device code you're using. This is used to decrypt the device config response.

cookies can either be a cookie jar object or a dict of cookie key / value pairs. This is passed to the requests library, so whatever it takes will work. Examples here:

With the initialized client object, you can use the load_playlist() method:


video_id is either a string or integer denoting the video ID to request a playlist for. This is NOT the ID in the /watch/ URL! If you view the page source of a /watch/ page, you'll find \"content_id\" which has the actual video ID used by the API.

This method returns a dict of the playlist response, which contains stream and license URLs.

Device Codes and Keys


  • Device code: 159
  • Device key (hex): 6ebfc84f3c304217b20fd9a66cb5957f

Example Code

import pyhulu
from http.cookiejar import MozillaCookieJar

cj = MozillaCookieJar('cookies.txt')

client = pyhulu.HuluClient('159', bytes.fromhex('6ebfc84f3c304217b20fd9a66cb5957f'), cj)


To install, either clone the repository and run python install or run pip install pyhulu.


  • Add unit tests
  • Add to PyPI
  • Add documentation

Project details

Download files

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

Built Distribution

pyhulu-1.1.2-py3-none-any.whl (17.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page