refactor(tracks): make complete_track the one finish step for every track kind

This commit is contained in:
imSp4rky
2026-11-29 14:04:53 -07:00
parent dcbc9de7ba
commit e41760c2b3
14 changed files with 332 additions and 174 deletions
+1 -1
View File
@@ -689,7 +689,7 @@ See the [DRM & CDM reference](../guide/drm-and-cdm.md) for the full picture.
Override any of these to react to pipeline stages (all no-ops by default):
`on_segment_downloaded`, `on_track_downloaded`, `on_track_decrypted`,
`on_track_repacked`, `on_track_multiplex`. `on_track_downloaded` runs once per track, after
unshackle decrypted the `drm` of the track. Also override `search()` to yield
unshackle decrypted the track and after `on_track_decrypted`. Also override `search()` to yield
`SearchResult` objects for `unshackle search`.
!!! warning "Set `ANONYMOUS_SEARCH` only for a search that needs no account"
+3 -3
View File
@@ -449,9 +449,9 @@ process can use. For these, set no `drm` on the track and override two methods:
full-sample cbcs only, not pattern encryption.
When the download of the track ends, unshackle calls `unshackle.core.drm.cbcs.decrypt_file`, and
the progress row shows "Decrypting". Your `on_track_downloaded` runs before this and gets the
encrypted file. `decrypt_file` writes the plaintext back in place and removes the
protection boxes, so the muxer reads a clear file. In a remote session `get_sample_decrypter`
the progress row shows "Decrypting". `decrypt_file` writes the plaintext back in place and removes the
protection boxes, so the muxer reads a clear file. Then your `on_track_decrypted` runs with `drm` set
to `None`, and after it your `on_track_downloaded` runs and gets the clear file. In a remote session `get_sample_decrypter`
runs on the server: the client sends the samples through the `samples` route, so a decrypter
that needs a process on the server also works for a remote client.