Own a dedicated retained browser lifecycle for Netflix presentation.
More...
|
| None | __init__ (self, *, str|Path profile_path=DEFAULT_NETFLIX_PROFILE_PATH, tuple[str,...] browser_candidates=("google-chrome", "google-chrome-stable", "chromium", "chromium-browser",), bool software_rendering=False, bool dark_mode=False) |
| | Configure a Netflix player.
|
| bool | play (self, str url, *, str display, tuple[int, int]|None window_position=None, tuple[int, int]|None window_size=None) |
| | Open a Netflix URL on the requested display.
|
|
None | stop (self) |
| | Stop the browser process owned by this player.
|
|
bool | is_active (self) |
| | Return whether the owned Netflix browser process is running.
|
|
"NetflixPlayer" | __enter__ (self) |
| | Return this player for context-managed lifecycle.
|
|
None | __exit__ (self, exception_type, exception, traceback) |
| | Stop playback when leaving a context-managed lifecycle.
|
|
| str | validate_url (str url) |
| | Validate a direct Netflix HTTPS URL.
|
Own a dedicated retained browser lifecycle for Netflix presentation.
◆ __init__()
| None video.netflix_player.NetflixPlayer.__init__ |
( |
| self, |
|
|
* | , |
|
|
str | Path | profile_path = DEFAULT_NETFLIX_PROFILE_PATH, |
|
|
tuple[str, ...] | browser_candidates = (
"google-chrome",
"google-chrome-stable",
"chromium",
"chromium-browser",
), |
|
|
bool | software_rendering = False, |
|
|
bool | dark_mode = False ) |
Configure a Netflix player.
- Parameters
-
| profile_path | Persistent browser profile used for Netflix sessions. |
| browser_candidates | Browser executables in preference order. |
| software_rendering | Disable GPU paths for compatibility when true. |
| dark_mode | Request browser dark presentation when true. |
◆ play()
| bool video.netflix_player.NetflixPlayer.play |
( |
| self, |
|
|
str | url, |
|
|
* | , |
|
|
str | display, |
|
|
tuple[int, int] | None | window_position = None, |
|
|
tuple[int, int] | None | window_size = None ) |
Open a Netflix URL on the requested display.
- Parameters
-
| url | Direct Netflix HTTPS URL. |
| display | X11 display used by the browser. |
| window_position | Optional initial X/Y position. |
| window_size | Optional initial width/height. |
- Returns
- True after the browser launch request succeeds.
◆ validate_url()
| str video.netflix_player.NetflixPlayer.validate_url |
( |
str | url | ) |
|
|
static |
Validate a direct Netflix HTTPS URL.
- Parameters
-
| url | Candidate Netflix URL. |
- Returns
- Trimmed validated URL.
- Exceptions
-
| ValueError | When the URL is non-HTTPS or outside Netflix. |
The documentation for this class was generated from the following file:
- controllers/video/netflix_player.py