pyhulu
Python library for interacting with the E2E encrypted Hulu API
Usage
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: http://docs.python-requests.org/en/master/user/quickstart/#cookies.
With the initialized client object, you can use the load_playlist() method:
client.load_playlist(video_id)
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
PC
- Device code:
159 - Device key (hex):
6ebfc84f3c304217b20fd9a66cb5957f
Example Code
import pyhulu
from http.cookiejar import MozillaCookieJar
cj = MozillaCookieJar('cookies.txt')
cj.load()
client = pyhulu.HuluClient('159', bytes.fromhex('6ebfc84f3c304217b20fd9a66cb5957f'), cj)
print(client.load_playlist(61085964))
Installation
To install, either clone the repository and run python setup.py install or run pip install pyhulu.
To-Do
- Add unit tests
- Add to PyPI
- Add documentation
Metadata
Release files for pyhulu 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyhulu-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for pyhulu-1.1.2-py3-none-any.whl |
Release files / pyhulu-1.1.2-py3-none-any.whl
| Download URL | pyhulu-1.1.2-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b42aaf2c976d00b7cc562de33a2302c420e04cf8f4c2d9803ca8b2baf8f9ac8f
|
|
BLAKE2b-256 checksum How to use checksums |
31109d44b07c299093cdf292eeed21bd2cde3126775caa7041eeb307fb92331f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Security for pyhulu 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.