mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
Deployed 6e99812e with MkDocs version: 1.6.1
This commit is contained in:
@@ -2944,6 +2944,13 @@ from 1) to every song. The track list, the download order and <code>-w</code> th
|
||||
tags, the file name and the folder keep <code>track</code>, <code>disc</code> and <code>album</code>. Set it in <code>get_titles()</code>,
|
||||
because a remote client does not read it again after the listing. Such a song also needs an <code>id</code> that
|
||||
stays the same in each listing: <code>position</code> does not identify it.</p>
|
||||
<p><code>Album</code> and <code>Music</code> take the facts of the collection itself: <code>kind</code>, <code>title</code>, <code>artist</code>, <code>year</code>,
|
||||
<code>total_tracks</code>, <code>total_discs</code>, <code>artwork_url</code>, <code>total_duration</code>, <code>owner</code> and <code>description</code>. A
|
||||
remote client gets all of them. When every song has the same <code>album</code> and <code>album_artist</code>, the listing
|
||||
takes a <code>title</code>, <code>artist</code> or <code>year</code> that you do not give, and the release date, quality, genre and
|
||||
label, from the first song. The listing of any other collection, such as a playlist of single songs,
|
||||
has no line for them. <code>build_music_from_songs</code> uses the same test before it takes the title, artist, year, artwork or
|
||||
totals from the songs.</p>
|
||||
<p>The tagger also falls back to <code>Song.data</code> for fields the constructor did not get, such
|
||||
as the composer or a full release date. It reads the top level of that dict and a
|
||||
nested <code>metadata</code> sub-dict, with the nested keys winning, so either shape works. The keys
|
||||
@@ -3133,9 +3140,13 @@ least one and no track is left.</p>
|
||||
<h3 id="segment-filtering-hooks">Segment-filtering hooks<a class="headerlink" href="#segment-filtering-hooks" title="Permanent link">¶</a></h3>
|
||||
<ul>
|
||||
<li><strong>HLS</strong>: set <code>track.OnSegmentFilter(segment)</code> to drop unwanted segments (ads/bumpers).
|
||||
A dropped segment is invisible to the whole download: unshackle ignores its <code>EXT-X-KEY</code>
|
||||
and its <code>EXT-X-DISCONTINUITY</code>, so a clear ad break inside an encrypted track does
|
||||
not disturb decryption.</li>
|
||||
An <code>EXT-X-KEY</code> applies to each later segment until the next <code>EXT-X-KEY</code>, also when the
|
||||
filter or <code>--sample</code> drops the segment that carries it. unshackle ignores an <code>EXT-X-KEY</code> that
|
||||
applies to dropped segments only: no licence, no request and no new decryption. It also
|
||||
ignores the <code>EXT-X-DISCONTINUITY</code> of a dropped segment. A dropped ad break thus does not
|
||||
disturb decryption when the playlist repeats the <code>EXT-X-KEY</code> of the title after the break.
|
||||
Without the repeat, the segments after the break take the <code>EXT-X-KEY</code> of the ads, and
|
||||
<code>METHOD=NONE</code> there makes them clear.</li>
|
||||
<li><strong>DASH</strong>: pass a <code>period_filter</code> callable to <code>to_tracks</code> to drop whole periods.
|
||||
unshackle automatically drops the caching-breadth periods that some services send, and the non-<code>content</code> segment types.</li>
|
||||
</ul>
|
||||
@@ -3273,7 +3284,24 @@ that needs a process on the server also works for a remote client.</p>
|
||||
<h3 id="a-playlist-whose-key-tag-unshackle-cannot-license">A playlist whose key tag unshackle cannot license<a class="headerlink" href="#a-playlist-whose-key-tag-unshackle-cannot-license" title="Permanent link">¶</a></h3>
|
||||
<p>A media playlist can name only a key system that unshackle does not read, such as an <code>skd://</code> key
|
||||
over cbcs media, while the licence server of the platform also issues the same content key over
|
||||
PlayReady or Widevine. To license such a track through one of those systems:</p>
|
||||
PlayReady or Widevine. <code>HLS.download_track</code> licenses such a track with no service code when all of
|
||||
these conditions are true:</p>
|
||||
<ul>
|
||||
<li>The track has no DRM object.</li>
|
||||
<li>Every <code>EXT-X-KEY</code> of its media playlist is <code>SAMPLE-AES</code> or <code>SAMPLE-AES-CTR</code> for a DRM system
|
||||
unshackle cannot license.</li>
|
||||
<li>The configured CDM is a PlayReady or Widevine CDM.</li>
|
||||
<li>The init segment (<code>EXT-X-MAP</code>) of the track names a key ID in its <code>tenc</code> box. When the <code>tenc</code> key ID is all
|
||||
zeros, its <code>pssh</code> boxes must name exactly one key ID, and the encrypted segments must have one init
|
||||
segment and the playlist one key URI. MPEG-TS media has no init segment.</li>
|
||||
<li>The init segment does not change without an <code>EXT-X-DISCONTINUITY</code>.</li>
|
||||
</ul>
|
||||
<p>The download reads the key ID from the init segment, builds a DRM object for the DRM system of the
|
||||
CDM with <code>drm_stub</code>, and sends the challenge to the licence callback of the service. Over <code>--remote</code>
|
||||
the server reads the same key ID at the licence step, so it accepts the DRM object of the client. A
|
||||
licence that gives no content key stops the track before it downloads a segment.</p>
|
||||
<p>A service that must choose the DRM system itself, or one that knows the key ID, puts the DRM object
|
||||
on the track:</p>
|
||||
<ol>
|
||||
<li>Read the key ID from the init segment of the track. <code>HLS.get_track_kid_from_init</code> returns it.</li>
|
||||
<li>Put a DRM object that names the key ID on the track: <code>drm_stub</code> from <code>unshackle.core.drm.cenc</code>
|
||||
@@ -3287,8 +3315,9 @@ content key of one package of a title and refuse another. When a track carries a
|
||||
object and every <code>EXT-X-KEY</code> of its playlist is <code>SAMPLE-AES</code> or <code>SAMPLE-AES-CTR</code> for a key system
|
||||
unshackle cannot license, <code>HLS.drop_unsupported_keys</code> removes the tags from the parsed playlist.
|
||||
The download then licenses and decrypts the track with the DRM object of the track. This works for
|
||||
one content key per track: the key changes of the playlist go with the tags. A track with no such
|
||||
DRM object stops with <code>None of the key systems are supported</code> before it downloads a segment.</p>
|
||||
one content key per track: the key changes of the playlist go with the tags. This limit also
|
||||
applies to a DRM object that the download builds. Any other track stops with
|
||||
<code>None of the key systems are supported</code> before it downloads a segment.</p>
|
||||
<h3 id="how-unshackle-chooses-a-cdm-and-finds-keys">How unshackle chooses a CDM and finds keys<a class="headerlink" href="#how-unshackle-chooses-a-cdm-and-finds-keys" title="Permanent link">¶</a></h3>
|
||||
<p>CDM selection is config-driven: the <code>cdm</code> map resolves a service tag (and optionally the
|
||||
track quality or DRM type) to a device name, which <code>load_cdm</code> instantiates as a local
|
||||
|
||||
Reference in New Issue
Block a user