mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-24 18:05:07 +00:00
docs: phase 2 of the prose style across docs and docstrings
This commit is contained in:
@@ -2241,7 +2241,7 @@ def resolve_server_cdm(service: str, profile: Optional[str], cdm_type: Optional[
|
||||
|
||||
Checks the server's own CDM config (``config.cdm[service]``) to
|
||||
determine the CDM type without loading the full CDM object. This
|
||||
ensures that when you use ``server_cdm: true``, the server's CDM
|
||||
makes sure that when you use ``server_cdm: true``, the server's CDM
|
||||
determines device selection (e.g. PlayReady vs Widevine).
|
||||
|
||||
Falls back to a lightweight stub from *cdm_type* only if the configuration
|
||||
|
||||
@@ -81,7 +81,7 @@ class DecryptLabsRemoteCDM:
|
||||
Main Features:
|
||||
- Compatible with both Widevine and PlayReady DRM schemes
|
||||
- Intelligent caching that compares required vs. available keys
|
||||
- Optimized caching for L1/L2 devices (leverages API auto-optimization)
|
||||
- Optimized caching for L1/L2 devices (uses API auto-optimization)
|
||||
- Automatic content key combination for mixed cache/license scenarios
|
||||
- Fallback to license requests when keys are missing
|
||||
|
||||
@@ -367,7 +367,7 @@ class DecryptLabsRemoteCDM:
|
||||
- For other devices: Uses cache retry logic based on CDM session state
|
||||
- With required KIDs set: Only requests license for missing keys
|
||||
- Without required KIDs: Returns any available cached keys
|
||||
- For PlayReady: Combines vault, cached, and license keys seamlessly
|
||||
- For PlayReady: Combines vault, cached, and license keys
|
||||
|
||||
Args:
|
||||
session_id: Session identifier
|
||||
@@ -549,8 +549,8 @@ class DecryptLabsRemoteCDM:
|
||||
Parse license response with the Decrypt Labs API and intelligent content key combination.
|
||||
|
||||
For PlayReady titles with partial cached keys, this method intelligently
|
||||
combines the cached keys with newly obtained license keys, avoiding
|
||||
duplicates while ensuring all required keys are available.
|
||||
combines the cached keys with newly obtained license keys, skipping a
|
||||
license key whose KID is already present.
|
||||
|
||||
The content key combination process:
|
||||
1. Extracts keys from the license response
|
||||
|
||||
@@ -626,11 +626,11 @@ def download(
|
||||
RnetSession streams natively. requests.Session reads the raw socket, except
|
||||
on a content-encoded body: only iter_content decodes such a body.
|
||||
|
||||
Yields these download status updates while the chunks download:
|
||||
Yields these download status updates while the segments download:
|
||||
|
||||
- {total: 123} (there are 123 chunks to download)
|
||||
- {total: None} (there are an unknown number of chunks to download)
|
||||
- {advance: 1} (the downloader finished one chunk)
|
||||
- {total: 123} (there are 123 segments to download)
|
||||
- {total: None} (there are an unknown number of segments to download)
|
||||
- {advance: 1} (the downloader finished one segment)
|
||||
- {downloaded: "10.1 MB/s"} (currently downloading at a rate of 10.1 MB/s)
|
||||
- {file_downloaded: Path(...), written: 1024} (download finished, has the save path and size)
|
||||
|
||||
@@ -1260,11 +1260,11 @@ def requests(
|
||||
reports it as downloaded at its on-disk size without any request, so a second call resumes a
|
||||
batch from the segments the earlier run completed.
|
||||
|
||||
Yields these download status updates while the chunks download:
|
||||
Yields these download status updates while the segments download:
|
||||
|
||||
- {total: 123} (there are 123 chunks to download)
|
||||
- {total: None} (there are an unknown number of chunks to download)
|
||||
- {advance: 1} (the downloader finished one chunk)
|
||||
- {total: 123} (there are 123 segments to download)
|
||||
- {total: None} (there are an unknown number of segments to download)
|
||||
- {advance: 1} (the downloader finished one segment)
|
||||
- {downloaded: "10.1 MB/s"} (currently downloading at a rate of 10.1 MB/s)
|
||||
- {file_downloaded: Path(...), written: 1024} (download finished, has the save path and size)
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ class Episode(Title):
|
||||
return str(self.air_date)
|
||||
|
||||
def folder_season(self) -> str:
|
||||
"""Season folder label: air year for dated content, else SxxExx-style season."""
|
||||
"""Season folder label: air year when the air date parsed to a date, else SxxExx-style season."""
|
||||
if isinstance(self.air_date, date):
|
||||
return f"{self.air_date.year:04}"
|
||||
return f"S{self.season:02}"
|
||||
|
||||
@@ -146,7 +146,7 @@ class Song(Title):
|
||||
|
||||
A song shares the episode key space, its disc reading as the season and its track
|
||||
as the episode, so ``-w 1-5`` takes tracks 1 to 5 and ``-w 2x3`` takes disc 2
|
||||
track 3. A song has no parts and no air date, so it answers to one key only.
|
||||
track 3. A song has no parts and no air date, so it answers to its disc-and-track key only.
|
||||
"""
|
||||
return f"{self.disc}x{self.track}" in wanted
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ class Title:
|
||||
@abstractmethod
|
||||
def get_filename(self, media_info: MediaInfo, folder: bool = False, show_service: bool = True) -> str:
|
||||
"""
|
||||
Get a Filename for this Title with the provided Media Info.
|
||||
Get a Filename for this Title with the provided MediaInfo.
|
||||
All filenames should be sanitized with the sanitize_filename() utility function.
|
||||
|
||||
Parameters:
|
||||
|
||||
@@ -163,8 +163,8 @@ class Subtitle(Track):
|
||||
However, I would not pay much attention to the claims about SDH needing to
|
||||
be in the original language. It is logically not true.
|
||||
|
||||
CC == Closed Captions. Source: Basically every site.
|
||||
SDH = Subtitles for the Deaf or Hard-of-Hearing. Source: Basically every site.
|
||||
CC == Closed Captions. Source: Every site.
|
||||
SDH = Subtitles for the Deaf or Hard-of-Hearing. Source: Every site.
|
||||
HOH = Exact same as SDH. Is a term used in the UK. Source: https://bit.ly/2PGJatz (ICO UK)
|
||||
|
||||
More in-depth information, examples, and stuff to look for can be found in the Parameter
|
||||
|
||||
@@ -918,7 +918,7 @@ class Track:
|
||||
return init_data
|
||||
|
||||
def repackage(self, bsf_v: Optional[str] = None) -> bool:
|
||||
"""Remux the track with ffmpeg ``-c copy``.
|
||||
"""Remux the track with FFmpeg ``-c copy``.
|
||||
|
||||
A given ``bsf_v`` goes into the same pass as ``-bsf:v``, which normalises video VUI
|
||||
colour metadata without a second full-file remux. Repackaging is mandatory. The
|
||||
|
||||
@@ -204,7 +204,11 @@ class Tracks:
|
||||
],
|
||||
warn_only: bool = False,
|
||||
) -> None:
|
||||
"""Add a provided track to its appropriate array and ensuring it is not a duplicate."""
|
||||
"""Add a provided track to its appropriate array.
|
||||
|
||||
A track whose ID is already in the collection raises ValueError. With `warn_only`
|
||||
set, this method skips such a track and logs how many it skipped.
|
||||
"""
|
||||
if isinstance(tracks, Tracks):
|
||||
if tracks.manifest_url and not self.manifest_url:
|
||||
self.manifest_url = tracks.manifest_url
|
||||
|
||||
@@ -415,7 +415,7 @@ class Video(Track):
|
||||
|
||||
Returns None when a rewrite is not necessary: SDR/DV/HYBRID ranges, non-AVC/HEVC codecs, a
|
||||
missing file, or when the bitstream already ships the correct colour metadata. Otherwise
|
||||
returns a ``{h264,hevc}_metadata=...`` string suitable for ffmpeg ``-bsf:v``.
|
||||
returns a ``{h264,hevc}_metadata=...`` string suitable for FFmpeg ``-bsf:v``.
|
||||
"""
|
||||
if not self.path or not self.path.exists():
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user