mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-26 10:55:08 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6029acd40b |
@@ -1,2 +1 @@
|
||||
* text=auto eol=lf
|
||||
tests/fixtures/manifests/** -text
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# unshackle
|
||||
unshackle.yaml
|
||||
unshackle.yml
|
||||
!unshackle/themes/unshackle.yaml
|
||||
update_check.json
|
||||
*.mkv
|
||||
*.mp4
|
||||
@@ -27,6 +28,7 @@ unshackle/binaries/*
|
||||
# test fixtures (binary subtitle samples) must be tracked despite the *.mp4 rule above
|
||||
!tests/tracks/fixtures/*.mp4
|
||||
unshackle/cache/
|
||||
unshackle/themes/custom/
|
||||
unshackle/cookies/
|
||||
unshackle/certs/
|
||||
unshackle/WVDs/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
|
||||
exclude: ^tests/fixtures/manifests/
|
||||
repos:
|
||||
- repo: https://github.com/compilerla/conventional-pre-commit
|
||||
rev: v4.4.0
|
||||
|
||||
@@ -491,25 +491,6 @@ def get_tracks(self, title: Title_T) -> Tracks:
|
||||
return self.get_tracks_for_variants(title, fetch_variant)
|
||||
```
|
||||
|
||||
!!! note "What the helper merges"
|
||||
The helper adds the video, audio and subtitle tracks of every manifest.
|
||||
From a later manifest, it skips a track that has the ID of a held track. It
|
||||
also skips a track whose `Tracks.signature` matches a held track, because
|
||||
the same track can have a different ID in each manifest. Chapters and
|
||||
attachments come from the first manifest only.
|
||||
|
||||
- `signature` holds the attributes that the track list and selection
|
||||
read: codec, range, resolution, frame rate, bitrate and name for video;
|
||||
language, codec, channels, JOC, descriptive, bitrate and name for audio;
|
||||
language, codec, flags and name for subtitles.
|
||||
- The helper does not remove copies inside one manifest. To remove them,
|
||||
call `tracks.dedupe()`. Two tracks that differ only in a value outside
|
||||
the signature, such as a dialogue-boost mix, become one track, so remove the
|
||||
track you do not want before you call it.
|
||||
- The audio that `dl` selects can come from a different manifest than the
|
||||
video. Keep licence data on each track (`track.data`), not in one value
|
||||
per title that the next fetch overwrites.
|
||||
|
||||
After parsing, you may **correct** track metadata the manifest gets wrong:
|
||||
stamp the real `video.range`, fix odd audio channel counts, mark descriptive
|
||||
audio, add hand-built subtitles or an `Attachment` (e.g. cover art). Do *not*
|
||||
@@ -614,7 +595,7 @@ def get_widevine_license(self, *, challenge: bytes, title, track):
|
||||
`get_clearkey_license` to do the POST yourself.
|
||||
3. **Keys arrive obfuscated or through a bespoke channel**: fetch and unwrap
|
||||
the content key in `get_tracks` and pre-populate
|
||||
`drm.signatures[kid] = key_hex` on the track's `ClearKeyCENC`. The
|
||||
`drm.content_keys[kid] = key_hex` on the track's `ClearKeyCENC`. The
|
||||
non-obvious payoff: when every KID is already keyed, the framework skips
|
||||
the license round-trip entirely.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ This value becomes the one and only API key that the server accepts. The server
|
||||
If you start `unshackle serve` with no `api_secret` configured, and you have *not* passed `--no-key`, the command fails immediately with:
|
||||
|
||||
```
|
||||
No 'api_secret' in the 'serve' section of your config
|
||||
API secret key is not configured. Please add 'api_secret' to the 'serve' section in your config.
|
||||
```
|
||||
|
||||
Choose a long, unpredictable value. The API key is the only thing standing between the internet and your CDM and download endpoints.
|
||||
|
||||
@@ -45,7 +45,6 @@ Health check. **This is the only route exempt from authentication**: you can cal
|
||||
"status": "ok",
|
||||
"version": "5.3.0",
|
||||
"code_hash": "1d22a1e",
|
||||
"draining": false,
|
||||
"update_check": {
|
||||
"update_available": false,
|
||||
"current_version": "5.3.0",
|
||||
@@ -56,10 +55,6 @@ Health check. **This is the only route exempt from authentication**: you can cal
|
||||
|
||||
`code_hash` fingerprints the framework source the server operates, so it names the code itself rather than the release. It is the same value for a git checkout and for an installed package built from that checkout. It changes when you edit anything under `unshackle/core`, `unshackle/commands`, `unshackle/utils`, or `unshackle/vaults`. Service modules are not included. unshackle sets the value to `null` only when it cannot read the source files.
|
||||
|
||||
`draining` is `true` while the server refuses new remote sessions and jobs before a restart.
|
||||
|
||||
The server asks GitHub for the latest release at most once per [`update_check_interval`](../../reference/configuration/misc.md#caching-updates) hours and answers from its cache between checks.
|
||||
|
||||
If the update check fails (for example, no network), `update_available` and `latest_version` are `null` while `current_version` still reports the installed version.
|
||||
|
||||
| Status | Meaning |
|
||||
@@ -322,7 +317,7 @@ Show the video, audio, and subtitle tracks for a title. For series, you can scop
|
||||
| `part` | int/string | no | Part index of a split episode (combined with `season` and `episode`). |
|
||||
| `profile`, `proxy`, `no_proxy`, `cdm_type` | - | no | As on `list-titles`. |
|
||||
| `credentials`, `cookies`, `cache` | - | no | As on `list-titles`. |
|
||||
| `dl_params` | object | no | The `dl` track selection that the service reads from `ctx.parent.params`: `lang`, `v_lang`, `a_lang`, `s_lang`, `acodec`, `forced_subs` and `exact_lang`, as on [`POST /api/session/create`](#post-apisessioncreate). Some services select the manifests they fetch from these values. |
|
||||
| `dl_params` | object | no | The `dl` track selection that the service reads from `ctx.parent.params`: `lang`, `v_lang`, `a_lang`, `acodec`, `forced_subs` and `exact_lang`, as on [`POST /api/session/create`](#post-apisessioncreate). Some services select the manifests they fetch from these values. |
|
||||
|
||||
When you give both `season` and `episode`, the server combines them into a `"{season}x{episode}"` selector. `part` narrows that to `"{season}x{episode}.{part}"`, one part of a [split episode](../creating-a-service.md#split-episodes). Without `part` you get every part of the episode. The server reads `part` only when you give both `season` and `episode`, and `wanted` takes precedence over all three. To scope a part by range, put it in `wanted` instead (`"S01E01.2"`).
|
||||
|
||||
@@ -333,29 +328,28 @@ When you give both `season` and `episode`, the server combines them into a `"{se
|
||||
"title": { "type": "movie", "name": "Example Movie", "id": "12345", "year": 2021 },
|
||||
"video": [
|
||||
{
|
||||
"id": "v-1", "codec": "HEVC", "codec_display": "H.265",
|
||||
"id": "v-1", "codec": "H265", "codec_display": "HEVC",
|
||||
"bitrate": 8000, "bitrate_bps": 8000000, "width": 3840, "height": 2160,
|
||||
"resolution": "2160p", "fps": "24", "range": "HDR10",
|
||||
"range_display": "HDR", "scan_type": null, "closed_captions": [],
|
||||
"dv_compatible_bitstream": false, "hdr10plus": false, "hdr10_base": false, "language": "en",
|
||||
"is_original_lang": true,
|
||||
"name": null, "track_name": "English", "needs_repack": false, "edition": [], "data": null,
|
||||
"range_display": "HDR10", "scan_type": null, "closed_captions": [],
|
||||
"dv_compatible_bitstream": false, "hdr10plus": false, "language": "en", "is_original_lang": true,
|
||||
"name": null, "needs_repack": false, "edition": [], "data": null,
|
||||
"drm": [], "descriptor": "DASH"
|
||||
}
|
||||
],
|
||||
"audio": [
|
||||
{
|
||||
"id": "a-1", "codec": "EC3", "codec_display": "DDP",
|
||||
"id": "a-1", "codec": "EC3", "codec_display": "DD+",
|
||||
"bitrate": 640, "bitrate_bps": 640000, "channels": "5.1", "language": "en",
|
||||
"is_original": true, "is_original_lang": true, "atmos": false, "joc": 0,
|
||||
"descriptive": false, "name": null, "track_name": "English", "needs_repack": false, "edition": [],
|
||||
"descriptive": false, "name": null, "needs_repack": false, "edition": [],
|
||||
"data": null, "drm": [], "descriptor": "DASH"
|
||||
}
|
||||
],
|
||||
"subtitles": [
|
||||
{ "id": "s-1", "codec": "vtt", "language": "en",
|
||||
"forced": false, "sdh": false, "cc": false, "is_original_lang": false,
|
||||
"name": null, "track_name": "English", "needs_repack": false, "edition": [], "data": null,
|
||||
"name": null, "needs_repack": false, "edition": [], "data": null,
|
||||
"drm": [], "descriptor": "DASH" }
|
||||
]
|
||||
}
|
||||
@@ -383,7 +377,7 @@ The server sorts tracks by bitrate, descending. Episodes the server cannot get g
|
||||
|
||||
The `drm` array on a track is a list of `{type, pssh?, kids?, content_keys?, license_url?}` objects.
|
||||
|
||||
Every track carries the same fields as a local track: `is_original_lang`, `name`, `needs_repack`, `edition`, and `data`. `name` is the name the service set, or null. `track_name` is the name `--list` shows and the mux writes to an audio or subtitle track: `name` when the service set one, else the name of the language (English, or in the language itself when the server sets `muxing.track_names: native`, or no name when it sets `none`), then the server's `muxing.original_label` on an original-language track, then the SDH, CC, Forced or Descriptive label. `bitrate` is in kb/s, and `bitrate_bps` gives the exact bits/s. `data` holds the part of the service-set `track.data` that fits in JSON, without the `hls`, `dash`, and `ism` parser keys. Audio keeps `is_original` and `atmos` for clients that read them, and adds the exact `joc` object count.
|
||||
Every track carries the same fields as a local track: `is_original_lang`, `name`, `needs_repack`, `edition`, and `data`. `bitrate` is in kb/s, and `bitrate_bps` gives the exact bits/s. `data` holds the part of the service-set `track.data` that fits in JSON, without the `hls`, `dash`, and `ism` parser keys. Audio keeps `is_original` and `atmos` for clients that read them, and adds the exact `joc` object count.
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
@@ -967,7 +961,7 @@ the newlines must go out at once.
|
||||
|
||||
Make a remote session for a service and title. Authentication runs asynchronously in the background. This call returns immediately with `status: "authenticating"`, and you then poll the prompt endpoint. The body accepts `service` and `title_id` (both required). It also accepts a broad set of optional keys, because the body allows `additionalProperties`. These are `credentials` (`{username, password, extra?}`), `cookies` (base64 of zlib-compressed Netscape cookie file), `proxy`, `no_proxy`, `profile`, `cache` (map of forwarded cache files, keyed by the file path relative to the service cache directory with `/` separators and no `.json` suffix, so a nested key such as `session_web/<sha1>` lands in a subdirectory), `client_region`, `proxy_region`, `cdm_type`, `range_`, `vcodec`, `quality`, `best_available`, `dl_params`, `client`, and any service CLI options. `proxy_region` is the country code the client resolved `proxy` from; the server matches it against its own accounts. `client` is a freeform object the dashboard shows as sent (the CLI puts `version`, `code_hash`, `platform` and a redacted `argv` in it); the server ignores it above 4096 bytes of JSON.
|
||||
|
||||
`dl_params` is an object with the `dl` track selection: `lang`, `v_lang`, `a_lang` and `s_lang` (arrays of language strings), `acodec` (an array of audio codec names or `dl -a` aliases such as `ddp`), and `forced_subs` and `exact_lang` (booleans). The service reads these values from `ctx.parent.params`. The server uses the `dl` default for each absent or malformed value, and drops an unknown codec name.
|
||||
`dl_params` is an object with the `dl` track selection: `lang`, `v_lang` and `a_lang` (arrays of language strings), `acodec` (an array of audio codec names or `dl -a` aliases such as `ddp`), and `forced_subs` and `exact_lang` (booleans). The service reads these values from `ctx.parent.params`. The server uses the `dl` default for each absent or malformed value, and drops an unknown codec name.
|
||||
|
||||
Service CLI options also travel in a nested `service_params` object, which wins over a flat key with the same name. `profile` at the top level always means the credentials profile, never a service's own `--profile` option.
|
||||
|
||||
@@ -1102,7 +1096,6 @@ Get tracks and chapters for a specific title within the remote session. Body: `{
|
||||
"track_manifests": [ { "track_id": "s-1", "type": "dash", "url": "https://...", "data": "<base64 zlib xml>" } ],
|
||||
"session_headers": { "User-Agent": "..." },
|
||||
"session_cookies": { "sid": "..." },
|
||||
"session_cookie_jar": [ { "name": "sid", "value": "...", "domain": ".example.com", "path": "/", "secure": true } ],
|
||||
"server_cdm_type": "widevine"
|
||||
}
|
||||
```
|
||||
@@ -1122,13 +1115,11 @@ Get the download URL, DRM info, headers, cookies, and raw track data for the sel
|
||||
```json
|
||||
{
|
||||
"tracks": {
|
||||
"v-1": { "descriptor": "DASH", "url": "https://...", "drm": [ ... ], "headers": { ... }, "cookies": { ... }, "cookie_jar": [ ... ], "data": { ... } }
|
||||
"v-1": { "descriptor": "DASH", "url": "https://...", "drm": [ ... ], "headers": { ... }, "cookies": { ... }, "data": { ... } }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`cookies` gives names and values only. `cookie_jar` gives the same cookies with their domain, path and `secure` flag, in the `session_cookie_jar` form of the tracks response.
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `200` | - | Segment info returned. |
|
||||
@@ -1224,7 +1215,7 @@ A slow answer arrives as a [slow response](#slow-responses).
|
||||
|
||||
### `POST /api/session/{session_id}/keys/bad`
|
||||
|
||||
Report a content key from `vault_keys` that did not decrypt the track. The server flags the pair in its local vaults and reports it to the vault that served it, and the next licence for that KID reaches the CDM. When the CDM returns the same pair, the server removes the flag. The client never learns the server vault names.
|
||||
Report a content key from `vault_keys` that did not decrypt the track. The server flags the pair in its local vaults and reports it to the vault that served it, and the next licence for that KID reaches the CDM. The client never learns the server vault names.
|
||||
|
||||
```json
|
||||
{ "kid": "<kid_hex>", "key": "<key_hex>" }
|
||||
@@ -1232,7 +1223,7 @@ Report a content key from `vault_keys` that did not decrypt the track. The serve
|
||||
|
||||
| Status | Error code | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `200` | - | `{"flagged": true}`: the pair is flagged. `{"flagged": false}`: the CDM licensed the pair, so it is not flagged. |
|
||||
| `200` | - | The pair is flagged. |
|
||||
| `400` | `INVALID_INPUT` | This remote session was not served that pair. |
|
||||
| `404` | `SESSION_NOT_FOUND` | Unknown remote session. |
|
||||
|
||||
@@ -1248,7 +1239,6 @@ Return remote session metadata and validity.
|
||||
"service": "EXAMPLE",
|
||||
"valid": true,
|
||||
"expires_in": 300,
|
||||
"draining": false,
|
||||
"track_count": 4,
|
||||
"title_count": 10
|
||||
}
|
||||
|
||||
@@ -126,8 +126,8 @@ while the server restarts.
|
||||
| `SESSION_NOT_FOUND` | 404 | The remote-dl session does not exist or has expired. |
|
||||
| `TRACK_NOT_FOUND` | 404 | A referenced track ID is not present in the remote session. |
|
||||
| `CONFLICT` | 409 | The target resource is in a state that disallows the action (retrying a running job, prioritising a non-queued job, clearing cache during an active download). |
|
||||
| `SERVER_DRAINING` | 409 | The server is about to restart and starts no new remote session or download job. Open work continues. Retryable after the restart. A `dl --remote` client waits for the restart and opens a new remote session. |
|
||||
| `SERVICE_ERROR` | 422 | The streaming service's API returned an error, or the service does not support the requested operation, or the service code exited (`sys.exit`). |
|
||||
| `SERVER_DRAINING` | 409 | The server is about to restart and starts no new remote session or download job. Open work continues. Retryable after the restart. |
|
||||
| `SERVICE_ERROR` | 422 | The streaming service's API returned an error, or the service does not support the requested operation. |
|
||||
| `DRM_ERROR` | 422 | DRM or license acquisition failed. |
|
||||
| `RATE_LIMITED` | 429 | The streaming service is rate-limiting requests. Retryable. |
|
||||
|
||||
|
||||
@@ -62,11 +62,10 @@ remote_services:
|
||||
url: "https://my-box.example:8786"
|
||||
api_key: "your-api-key"
|
||||
# Optional: let the server's CDM do the licensing instead of a local CDM
|
||||
server_cdm: true
|
||||
# Optional: per-service config overrides applied locally (title_map, cdm, server_cdm, etc.)
|
||||
server_cdm: false
|
||||
# Optional: per-service config overrides applied locally (title_map, cdm, etc.)
|
||||
services:
|
||||
EXAMPLE:
|
||||
server_cdm: false # this service licenses with your local CDM
|
||||
title_map:
|
||||
"0ABCDEF": "The Show (Renamed Locally)"
|
||||
```
|
||||
@@ -75,8 +74,8 @@ remote_services:
|
||||
|---|---|---|
|
||||
| `url` | yes | Base URL of the `unshackle serve` instance (no trailing slash needed) |
|
||||
| `api_key` | no | Sent as the `X-Secret-Key` header on every request |
|
||||
| `server_cdm` | no | `true` asks for the server's CDM, `false` uses your local device; unset follows the API key's server CDM grant |
|
||||
| `services` | no | Per-service local config overrides, keyed by service tag in any case; a `server_cdm` here replaces the server entry's value for that service |
|
||||
| `server_cdm` | no | When `true`, DRM keys are resolved by the server's CDM rather than a local device (default `false`) |
|
||||
| `services` | no | Per-service local config overrides, keyed by service tag |
|
||||
|
||||
!!! warning "Port default"
|
||||
The `unshackle serve` default port is **`8786`** (not `8080`). Use the port
|
||||
@@ -215,10 +214,8 @@ hood the client walks a remote session through its lifecycle.
|
||||
downloading. A service can build an AdaptationSet of its own that the served
|
||||
manifest does not contain. Each such track gets a one-AdaptationSet MPD in
|
||||
`track_manifests`, and the client re-parses that instead. Any
|
||||
`session_headers` and cookies the server used are merged into the
|
||||
client's local HTTP session. Each cookie in `session_cookie_jar` keeps its
|
||||
domain, path and `secure` flag, so it goes only to its own hosts. `session_cookies` carries
|
||||
the same cookies as names and values only, for older clients.
|
||||
`session_headers` / `session_cookies` the server used are merged into the
|
||||
client's local HTTP session.
|
||||
|
||||
The tracks response repeats the title. A service can rewrite title fields inside
|
||||
`get_tracks`, so the client takes this copy in place of the one from the title
|
||||
@@ -268,17 +265,16 @@ hood the client walks a remote session through its lifecycle.
|
||||
|
||||
There are two ways DRM keys get resolved, chosen by the client's `server_cdm` flag.
|
||||
|
||||
=== "Proxied CDM (server_cdm: false)"
|
||||
=== "Proxied CDM (default)"
|
||||
|
||||
Your **local CDM** builds the license challenge. The client sends that challenge
|
||||
to `POST /api/session/{id}/license`, the server forwards it to the service, and
|
||||
the raw license bytes come back for your local CDM to parse.
|
||||
|
||||
- Keeps your CDM local. The server only relays the license request.
|
||||
- Used when `server_cdm` is `false`, or when it is unset and the API key has no server
|
||||
CDM for the service.
|
||||
- Also used for a run with `dl --cdm <name>`, and, when `server_cdm` is unset, for a
|
||||
service whose own entry in your `cdm` config named the loaded device. In each case the client sends
|
||||
- Used when `server_cdm` is `false` (the default).
|
||||
- Also used for a run with `dl --cdm <name>`, and for a service whose own entry in
|
||||
your `cdm` config named the loaded device. In each case the client sends
|
||||
`server_cdm: false` when it creates the remote session, and the server builds the
|
||||
service on your device even when the API key has the server CDM.
|
||||
- A service option that the service lists in `SERVER_DEVICE_OPTIONS` keeps the server
|
||||
@@ -305,11 +301,9 @@ There are two ways DRM keys get resolved, chosen by the client's `server_cdm` fl
|
||||
decodes, and a wrong pair goes back to `POST /api/session/{id}/keys/bad`. The
|
||||
server flags the pair in every local vault it holds, reports it to the vault
|
||||
that served it, and the next licence for that KID skips the pair and reaches
|
||||
the CDM. When the CDM returns the same pair, the server removes the flag,
|
||||
because then the client's check was wrong. A server with no local SQLite
|
||||
vault cannot store the flag. The server accepts a report only for a pair it
|
||||
served to that remote session, and does not flag a pair its CDM licensed.
|
||||
The client never learns the server vault names.
|
||||
the CDM. A server with no local SQLite vault cannot store the flag. The
|
||||
server accepts a report only for a pair it served to that remote session. The
|
||||
client never learns the server vault names.
|
||||
- A content key in the client's own vaults goes first, even when the server
|
||||
already answered. The client proves it, and a server key waits as the next
|
||||
candidate.
|
||||
@@ -469,7 +463,7 @@ object the dashboard shows as sent), and the track-selection hints `range_`, `vc
|
||||
`quality`, `best_available`, `generate_dv`, plus arbitrary service CLI options
|
||||
(`additionalProperties: true`).
|
||||
|
||||
`dl_params` holds the `dl` track selection: `lang`, `v_lang`, `a_lang` and `s_lang`
|
||||
`dl_params` holds the `dl` track selection: `lang`, `v_lang` and `a_lang`
|
||||
(arrays of language strings), `acodec` (an array of audio codec names, such as
|
||||
`EC3`), and `forced_subs` and `exact_lang` (booleans). The server gives these values to the
|
||||
service in `ctx.parent.params`, never as service options, so a service option
|
||||
@@ -627,15 +621,11 @@ existing file as a directory, and logs a warning.
|
||||
"service": "EXAMPLE",
|
||||
"valid": true,
|
||||
"expires_in": 300,
|
||||
"draining": false,
|
||||
"track_count": 12,
|
||||
"title_count": 40
|
||||
}
|
||||
```
|
||||
|
||||
`draining` is `true` after the operator starts a drain before a restart. The client reads
|
||||
it before each title, so it knows of the restart before it occurs.
|
||||
|
||||
!!! warning "`expires_in` is the configured TTL, not time remaining"
|
||||
The `expires_in` value reports the store's configured `session_ttl`, not the
|
||||
seconds left before this specific remote session expires.
|
||||
@@ -663,29 +653,9 @@ remote session API and a good template for any client.
|
||||
- **Flow.** `authenticate()` → `create` (+ poll `prompt` every 2s up to a 600s
|
||||
deadline, answering `pending_input` prompts. With stdin closed the client logs an
|
||||
error and raises `SystemExit(1)` instead of posting an empty answer) → `get_titles()` → `get_tracks()`
|
||||
(merging returned `session_headers`/`session_cookie_jar`, re-parsing `manifests`) →
|
||||
(merging returned `session_headers`/`session_cookies`, re-parsing `manifests`) →
|
||||
get the licence in proxy mode or `server_cdm` mode → `close()` (`DELETE`, saving any returned
|
||||
`cache`).
|
||||
- **Server restarts.** The server keeps remote sessions in memory only, so a restart
|
||||
loses them all. The client recovers in two ways:
|
||||
- A drain announced through `draining`: the client finishes the current title, then
|
||||
closes its remote session, so the drain can end and the refreshed cache comes back.
|
||||
It waits until `/api/health` reports the restarted server without `draining`,
|
||||
opens a new remote session, and continues with the next title.
|
||||
- A lost remote session (`SESSION_NOT_FOUND`, a connection error, a timeout, a closed
|
||||
tunnel or a gateway error page): the client waits for `/api/health`, then checks the
|
||||
old remote session. A live remote session takes the call again only after a connection
|
||||
error, because a timed-out call can already have run. A lost one is replaced: the
|
||||
client opens a new remote session, sends `titles` and the current title's `tracks`
|
||||
again, and then sends the failed call again. A title or track that the new remote
|
||||
session gives another ID keeps its old ID on the client, and the client sends the
|
||||
new ID. The client matches a title by season and episode number, and a track by its
|
||||
attributes.
|
||||
|
||||
The client waits up to 30 minutes for the server, which covers a deploy's drain. It
|
||||
stops with an error if the new remote session licenses differently from the old one,
|
||||
for example after a change to the API key's `server_cdm` grant. An interactive login
|
||||
asks for its input again.
|
||||
- **Server resolution.** `resolve_server()` reads `config.remote_services.<name>`
|
||||
into `{url, api_key, services, server_cdm}`, injecting the `server_cdm` flag into
|
||||
the services map as `_server_cdm`.
|
||||
@@ -694,7 +664,7 @@ remote session API and a good template for any client.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
!!! example "\"Could not connect to remote server at ...\""
|
||||
!!! example "\"Could not connect to remote server ... Is it running?\""
|
||||
The client could not reach the URL. Make sure that `unshackle serve` operates on
|
||||
the server, the `url`/port in `remote_services` are correct (default port `8786`),
|
||||
and any firewall or reverse proxy allows the connection.
|
||||
|
||||
@@ -284,7 +284,7 @@ do not give a `name`, unshackle derives a human-readable name from the language.
|
||||
`Video` adds `codec`, `range`, `bitrate`, `width`, `height`, `fps`, `scan_type`, and
|
||||
closed-caption descriptors. The relevant enums:
|
||||
|
||||
- **`Video.Codec`**: `AVC` (H.264), `HEVC` (H.265), `VC1`, `VP8`, `VP9`, `AV1`, `LCEVC`.
|
||||
- **`Video.Codec`**: `AVC` (H.264), `HEVC` (H.265), `VC1`, `VP8`, `VP9`, `AV1`.
|
||||
- **`Video.Range`**: `SDR`, `HLG`, `HDR10`, `HDR10P` (HDR10+), `DV` (Dolby Vision), and
|
||||
`HYBRID`. `HYBRID` is special: it tells the pipeline to select both an HDR10(+) base and
|
||||
a DV track and merge the DV RPU onto the HDR10 track with `dovi_tool` (see
|
||||
@@ -298,7 +298,7 @@ closed-caption descriptors. The relevant enums:
|
||||
|
||||
`Audio` adds `bitrate`, `channels`, `joc` (Joint Object Coding, the Atmos indicator),
|
||||
and `descriptive`. `Audio.Codec` covers `AAC`, `AC3` (`DD`), `EC3` (`DD+`), `AC4`,
|
||||
`OPUS`, `OGG` (Vorbis), `DTS`, `DTSX`, `DTSHD`, `MPEGH`, `ALAC`, `FLAC`, and `MP3`. The `atmos` property is `True` when
|
||||
`OPUS`, `OGG` (Vorbis), `DTS`, `DTSX`, `ALAC`, and `FLAC`. The `atmos` property is `True` when
|
||||
`joc` is set (or when `extra` flags it).
|
||||
|
||||
### `Subtitle`
|
||||
@@ -388,7 +388,7 @@ A typical `get_tracks` therefore looks like fetching the manifest text with
|
||||
## DRM hooks
|
||||
|
||||
If a track carries DRM, the framework licenses and decrypts it, but it needs your
|
||||
service to talk to the platform's license server. unshackle recognizes six DRM systems:
|
||||
service to talk to the platform's license server. unshackle recognizes five DRM systems:
|
||||
|
||||
| DRM class | System | License flow |
|
||||
|---|---|---|
|
||||
@@ -397,7 +397,6 @@ service to talk to the platform's license server. unshackle recognizes six DRM s
|
||||
| `ClearKeyCENC` | W3C `org.w3.clearkey` over CENC | JSON KID request → JWK set; no CDM |
|
||||
| `ClearKey` | HLS AES-128 | content key fetched directly from a URI; no CDM, no challenge |
|
||||
| `MonaLisa` | Proprietary WASM DRM | keys extracted locally; no license server |
|
||||
| `BlowfishStripe` | Blowfish CBC stripe cipher | the service gives the per-track key; no CDM, no license server |
|
||||
|
||||
!!! warning "`ClearKey` vs `ClearKeyCENC`"
|
||||
Despite the shared prefix these are entirely different systems. `ClearKey` is HLS
|
||||
@@ -457,7 +456,6 @@ the API surface.
|
||||
Two DV mechanisms sit on top of the track model. **DV fixup** re-exposes DV signalling on
|
||||
HLS and DASH streams that carry a valid DV RPU but advertise plain HEVC, with DV only in the
|
||||
supplemental codecs (`dv_compatible_bitstream`). `--list` shows such a track as `HDR10+DV` or `HDR10P+DV`.
|
||||
A service sets `hdr10_base` on a DV track that has an HDR10 base layer (DV profile 8.1), and `--list` shows it as `DV+HDR10`.
|
||||
**Hybrid** processing (`Video.Range.HYBRID`) selects an HDR10(+) base and a DV donor,
|
||||
extracts the RPU with `dovi_tool`, and injects it onto the base layer, to make a single
|
||||
track that carries both HDR10 metadata and the DV RPU. Both are automatic once the
|
||||
|
||||
@@ -159,6 +159,7 @@ The directories unshackle uses:
|
||||
| `wvds` | Widevine devices (`.wvd` files) | Yes |
|
||||
| `prds` | PlayReady devices (`.prd` files) | Yes |
|
||||
| `dcsl` | DCSL data | Yes |
|
||||
| `themes` | Your [theme files](../guide/themes.md) | Yes |
|
||||
| `services` | Search paths for service code (see below) | Yes |
|
||||
| `commands` | CLI command modules | Yes |
|
||||
| `vaults` | Vault modules | Yes |
|
||||
|
||||
@@ -268,7 +268,7 @@ download. For example, `dovi_tool` only matters if you download Dolby Vision vid
|
||||
| Tool | Binary looked up | Why it is needed |
|
||||
| --- | --- | --- |
|
||||
| Bento4 (`mp4decrypt`) | `mp4decrypt` | Alternative DRM decryptor to shaka-packager |
|
||||
| MP4Box (GPAC) | `MP4Box` | Muxing DTS:X Profile 2 (DTS-UHD) and MPEG-H audio |
|
||||
| MP4Box (GPAC) | `MP4Box` | Muxing DTS:X Profile 2 (DTS-UHD) audio |
|
||||
| dovi_tool | `dovi_tool` | Dolby Vision metadata handling |
|
||||
| HDR10Plus_tool | `hdr10plus_tool` | HDR10+ metadata handling |
|
||||
| SubtitleEdit | `seconv`, `SubtitleEdit` | Subtitle conversion (the `SeConv` CLI from 5.x) |
|
||||
@@ -280,8 +280,8 @@ download. For example, `dovi_tool` only matters if you download Dolby Vision vid
|
||||
| Docker | `docker` | Gluetun VPN proxy support |
|
||||
| Git | `git` | Fetching and updating remote service repositories |
|
||||
|
||||
!!! info "MP4Box is only used for DTS:X Profile 2 and MPEG-H"
|
||||
Titles with DTS:X Profile 2 (DTS-UHD) or MPEG-H audio mux to MP4; everything else muxes to MKV
|
||||
!!! info "MP4Box is only used for DTS:X Profile 2"
|
||||
Titles with DTS:X Profile 2 (DTS-UHD) audio mux to MP4; everything else muxes to MKV
|
||||
with `mkvmerge`. Install with `apt install gpac`.
|
||||
|
||||
!!! tip "SubtitleEdit specifics"
|
||||
|
||||
@@ -74,7 +74,7 @@ unshackle dl [OPTIONS] SERVICE [SERVICE ARGS...]
|
||||
| `-p`, `--profile` | - | Profile for credentials and cookies. |
|
||||
| `-q`, `--quality` | best | Resolution(s), comma-separated, e.g. `1080,720`. `-q 1080` also matches anamorphic tracks by 16:9 canvas. |
|
||||
| `-v`, `--vcodec` | any | Video codec(s). Accepts names or values: `AVC`/`H.264`/`H264`, `HEVC`/`H.265`/`H265`, `VC1`/`VC-1`, `VP8`, `VP9`, `AV1`. |
|
||||
| `-a`, `--acodec` | any | Audio codec(s), comma-separated. Accepts `AAC`, `AC3`/`DD`, `EC3`/`DD+`/`eac3`/`ddp`, `AC4`/`AC-4`, `OPUS`, `OGG`/`VORB`/`vorbis`, `DTS`, `DTSX`/`DTS-X`, `ALAC`, `FLAC`, `MP3`. |
|
||||
| `-a`, `--acodec` | any | Audio codec(s), comma-separated. Accepts `AAC`, `AC3`/`DD`, `EC3`/`DD+`/`eac3`/`ddp`, `AC4`/`AC-4`, `OPUS`, `OGG`/`VORB`/`vorbis`, `DTS`, `DTSX`/`DTS-X`, `ALAC`, `FLAC`. |
|
||||
| `-vb`, `--vbitrate` | highest | Exact video bitrate in kbps. |
|
||||
| `-ab`, `--abitrate` | highest | Exact audio bitrate in kbps. |
|
||||
| `-vb-range`, `--vbitrate-range` | - | Video bitrate range in kbps, e.g. `6000-7000`; picks highest within. Mutually exclusive with `--vbitrate`. |
|
||||
@@ -339,7 +339,7 @@ unshackle cfg [KEY] [VALUE] [OPTIONS]
|
||||
| `--list` | List all set configuration values. |
|
||||
|
||||
!!! warning "Comments are stripped"
|
||||
Writing a value through `cfg` rewrites the configuration file and **removes all comments** from it. If your config relies on comments, edit it by hand instead. Setting a value and using `--unset` together is an error. If a config key is set twice in the same block, every command warns with the line numbers of the two copies and uses the later copy. `cfg` stops without a change.
|
||||
Writing a value through `cfg` rewrites the configuration file and **removes all comments** from it. If your config relies on comments, edit it by hand instead. Setting a value and using `--unset` together is an error.
|
||||
|
||||
!!! example
|
||||
```shell
|
||||
@@ -391,10 +391,15 @@ Shows the location unshackle loaded the configuration file from. If it found no
|
||||
### `env theme`
|
||||
|
||||
```
|
||||
unshackle env theme
|
||||
unshackle env theme [NAME]
|
||||
```
|
||||
|
||||
Prints a sample of every available CLI theme. Each sample has colour swatches, help text with option rows, and a track listing with video, audio and subtitle entries. It also has log lines, a progress bar, and the gradient pulse bar. unshackle marks the active theme and shows each theme's aliases. Set your choice with the [`theme`](../reference/configuration/misc.md#appearance) config key.
|
||||
Without `NAME`, lists every theme with its source (shipped or user), its colours and the active
|
||||
mark. A theme file that is not valid shows with the reason. The list also shows the folder of your
|
||||
theme files. With `NAME`, prints a sample of that theme: a rule with its name, the banner, colour
|
||||
swatches, help text with option rows, a track listing, log lines, a progress bar and a pulse bar.
|
||||
In a terminal at least 80 columns wide, the sample moves for 5 seconds. Set your choice with
|
||||
the [`theme`](../reference/configuration/misc.md#appearance) config key. See [Themes](themes.md).
|
||||
|
||||
### `env clear`
|
||||
|
||||
@@ -429,8 +434,6 @@ unshackle kv COMMAND [ARGS]...
|
||||
|
||||
Copy content keys from one or more source vaults into a destination vault. unshackle skips rows whose KIDs match, unless the existing row has no content key. unshackle never alters or deletes existing data.
|
||||
|
||||
A vault argument is the name of a vault in the config, or the path to an SQLite vault file. Use a path to import a vault file that is not in the config.
|
||||
|
||||
| Option | Description |
|
||||
|---|---|
|
||||
| `-s`, `--service` | Only copy data for a specific service. |
|
||||
@@ -464,7 +467,6 @@ Make service tables on vaults that use tables, for every installed service, wher
|
||||
```shell
|
||||
unshackle kv copy main backup1 backup2
|
||||
unshackle kv copy main backup -s EXAMPLE
|
||||
unshackle kv copy main ~/Downloads/key_store.db -s EXAMPLE
|
||||
unshackle kv sync main mysql_vault
|
||||
unshackle kv add keys.txt EXAMPLE main backup
|
||||
unshackle kv search 0123456789abcdef0123456789abcdef -s EXAMPLE -v main
|
||||
|
||||
@@ -119,13 +119,9 @@ either enum **names** or their **values**, comma-separated.
|
||||
| `VP8` | `VP8` |
|
||||
| `VP9` | `VP9` |
|
||||
| `AV1` | `AV1` |
|
||||
| `LCEVC` | `LCEVC` |
|
||||
|
||||
`H264` and `H265` are aliases of `AVC` and `HEVC`.
|
||||
|
||||
An LCEVC (MPEG-5 Part 2) track only adds detail on top of its base video track and cannot play
|
||||
alone, so unshackle selects it only when you ask for it with `-v LCEVC`.
|
||||
|
||||
```shell title="Either spelling works"
|
||||
unshackle dl -v HEVC EXAMPLE 81234567
|
||||
unshackle dl -v H.265 EXAMPLE 81234567
|
||||
@@ -284,11 +280,8 @@ bitrate for the top renditions, overriding the manifest value:
|
||||
| `OGG` | `VORB` | Vorbis |
|
||||
| `DTS` | `DTS` | DTS |
|
||||
| `DTSX` | `DTS-X` | DTS:X Profile 2 (DTS-UHD) |
|
||||
| `DTSHD` | `DTS-HD` | DTS-HD High Resolution, Master Audio and Express |
|
||||
| `MPEGH` | `MPEG-H` | MPEG-H 3D Audio |
|
||||
| `ALAC` | `ALAC` | Apple Lossless |
|
||||
| `FLAC` | `FLAC` | FLAC |
|
||||
| `MP3` | `MP3` | MPEG-1 Audio Layer III |
|
||||
|
||||
unshackle accepts names, values, and a few aliases: `eac3` and `ddp` both give `EC3`,
|
||||
and `vorbis` gives `OGG`.
|
||||
|
||||
@@ -41,7 +41,7 @@ then decrypts the file with those keys.
|
||||
|
||||
## Supported DRM systems
|
||||
|
||||
unshackle implements six DRM systems. Only the first two need a device file and a
|
||||
unshackle implements five DRM systems. Only the first two need a device file and a
|
||||
license-server handshake. The rest are special cases.
|
||||
|
||||
| System | Device file | License flow | Decryption |
|
||||
@@ -51,7 +51,6 @@ license-server handshake. The rest are special cases.
|
||||
| **ClearKey (CENC)**, W3C EME `org.w3.clearkey` | none | JSON `{"kids":[...],"type":"temporary"}` → license server returns a JWK Set. No CDM. | shaka-packager / mp4decrypt |
|
||||
| **ClearKey (HLS)**, AES-128 `EXT-X-KEY` | none | Key fetched directly from a URI or `data:` URL. No CDM, no challenge. | in-process AES-CBC |
|
||||
| **MonaLisa** (proprietary, WASM) | `.mld` | Ticket from the service API; keys extracted locally via WASM. No license server. | ML-Worker binary + AES-ECB, per segment |
|
||||
| **Blowfish stripe** | none | The service gives the per-track key. No CDM, no license server. | in-process Blowfish-CBC on every third 2048-byte chunk |
|
||||
|
||||
!!! warning "Two different ClearKeys"
|
||||
"ClearKey (HLS)" and "ClearKey (CENC)" are entirely different systems that happen
|
||||
|
||||
@@ -15,7 +15,7 @@ When a download finishes, unshackle builds the final path from three pieces:
|
||||
- **Output directory**: `directories.downloads` from your config, or whatever you pass to `-o/--output` on the command line for a single run.
|
||||
- **Folder template**: an optional per-title subfolder. unshackle **always** puts TV episodes and songs in a folder. Movies only get one if you define a `movies` folder template, or a single-string `folder` template that applies to all title kinds (see [Folder templates](#folder-templates)).
|
||||
- **Filename template**: the `output_template` for the title kind (movie, series, or song).
|
||||
- **Extension**: chosen by the muxer for a movie or an episode: `.mkv` for video, `.mka` for audio-only, `.mks` for subtitle-only, `.mp4` for [DTS:X Profile 2 and MPEG-H audio](#dtsx-profile-2-and-mpeg-h-output). unshackle does not mux a song. It remuxes a song into the container of its codec, such as `.flac`, `.opus`, or `.m4a`. Read [Music output files](#music-output-files).
|
||||
- **Extension**: chosen by the muxer for a movie or an episode: `.mkv` for video, `.mka` for audio-only, `.mks` for subtitle-only, `.mp4` for [DTS:X Profile 2 audio](#dtsx-profile-2-output). unshackle does not mux a song. It remuxes a song into the container of its codec, such as `.flac`, `.opus`, or `.m4a`. Read [Music output files](#music-output-files).
|
||||
|
||||
!!! example "A typical episode path"
|
||||
```text
|
||||
@@ -163,9 +163,9 @@ For custom templates there is also a standalone [`{part}`](../reference/configur
|
||||
|
||||
| Variable | Meaning | Example |
|
||||
|---|---|---|
|
||||
| `audio` | Audio codec; rename it with [`codec_names`](../reference/configuration/output.md#codec_names) | `DDP`, `DD`, `AAC`, `DTS-X` |
|
||||
| `audio` | Audio codec | `DDP`, `DD`, `AAC`, `DTS-X` |
|
||||
| `audio_channels` | Channel layout; bed.LFE.heights when the track has height channels | `5.1`, `2.0`, `5.1.4` |
|
||||
| `audio_full` | Codec + channels combined; a name that ends in a digit gets a separator | `DDP5.1`, `DTS-X.5.1.4`, `AC-4.2.0` |
|
||||
| `audio_full` | Codec + channels combined | `DDP5.1`, `DTS-X.5.1.4` |
|
||||
| `atmos` | `Atmos` when any track carries JOC | `Atmos` |
|
||||
| `dual` | `DUAL` for two audio languages (see [`dual_multi_mode`](../reference/configuration/download.md#dual_multi_mode)) | `DUAL` |
|
||||
| `multi` | `MULTi` for more than two audio languages | `MULTi` |
|
||||
@@ -236,7 +236,6 @@ final path.
|
||||
| FLAC | `.flac` |
|
||||
| Opus | `.opus` |
|
||||
| Vorbis | `.ogg` |
|
||||
| MP3 | `.mp3` |
|
||||
| AAC, ALAC, and all other codecs | `.m4a` |
|
||||
|
||||
unshackle re-encodes FLAC in this step. The audio does not change, but the new file states its
|
||||
@@ -285,87 +284,11 @@ warning and continues.
|
||||
!!! note "Height channels"
|
||||
A track with height channels is named bed.LFE.heights, such as `5.1.4`.
|
||||
|
||||
### Track names and language tags
|
||||
### DTS:X Profile 2 output
|
||||
|
||||
When the service gives a track no name, unshackle names it with the English name of its language,
|
||||
such as `English`, `Portuguese (Portugal)` or `Spanish (Latin America)`. The name leaves out the
|
||||
region that is the default for the language, so `en-US` is `English` and `pt-BR` is `Portuguese`,
|
||||
but `en-GB` is `English (United Kingdom)`. A name from the service is kept as is. unshackle adds the SDH, CC, Forced or Descriptive label after either name.
|
||||
|
||||
A subtitle in a language with more than one script gets the script from its region:
|
||||
|
||||
| Service tag | Tag in the file | Track name |
|
||||
|-------------|-----------------|------------|
|
||||
| `zh-TW` | `zh-Hant-TW` | Chinese (Traditional) |
|
||||
| `zh-HK` | `zh-Hant-HK` | Chinese (Traditional, Hong Kong) |
|
||||
| `zh-CN` | `zh-Hans-CN` | Chinese (Simplified) |
|
||||
| `sr-ME` | `sr-Latn-ME` | Serbian (Latin, Montenegro) |
|
||||
| `zh` | `zh` | Chinese |
|
||||
|
||||
A tag without a region, such as `zh`, gets no script because the region is what tells the script.
|
||||
unshackle writes audio tags as the service gives them, because a script applies only to written text.
|
||||
Track selection, `--list` tags and file names use the service tag.
|
||||
|
||||
Set `muxing.track_names` to `native` to name each track in its own language. The same rules apply
|
||||
to the script and the region:
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
muxing:
|
||||
track_names: native
|
||||
```
|
||||
|
||||
| Service tag | Track name |
|
||||
|-------------|------------|
|
||||
| `zh-TW` subtitle | 中文(繁體) |
|
||||
| `zh-HK` subtitle | 中文(繁體,香港) |
|
||||
| `pt-PT` | Português (Portugal) |
|
||||
| `es-419` | Español (Latinoamérica) |
|
||||
| `ja-JP` | 日本語 |
|
||||
|
||||
Set `muxing.track_names` to `none` to leave a track unnamed when the service gives it no name. An
|
||||
SDH, CC, Forced or Descriptive track then has only that label as its name.
|
||||
|
||||
The option also changes the names in `--list` and in the `track_name` field of the REST API.
|
||||
|
||||
Set `muxing.original_label` to add a label after the name of each audio and subtitle track in the
|
||||
title's original language. unshackle also sets the Matroska original flag on these tracks, but some
|
||||
players show only the name. MP4 output has no original flag, so there the label is the only marker:
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
muxing:
|
||||
original_label: "[Original]"
|
||||
```
|
||||
|
||||
| Track | Track name |
|
||||
|-------|------------|
|
||||
| Japanese audio, original language | Japanese [Original] |
|
||||
| Japanese SDH subtitle, original language | Japanese [Original] (SDH) |
|
||||
| Korean subtitle | Korean |
|
||||
|
||||
The label can be any text, for example `"| Original"` or a label in another language. Put it in
|
||||
quotes: YAML reads an unquoted `[Original]` as a list, and an unquoted `| Original` stops the config
|
||||
from loading. unshackle ignores a value that is not text.
|
||||
|
||||
The label also applies to a name that the service sets, and to audio that a service keeps inside the
|
||||
video file. unshackle does not add the label when the name already contains its words, so a service
|
||||
name `Original` or `Japanese (original)` stays as it is.
|
||||
|
||||
!!! tip "Use an English label with Jellyfin 12"
|
||||
Jellyfin 12 adds its own "Original" to an original-language audio track from the flag, unless the
|
||||
name already contains the word. It adds none to a subtitle. A label in another language, such as `[원어]`, then shows next to Jellyfin's
|
||||
"Original".
|
||||
|
||||
!!! note "Players that show the language next to the name"
|
||||
Some players, such as Jellyfin, show the track name and the language name together. They leave
|
||||
out the language when the name already contains it, so an English name shows once. A native name
|
||||
such as `日本語` shows next to `Japanese` in an English interface.
|
||||
|
||||
### DTS:X Profile 2 and MPEG-H output
|
||||
|
||||
A title whose audio holds a `dtsx` or `dtsy` sample entry (DTS:X Profile 2, DTS-UHD), or an
|
||||
MPEG-H sample entry (`mha1`, `mha2`, `mhm1`, `mhm2`), muxes to MP4 with
|
||||
[MP4Box](../getting-started/installation.md), because Matroska has no CodecID for it.
|
||||
Without MP4Box installed the mux stops.
|
||||
A title whose audio holds a `dtsx` or `dtsy` sample entry (DTS:X Profile 2, DTS-UHD) muxes
|
||||
to MP4 with [MP4Box](../getting-started/installation.md), because Matroska has no CodecID
|
||||
for it. Without MP4Box installed the mux stops.
|
||||
|
||||
DTS:X Profile 1 is DTS-HD Master Audio and muxes to MKV as usual.
|
||||
|
||||
@@ -508,6 +431,7 @@ directories:
|
||||
| `exports` | Export JSONs. |
|
||||
| `services`, `vaults`, `fonts`, `commands` | Search paths for services, key-vault backends, bundled fonts, and CLI commands. |
|
||||
| `wvds`, `prds`, `dcsl` | Widevine devices, PlayReady devices, and DCSL data. |
|
||||
| `themes` | Your [theme files](themes.md). |
|
||||
|
||||
Paths can hold a `~` for expansion. unshackle protects the names `app_dirs`, `core_dir`, `namespace_dir`, `user_configs`, and `data`, so you cannot change them.
|
||||
|
||||
|
||||
@@ -125,18 +125,14 @@ forwarder for it. See [Control D](#control-d).
|
||||
### Provider load order
|
||||
|
||||
When you do a download without `--no-proxy`, unshackle instantiates every configured
|
||||
proxy provider once. It uses that same order for bare-query resolution:
|
||||
proxy provider once, in this fixed order. It uses that same order for bare-query
|
||||
resolution:
|
||||
|
||||
1. Basic is always first, so your own proxies win.
|
||||
2. The other proxy providers follow in the order of their keys under `proxy_providers` in
|
||||
`unshackle.yaml`. Proxy providers that load without a config key, such as Hola, come
|
||||
after the listed ones in this default order:
|
||||
**ExpressVPN → NordVPN → Proton VPN → Surfshark → Windscribe → Gluetun → Hola**
|
||||
3. Control D is always last.
|
||||
**Basic → ExpressVPN → NordVPN → Proton VPN → Surfshark → Windscribe → Gluetun → Hola → Control D**
|
||||
|
||||
So if you list `windscribevpn` above `nordvpn` and use `--proxy us`, a `us` entry in your
|
||||
Basic config answers first, then Windscribe. To skip ahead to a specific proxy provider,
|
||||
prefix the query (`--proxy nordvpn:us`).
|
||||
So if you have both Basic and NordVPN configured and use `--proxy us`, a `us` entry in
|
||||
your Basic config wins, because unshackle tries Basic first. To skip ahead to a specific
|
||||
proxy provider, prefix the query (`--proxy nordvpn:us`).
|
||||
|
||||
If a proxy provider cannot load, for example because its server list cannot be fetched
|
||||
or its config is not valid, unshackle logs a warning and continues with the other proxy
|
||||
@@ -315,17 +311,9 @@ machine opens none, because the client opens the connection to the server. A NAT
|
||||
firewall, or a Cloudflare tunnel in front of the server does not stop it.
|
||||
|
||||
The service traffic stays encrypted from the server to the service, so the client relays only
|
||||
encrypted bytes. The client refuses to connect to `localhost`, and to a host name that resolves
|
||||
only to an address on your machine or local network: loopback, private, link-local, CGNAT
|
||||
(`100.64.0.0/10`) or multicast. An IP address that the server sends must also be public, and
|
||||
the client closes a connection that reaches one of its own addresses. Other devices on your
|
||||
network that have a public IPv6 address, and your router's public address, are not blocked.
|
||||
|
||||
Some VPN and proxy apps answer a host name with a synthetic address, for example fake-IP DNS in
|
||||
TUN mode (`198.18.0.0/15`), and map it back to the real host. The client accepts any such
|
||||
address for a host name, so `--local-proxy` works with these apps. The client cannot see the
|
||||
real address behind a synthetic one, so it cannot stop a host name that points into your local
|
||||
network.
|
||||
encrypted bytes. The client refuses to connect to `localhost`, and to a host name or IP address
|
||||
that resolves only to a loopback, private or link-local address, so the server cannot reach
|
||||
your local network.
|
||||
|
||||
!!! note "Each request crosses the tunnel twice"
|
||||
A request from the server goes to your machine and then to the service, so it takes
|
||||
@@ -567,7 +555,8 @@ in unshackle itself.
|
||||
|
||||
!!! warning "Docker is required"
|
||||
Gluetun needs a working [Docker](https://docs.docker.com/get-docker/) installation on
|
||||
your `PATH`. If Docker is not found, the proxy provider fails to load. The container also needs the `NET_ADMIN` capability and access
|
||||
your `PATH`. If Docker is not found, the proxy provider fails to load with an error linking
|
||||
to the install docs. The container also needs the `NET_ADMIN` capability and access
|
||||
to `/dev/net/tun` to bring up the tunnel. unshackle requests both automatically.
|
||||
|
||||
### Query format
|
||||
@@ -650,7 +639,6 @@ proxy_providers:
|
||||
- `surfshark`, `mullvad`, and `ivpn` also require `addresses`.
|
||||
- `windscribe` additionally requires **both** `addresses` and `preshared_key`
|
||||
(`preshared_key` may be an empty string, but the config key must be present).
|
||||
Get both from the [Windscribe WireGuard config generator](https://windscribe.com/getconfig/wireguard).
|
||||
- NordVPN and Proton VPN need only `private_key`.
|
||||
|
||||
=== "OpenVPN"
|
||||
@@ -1037,14 +1025,21 @@ The returned proxy is HTTPS on **port 443**.
|
||||
|
||||
## Developer notes
|
||||
|
||||
!!! note "One resolution path (developers)"
|
||||
`dl`, `search`, the REST API handlers and the remote-service client all load proxy
|
||||
providers through `load_proxy_providers()` in `unshackle/core/proxies/resolve.py`.
|
||||
The REST API and the remote-service client call it through
|
||||
`initialize_proxy_providers()`, which leaves out Gluetun because Gluetun starts a
|
||||
local Docker container. All paths accept the same query grammar: a direct URI, a
|
||||
`provider:query`, a bare query tried against providers in order, or a `controld://`
|
||||
resolver.
|
||||
!!! note "Two resolution paths (developers)"
|
||||
unshackle has **two** proxy-resolution code paths that are intentionally not
|
||||
identical:
|
||||
|
||||
- `unshackle/commands/dl.py` inlines its own logic and loads **all nine** providers,
|
||||
including Windscribe and Gluetun.
|
||||
- `unshackle/core/proxies/resolve.py::initialize_proxy_providers()` is the shared
|
||||
resolver used by the REST API handlers and the remote-service client. It **omits**
|
||||
Windscribe and Gluetun.
|
||||
|
||||
Both paths accept the same query grammar (a direct URI, a `provider:query`, a bare
|
||||
country query tried against providers in order, or a `controld://` resolver), but the
|
||||
set of available providers differs. Keep this in mind when you add a proxy provider:
|
||||
an entry in `dl.py` does not make it available over the API, and the opposite is also
|
||||
true.
|
||||
|
||||
The remote-service client resolves `--proxy` with its own
|
||||
`resolve_remote_proxy_arg()`. It changes a `controld:` query to a `controld://`
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
# Themes
|
||||
|
||||
A theme sets the colours of all CLI output: the banner, logs, track listings, progress bars and
|
||||
help screens. Every theme is a small theme file in YAML, so you can change any colour, blend
|
||||
colours into gradients, make a new theme from a shipped one, and give your theme to other people
|
||||
as one file.
|
||||
|
||||
unshackle ships these themes:
|
||||
|
||||
| Theme | Look |
|
||||
|-------|------|
|
||||
| `unshackle` | The default: soft pastels on a dark blue-grey background. |
|
||||
| `rainbow` | The `unshackle` colours with every [gradient](#gradients) on. |
|
||||
| `nord` | Cool arctic blues with an aurora purple accent. |
|
||||
| `catppuccin-mocha` | Catppuccin Mocha pastels. |
|
||||
| `dracula` | Dark purple-grey with vivid pink and green. |
|
||||
| `flexoki` | Warm ink-on-paper tones. |
|
||||
| `gruvbox` | Retro warm browns and yellows. |
|
||||
| `monokai` | High-contrast greens and pinks on charcoal. |
|
||||
| `one-dark` | Muted blues and purples on slate. |
|
||||
| `solarized-dark` | Teal-black background with precise accents. |
|
||||
| `tokyo-night` | Deep navy with neon blues and purples. |
|
||||
|
||||
Select a theme with the [`theme`](../reference/configuration/misc.md#appearance) config key:
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
theme: nord
|
||||
```
|
||||
|
||||
## List and preview themes
|
||||
|
||||
```
|
||||
unshackle env theme # list every theme, its source and its colours
|
||||
unshackle env theme nord # show a full sample of one theme
|
||||
```
|
||||
|
||||
The list marks the active theme and shows the folder unshackle reads your theme files from. A
|
||||
theme file that is not valid shows in the list with the reason.
|
||||
|
||||
In a terminal at least 80 columns wide, the sample of one theme moves for 5 seconds: the banner, rule and panel gradients,
|
||||
a progress bar and a pulse bar. The sample stops when the progress bar is full. If the sample is
|
||||
taller than the terminal, only the bars move.
|
||||
|
||||
## Make a theme
|
||||
|
||||
1. Make a file named `<name>.yaml` (or `<name>.yml`) in your themes folder. The folder is
|
||||
[`directories.themes`](../reference/configuration/directories.md); `unshackle env theme` shows
|
||||
its path. The file name is the theme name. Case does not matter, and `_` reads as `-`. Do not
|
||||
give the file one of the [other names](#when-unshackle-does-not-use-a-theme) of the shipped
|
||||
themes, such as `default.yaml`: unshackle does not read it.
|
||||
2. Set the colours that you want to change. Each role that you do not set comes from the
|
||||
`extends` theme.
|
||||
3. Set `theme: <name>` in `unshackle.yaml`, then preview it with `unshackle env theme <name>`.
|
||||
|
||||
!!! warning "Keep the themes folder outside the installed package"
|
||||
By default, the themes folder is inside the unshackle package folder. If you installed with
|
||||
`uv tool install`, a `uv tool upgrade` deletes the package folder and your themes with it. Set
|
||||
[`directories.themes`](../reference/configuration/directories.md) to a folder outside the
|
||||
package, for example `~/.config/unshackle/themes`. If a data folder is inside the package,
|
||||
`unshackle setup` shows a warning and the `directories:` settings to add.
|
||||
|
||||
```yaml title="themes/custom/my-nord.yaml"
|
||||
extends: nord # start from this shipped theme
|
||||
accent: "#88c0d0" # the brand accent: banner, titles, progress bars
|
||||
text2: "#9aa4b8"
|
||||
styles:
|
||||
progress.data.speed: bold accent
|
||||
author: your name # optional, unshackle does not read it
|
||||
description: Nord with a frost accent.
|
||||
```
|
||||
|
||||
!!! warning "Put colours in quotes"
|
||||
YAML reads `#` as the start of a comment, so an unquoted `pink: #b48ead` is an empty value.
|
||||
YAML also reads an unquoted `on`, `off`, `yes` or `no` as true or false. A role or a style that
|
||||
YAML does not read as text makes the theme not valid, and unshackle does not use it.
|
||||
|
||||
### `extends`
|
||||
|
||||
`extends` names the shipped theme that the file starts from, for example `nord`. Without
|
||||
`extends`, a file named like a shipped theme starts from that theme, and any other file starts
|
||||
from `unshackle`. A file named `nord.yaml` replaces the shipped `nord` theme, and it can still
|
||||
use `extends: nord` to start from the shipped colours.
|
||||
|
||||
`extends` cannot name one of your own themes, so a theme that you give to another person always
|
||||
works on their computer.
|
||||
|
||||
### Roles
|
||||
|
||||
A theme has 14 roles. Each role is one colour: a colour name (`magenta`), 6-digit hex (`"#88c0d0"`),
|
||||
or `rgb(136,192,208)`. Rich does not accept 3-digit hex such as `#fff`.
|
||||
|
||||
| Role | Used for |
|
||||
|------|----------|
|
||||
| `text` | Body text, option names, help text. |
|
||||
| `text2` | Secondary detail lines, the second part of a docstring. |
|
||||
| `pink` | The brand accent: banner, titles, panel borders on help screens, progress bars. You can also write it as `accent`; do not set both. |
|
||||
| `red` | Errors and required options. |
|
||||
| `green` | Success, option switches, a finished progress bar. |
|
||||
| `yellow` | Warning text, metavars and usage lines. |
|
||||
| `blue` | Blue text in markup and listings. |
|
||||
| `cyan` | Numbers and arguments. |
|
||||
| `gray` | Dim details such as option defaults. |
|
||||
| `bright_gray` | Light grey details. |
|
||||
| `dark_gray` | Rules, table lines, the empty part of a progress bar. |
|
||||
| `black` | Very dark details, and the Rich colour `grey23`. |
|
||||
| `bright_black` | Panel borders and tree guides in listings. |
|
||||
| `bg` | The background, used only when [`set_terminal_bg`](../reference/configuration/misc.md#logging-privacy-debug) is on. |
|
||||
|
||||
The role names are also markup names in unshackle and in services (`[text2]`, `[yellow]`), so
|
||||
they do not change between versions. The terminal colour names `magenta`, `bright_red`,
|
||||
`bright_green`, `bright_yellow`, `bright_blue`, `bright_magenta` and `bright_cyan` take the colour
|
||||
of the matching role. To change one of them alone, set it under `styles`.
|
||||
|
||||
### `styles`
|
||||
|
||||
`styles` sets any [Rich style](https://rich.readthedocs.io/en/stable/style.html) by its name,
|
||||
for example `progress.data.speed`, `bar.complete`, `rule.line` or `logging.level.info`. A value
|
||||
is a Rich style string, and it can use role names in any case, which take the theme's colours:
|
||||
|
||||
```yaml
|
||||
styles:
|
||||
bar.complete: bold accent
|
||||
rule.line: dark_gray
|
||||
logging.level.warning: bold yellow on black
|
||||
```
|
||||
|
||||
A role name cannot be a style name under `styles`; set the role at the top level of the file. A
|
||||
style cannot use the `link` or `conceal` attributes, so a shared theme cannot hide output or turn
|
||||
text into a link. Help screens use the roles only, so `styles` does not change them.
|
||||
`unshackle cfg` edits only `unshackle.yaml`, so edit the theme file to change a style.
|
||||
|
||||
The log level labels (`INFO`, `WARNING`, `ERROR`) keep the terminal's own colours. To theme them,
|
||||
set them under `styles`, for example `logging.level.info: blue`.
|
||||
|
||||
### `gradients`
|
||||
|
||||
`gradients` draws a part of the CLI in colours that blend from one to the next, for example a
|
||||
rainbow banner. Give each part a list of colour stops. A stop is a role name or a colour, as for
|
||||
a role. The shipped `rainbow` theme sets every part; `unshackle env theme rainbow` shows them
|
||||
move:
|
||||
|
||||
```yaml title="rainbow.yaml"
|
||||
gradients:
|
||||
banner: [red, "#fab387", yellow, green, cyan, blue, pink]
|
||||
bar: [red, yellow, green, cyan, blue, pink]
|
||||
pulse: [dark_gray, red, yellow, green, blue, pink]
|
||||
rule: [red, yellow, green, cyan, blue, pink]
|
||||
panel: [red, yellow, green, blue]
|
||||
direction: diagonal
|
||||
motion: scroll
|
||||
```
|
||||
|
||||
| Key | What it draws |
|
||||
|-----|---------------|
|
||||
| `banner` | The ASCII banner on start and on help screens. During `dl`, the banner stays at the top of the screen and moves. |
|
||||
| `bar` | The full part of a running progress bar. A finished bar keeps `bar.finished`. |
|
||||
| `pulse` | The moving bar of a task with no known size, such as muxing. Without it, `[dark_gray, pink]`. |
|
||||
| `rule` | The line of a section rule such as `Service: EXAMPLE`. A rule always blends from left to right. |
|
||||
| `panel` | The border of a boxed listing such as `Available Tracks`. The title and the lines inside keep their colours. |
|
||||
| `direction` | How `banner` and `panel` blend: `horizontal` (the default), `vertical` or `diagonal`. |
|
||||
| `motion` | `static` (the default) keeps the colours fixed along `bar`. `scroll` moves them along the bar. |
|
||||
|
||||
A part without a list keeps its normal colour. A single colour (`rule: blue`) draws the part in
|
||||
that colour. A terminal with fewer colours shows the nearest colours it has.
|
||||
|
||||
With a `banner` gradient, `dl` keeps the banner at the top of the screen while it runs. The newest
|
||||
output shows under the banner and the progress bars show at the bottom. Older lines scroll off the
|
||||
top into the scrollback. The gradients of the banner, and of the rules and panel borders on the
|
||||
screen, move. This happens only in a colour terminal at least 80 columns wide, and not for the
|
||||
help of `dl` (`--help`, `-h` or `-?`). To keep the banner still, remove `banner` from `gradients`.
|
||||
|
||||
## Give a theme to other people
|
||||
|
||||
Send the theme file. The other person puts it in their themes folder and sets `theme:` to its name.
|
||||
A theme file holds only colours, style strings and gradient settings, and unshackle reads it as
|
||||
data, never as code.
|
||||
|
||||
## When unshackle does not use a theme
|
||||
|
||||
If the theme name is unknown, or the file has an error, unshackle logs a warning with the reason
|
||||
and uses the shipped `unshackle` theme. The reason names the file and the role, for example
|
||||
`my-nord.yaml: pink is empty (put hex values in quotes), using the unshackle theme`. A file with an unknown key is not valid, so a misspelt key does
|
||||
not go unseen.
|
||||
|
||||
These names are other names for shipped themes: `default` (`unshackle`), `catppuccin` and
|
||||
`mocha` (`catppuccin-mocha`), `onedark` (`one-dark`), `solarized` (`solarized-dark`) and
|
||||
`tokyonight` (`tokyo-night`). unshackle does not read a theme file with one of these names, or a
|
||||
file whose name has a character that the terminal does not print.
|
||||
|
||||
If unshackle cannot read the themes folder, it logs a warning and uses only the shipped themes.
|
||||
@@ -258,11 +258,6 @@ Each command reports how many files it removed and how much space it freed, then
|
||||
|
||||
**Inspect:** set `debug_requests: true` and operate unshackle with `-d` to show the underlying `urllib3` / `rnet` / `httpx` logs. In the JSON debug log, filter for `service_call` operations to see which request failed. If you use a proxy, also read [Proxies & VPN](proxies-and-vpn.md).
|
||||
|
||||
!!! example "A segment download fails after every retry"
|
||||
**Symptom:** the download stops with a line like `MaxRetriesError: GET <host> failed: RequestError (stream closed because of a broken pipe), gave up after 5 failed attempts over 30s`.
|
||||
|
||||
**Inspect:** the connection to the CDN host dropped on every attempt. This is almost always the network, the VPN, or the proxy, not the service. Run the download again: unshackle keeps the segments it already has. Over HTTP/2, all segments share one connection, so one drop fails every segment in flight. Set `network.http1_only: true` (see [Network & proxy](../reference/configuration/network.md)) to spread them over separate connections. Operate unshackle with `-d` to see each retry as a `segment_retry` entry in the JSON debug log.
|
||||
|
||||
!!! example "The wrong titles/metadata keep coming back"
|
||||
**Symptom:** a service returns outdated titles even after the source changed.
|
||||
|
||||
|
||||
+2
-12
@@ -34,11 +34,11 @@ unshackle pushes keys from every source, not only a local CDM. A run against a r
|
||||
|
||||
### Wrong keys from a poisoned vault
|
||||
|
||||
A public vault can return the right KID with a wrong content key. The decrypters accept a wrong content key and write noise. unshackle therefore trusts a content key from a vault only after FFmpeg decodes the decrypted track with strict error detection. For a fragmented MP4, unshackle reads from the encrypted file which fragments each KID encrypts, and FFmpeg decodes up to three windows of each KID: from its first, middle and last fragment on through the next fragments of that KID, for up to 4 seconds. A window never runs into a fragment of another KID or a clear fragment. A clear lead or a lead under another KID therefore cannot hide a wrong content key, and only the KID that fails is flagged. When every KID in the map has a content key, the map is complete, and a KID that is not in it does not encrypt this file. This file does not judge that KID; the file of its own track judges it. A file with no encrypted sample entry and no encrypted fragment, for example a clear audio track, judges no KID, so it neither flags nor copies a content key. A KID that is not in an incomplete map, for example one with an all-zero KID, and every KID of any other file, gets one check of the whole file. FFmpeg decodes the first seconds and the last seconds. A failure there flags each of those KIDs. When a mapped KID fails, the KIDs that are not in the map get no verdict from that pass; the retry with the replaced key judges them. Content keys from a licence skip this check. A file this FFmpeg build cannot judge counts as a pass, never as a wrong content key: a codec it has no decoder for, or a header it cannot read. A pass is not proof. A wrong content key for HEVC video can decode without an error for some seconds, most often at a low resolution, and that content key passes the check. Without FFmpeg there is no check at all.
|
||||
A public vault can return the right KID with a wrong content key. The decrypters accept a wrong content key and write noise. unshackle therefore trusts a content key from a vault only after FFmpeg decodes the decrypted track with strict error detection. For a fragmented MP4, unshackle reads from the encrypted file which fragments each KID encrypts, and FFmpeg decodes up to three windows of each KID: from its first, middle and last fragment on through the next fragments of that KID, for up to 4 seconds. A window never runs into a fragment of another KID or a clear fragment. A clear lead or a lead under another KID therefore cannot hide a wrong content key, and only the KID that fails is flagged. A KID that is not in this map, and every KID of any other file, gets one check of the whole file. FFmpeg decodes the first seconds and the last seconds. A failure there flags each of those KIDs. When a mapped KID fails, the KIDs that are not in the map get no verdict from that pass; the retry with the replaced key judges them. Content keys from a licence skip this check. A file this FFmpeg build cannot judge counts as a pass, never as a wrong content key: a codec it has no decoder for, or a header it cannot read. A pass is not proof. A wrong content key for HEVC video can decode without an error for some seconds, most often at a low resolution, and that content key passes the check. Without FFmpeg there is no check at all.
|
||||
|
||||
When the decode fails, unshackle:
|
||||
|
||||
1. Flags the KID:KEY in the `bad_keys` table of every local SQLite vault, with the service and the name of the vault it came from. The pair also goes out of the service table, except in a vault marked `no_push`, where only the flag is written. A flagged pair cannot go back into a local vault from another vault, a later run, or `kv copy`. A licence that returns the pair clears the flag and stores it. An `API` vault that served the pair gets a report only when a different content key for that KID is accepted. When the CDM returns the same content key, that vault gets no report. `HTTP` and `MySQL` vaults have no report route. A pair from a local vault goes to no remote vault, even when a remote vault holds the same pair.
|
||||
1. Flags the KID:KEY in the `bad_keys` table of every local SQLite vault, with the service and the name of the vault it came from. The pair also goes out of the service table, except in a vault marked `no_push`, where only the flag is written. A flagged pair cannot go back into a local vault from another vault, a later run, or `kv copy`. A licence that returns the pair clears the flag and stores it. An `API` vault that served the pair also gets a report; `HTTP` and `MySQL` vaults have no report route. A pair from a local vault goes to no remote vault, even when a remote vault holds the same pair.
|
||||
2. Restores the ciphertext from a hard link it made before decryption, then asks for the content key again. Every vault lookup skips a flagged pair, so the request reaches the remaining vaults and then the CDM. A remote answer that arrived after the winning one is reused instead of queried again.
|
||||
3. Removes the flag when the CDM returns the same content key, because then the decode check was wrong, not the content key. A content key from another vault is checked in its turn, and flagged as well if it also fails.
|
||||
|
||||
@@ -317,16 +317,6 @@ $ unshackle kv copy local shared community
|
||||
|
||||
`--service` and `--local-only` are mutually exclusive.
|
||||
|
||||
To import an SQLite vault file that is not in the config, give its path as the source:
|
||||
|
||||
```console
|
||||
$ unshackle kv copy local ~/Downloads/key_store.db -s EXAMPLE
|
||||
```
|
||||
|
||||
`kv copy` only reads from a source, so the file stays unchanged. `kv sync` also accepts a path, but it writes content keys into that file.
|
||||
|
||||
With `--service`, `kv copy` reads the table named by the service's vault tag and the table named by its plain tag. It writes both into the vault-tag table, which is the table a download reads. Without `--service`, each table keeps its name.
|
||||
|
||||
A pair the destination vault has flagged in `bad_keys` is left behind, so a copy does not undo a flag. `bad_keys` is never treated as a service, so its rows are never copied into a service table.
|
||||
|
||||
### `kv sync`: mirror vaults both ways
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ at a title and it will:
|
||||
| Manifests | DASH, HLS, and Smooth Streaming (ISM) |
|
||||
| DRM | Widevine and PlayReady, with ClearKey support |
|
||||
| Video | AVC, HEVC, VC-1, VP8, VP9, AV1; SDR, HLG, HDR10, HDR10+, Dolby Vision, and Dolby Vision **hybrid** merging |
|
||||
| Audio | AAC, AC-3, E-AC-3, AC-4, Opus, Vorbis, DTS, DTS-X, ALAC, FLAC, MP3; Dolby Atmos handling; per-channel-layout selection |
|
||||
| Audio | AAC, AC-3, E-AC-3, AC-4, Opus, Vorbis, DTS, DTS-X, ALAC, FLAC; Dolby Atmos handling; per-channel-layout selection |
|
||||
| Subtitles | SRT, WebVTT, ASS/SSA, TTML and more, with optional SDH stripping and format conversion |
|
||||
| Key vaults | SQLite, MySQL, and HTTP/API vaults to store and share content keys |
|
||||
| Proxies | Basic proxies plus Control D, NordVPN, ProtonVPN, Surfshark, Windscribe, ExpressVPN, Gluetun, and Hola providers |
|
||||
|
||||
@@ -25,6 +25,7 @@ directories:
|
||||
| `wvds` | path | `<data>/WVDs` | Yes | Widevine device files (`.wvd`). |
|
||||
| `prds` | path | `<data>/PRDs` | Yes | PlayReady device files (`.prd`). |
|
||||
| `dcsl` | path | `<data>/DCSL` | Yes | DCSL data. |
|
||||
| `themes` | path | `<data>/themes/custom` | Yes | Your [theme files](../../guide/themes.md) (`<name>.yaml`). |
|
||||
| `commands` | path | `unshackle/commands` | Yes | CLI command modules. |
|
||||
| `services` | list \| path | `[unshackle/services]` | Yes | Service search paths and/or remote repo specs (see below). |
|
||||
| `vaults` | path | `unshackle/vaults` | Yes | Vault backend modules. |
|
||||
@@ -63,8 +64,7 @@ directories:
|
||||
The **automatic** 24 h-TTL refresh that happens during a normal `dl`/`search` run
|
||||
**refuses to refresh and exits** (naming the offending clone) if that clone has
|
||||
uncommitted changes to tracked files or unpushed local commits. Untracked files (new
|
||||
service folders, `__pycache__`), Python bytecode (`.pyc`, `.pyo`, also when the repo
|
||||
commits it) and `.DS_Store` never block it. The **manual**
|
||||
service folders, `__pycache__`) never block it. The **manual**
|
||||
`unshackle util refresh-services` command instead **hard-resets** the clone to upstream,
|
||||
discarding any local edits.
|
||||
|
||||
|
||||
@@ -288,8 +288,6 @@ Matroska (MKV) muxing options.
|
||||
| `default_language` | dict | `{}` | Force which language is flagged *default* per track type, e.g. `{audio: en, subtitle: en}`. A tag with a region, such as `en-US`, matches only that variant. |
|
||||
| `merge_audio` | bool | `true` | Merge all audio into one file. `--split-audio` on the CLI flips this off. |
|
||||
| `merge_video` | bool | `false` | Merge video tracks that share height, range, and codec into one file, so only language varies inside a file. `--merge-video` on the CLI flips this on. |
|
||||
| `track_names` | str | `english` | The language of the name unshackle gives a track that the service left unnamed: `english` (`Chinese (Traditional)`), `native`, the name in the language itself (`中文(繁體)`), or `none`, which leaves the track unnamed. Read [Track names and language tags](../../guide/output-and-naming.md#track-names-and-language-tags). |
|
||||
| `original_label` | str | unset | Text that unshackle adds after the name of an audio or subtitle track in the title's original language, such as `[Original]`. Read [Track names and language tags](../../guide/output-and-naming.md#track-names-and-language-tags). |
|
||||
| `concurrency` | int | `4` | How many mkvmerge processes run at the same time when a title muxes more than one output file (one per video variant or audio codec). Each process uses one CPU core, so this shortens the mux step on an SSD. Set it to `1` on a hard disk, where parallel writes are slower. |
|
||||
|
||||
```yaml
|
||||
@@ -312,18 +310,17 @@ Language-tag remapping and the rule engine behind the `{lang_tag}` filename vari
|
||||
| Condition | Meaning |
|
||||
|-----------|---------|
|
||||
| `audio` | At least one audio language matches. |
|
||||
| `audio_contain_all` | Every listed language must be present in the audio. |
|
||||
| `subs_contain` | At least one subtitle language matches. |
|
||||
| `subs_contain_all` | Every listed language must be present in the subtitles. |
|
||||
| `subs_contain_all` | Every listed language must be present. |
|
||||
| `dual` / `multi` / `dubbed` | `true` matches when that filename variable is set, `false` when it is not. |
|
||||
|
||||
Each language condition takes one language tag or a list of them. A list matches when **any**
|
||||
entry matches, except `audio_contain_all` and `subs_contain_all`, which need them all. An empty
|
||||
list never matches. An entry that is not a valid language tag (for example `japanese`) never
|
||||
matches. A tag with a region matches only that variant, so `audio: es-419` does not match
|
||||
`es-ES` audio. `dual`, `multi` and `dubbed` take a bare `true` or `false`, not a quoted string.
|
||||
unshackle skips a rule with a condition name it does not know, or with any other value in a
|
||||
boolean condition. It logs a warning in each of these cases and tries the next rule.
|
||||
entry matches, except `subs_contain_all`, which needs them all. An entry that is not a valid
|
||||
language tag (for example `japanese`) never matches. A tag with a region matches only that
|
||||
variant, so `audio: es-419` does not match `es-ES` audio. `dual`, `multi` and `dubbed` take a bare
|
||||
`true` or `false`, not a quoted string. unshackle skips a rule with a condition name it does
|
||||
not know, or with any other value in a boolean condition. It logs a warning in each of these
|
||||
cases and tries the next rule.
|
||||
|
||||
`dual`, `multi` and `dubbed` carry the same meaning as the
|
||||
[filename variables of those names](#dual_multi_mode). Pair one with a language to name a
|
||||
@@ -344,24 +341,6 @@ language_tags:
|
||||
tag: "THAIDUAL"
|
||||
```
|
||||
|
||||
unshackle examines the rules in order, so put a rule that needs more languages before a rule that
|
||||
needs fewer. Here, a release with both French dubs gets `VF2`, not `VFQ`:
|
||||
|
||||
```yaml
|
||||
language_tags:
|
||||
rules:
|
||||
- audio_contain_all: [fr-FR, fr-CA]
|
||||
tag: "VF2"
|
||||
- audio: fr-CA
|
||||
tag: "VFQ"
|
||||
- audio: fr-FR
|
||||
tag: "VFF"
|
||||
```
|
||||
|
||||
!!! tip "Give regional tags in an `_all` list"
|
||||
A tag without a region also matches a regional track, so one `fr-CA` track satisfies both
|
||||
entries of `[fr, fr-CA]`. Use `[fr-FR, fr-CA]` to require two different tracks.
|
||||
|
||||
!!! note "Put `{lang_tag}` where you want the name"
|
||||
These rules fill `{lang_tag}`. To use your own name in place of the fixed text, keep
|
||||
`{lang_tag?}` in the template and leave out `{dual?}`, `{multi?}` and `{dubbed?}`.
|
||||
|
||||
@@ -17,10 +17,8 @@ Over `--remote`, an override also makes your device license the remote session,
|
||||
CDM. A per-service entry does the same when it names a device without a quality: a device name,
|
||||
a `widevine` or `playready` sub-entry, or a profile or `default` sub-entry. A per-service entry
|
||||
that selects only by quality, or only for a different profile, loads no device when the run
|
||||
starts. When `server_cdm` is unset, unshackle then shows a warning, and the server decides who
|
||||
licenses the remote session.
|
||||
With only the top-level `default` entry, the server CDM licenses when the API key has it. Set
|
||||
`server_cdm: true` on the server entry to keep a per-service entry for local runs only. See
|
||||
starts. unshackle then shows a warning, and the server decides who licenses the remote session.
|
||||
With only the top-level `default` entry, the server CDM licenses when the API key has it. See
|
||||
[`remote_services`](services.md#remote_services).
|
||||
|
||||
```yaml
|
||||
|
||||
@@ -32,7 +32,7 @@ Where the file lives, how unshackle discovers it, and how to edit it:
|
||||
| [Directories](directories.md) | `directories`, `filenames`, `services_repo_force` |
|
||||
| [Services & authentication](services.md) | `services`, `credentials`, `firefox_cookies`, `remote_services`, `serve` |
|
||||
| [Download & processing](download.md) | `dl`, `continue_downloads`, `merge_segments`, `subtitle`, `audio`, `muxing`, `language_tags`, `dual_multi_mode`, `generate_dv_mode`, `hdr10plus_probe` |
|
||||
| [Output & naming](output.md) | `output_template`, `tag`, `tag_rules`, `codec_names`, `tag_group_name`, `tag_imdb_tmdb`, `chapter_fallback_name`, `unicode_filenames` |
|
||||
| [Output & naming](output.md) | `output_template`, `tag`, `tag_rules`, `tag_group_name`, `tag_imdb_tmdb`, `chapter_fallback_name`, `unicode_filenames` |
|
||||
| [DRM & CDM](drm.md) | `cdm`, `remote_cdm`, `decryption` |
|
||||
| [Network & proxy](network.md) | `network`, `headers`, `proxy_providers` |
|
||||
| [Key vaults](vaults.md) | `key_vaults`, `vault_timeout` |
|
||||
|
||||
@@ -145,7 +145,7 @@ calls.
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| `theme` | str | `catppuccin-mocha` | Named colour theme for all CLI output: banner, logs, progress bars, and help screens. One of `catppuccin-mocha` (aliases `default`, `catppuccin`, `mocha`), `dracula`, `nord`, `gruvbox`, `one-dark` (alias `onedark`), `tokyo-night` (alias `tokyonight`), `monokai`, `flexoki`, `solarized-dark` (alias `solarized`). Case-insensitive; underscores work in place of hyphens. Unknown names fall back to the default with a warning. Preview them all with `unshackle env theme`. |
|
||||
| `theme` | str | `unshackle` | Colour theme for all CLI output: banner, logs, progress bars, and help screens. The shipped themes are `unshackle`, `rainbow`, `nord`, `catppuccin-mocha`, `dracula`, `flexoki`, `gruvbox`, `monokai`, `one-dark`, `solarized-dark` and `tokyo-night`. Some have other names, for example `default` for `unshackle`; see [Themes](../../guide/themes.md#when-unshackle-does-not-use-a-theme). Any other name is a theme file in [`directories.themes`](directories.md). Case-insensitive; underscores work in place of hyphens. An unknown name or a theme file that is not valid falls back to `unshackle` with a warning. List the themes with `unshackle env theme`. See [Themes](../../guide/themes.md). |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -61,11 +61,8 @@ headers:
|
||||
- **Type:** `dict` · **Default:** `{}`
|
||||
|
||||
Proxy/VPN provider configuration. Each sub-key names a proxy provider, and unshackle passes its
|
||||
block straight to that provider's constructor. A bare `--proxy` query tries Basic first, then
|
||||
the other proxy providers in the order of their sub-keys, and Control D last (see
|
||||
[Provider load order](../../guide/proxies-and-vpn.md#provider-load-order)). See
|
||||
[Proxies & VPN](../../guide/proxies-and-vpn.md) for the full proxy provider guide. Recognised proxy
|
||||
providers and their exit ports:
|
||||
block straight to that provider's constructor. See [Proxies & VPN](../../guide/proxies-and-vpn.md)
|
||||
for the full proxy provider guide. Recognised proxy providers and their exit ports:
|
||||
|
||||
| Provider | Config key | Credentials | Proxy scheme/port |
|
||||
|----------|-----------|-------------|-------------------|
|
||||
|
||||
@@ -69,35 +69,6 @@ folder-kind keys.
|
||||
| `chapter_fallback_name` | str | `""` | Fallback template for chapter names, e.g. `"Chapter {i:02}"`. |
|
||||
| `unicode_filenames` | bool | `false` | Allow Unicode in filenames; when `false`, names are ASCII-sanitised. |
|
||||
|
||||
## `codec_names`
|
||||
|
||||
- **Type:** `dict` · **Default:** `{}`
|
||||
|
||||
Renames the codec and HDR names in the filename. Each map key is a name that unshackle writes by
|
||||
default, and its value is the name to write instead. The map applies to the `video`, `audio`,
|
||||
and `hdr` [template variables](../../guide/output-and-naming.md#template-variables), and so
|
||||
also to `audio_full`. A name that is not in the map stays as it is, and an empty value removes
|
||||
the name. You can also set `codec_names` for one service under `services`.
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
codec_names:
|
||||
DDP: EAC3 # DDP5.1 -> EAC3.5.1
|
||||
DD: AC3 # DD5.1 -> AC3.5.1
|
||||
H.265: HEVC # H.265 -> HEVC
|
||||
HDR10P: HDR10+ # DV.HDR10P -> DV.HDR10+
|
||||
```
|
||||
|
||||
For `hdr`, unshackle renames each part of a Dolby Vision label separately, so `HDR10P` also
|
||||
changes `DV.HDR10P` to `DV.HDR10+`. When an audio name ends in a digit, `audio_full` puts a
|
||||
separator before the channels: `EAC3.5.1`, not `EAC35.1`.
|
||||
|
||||
The REST API fields `codec_display` and `range_display` use the same names and the same map.
|
||||
The `dl --export` file name does not use `codec_names`.
|
||||
|
||||
!!! note "`tag_rules` see the new names"
|
||||
unshackle evaluates [`tag_rules`](#tag_rules) after the rename. With the example above, a
|
||||
rule must match `audio: EAC3`, not `audio: DDP`.
|
||||
|
||||
## `tag_rules`
|
||||
|
||||
- **Type:** `list` · **Default:** `[]`
|
||||
|
||||
@@ -89,35 +89,16 @@ Definitions of remote unshackle service servers, used by the `--remote` mode. Ea
|
||||
named by you (pick it with `--server`, or do not write that flag when you configure only one) and gives
|
||||
the server's `url` (required), an optional `api_key`, an optional `auth_headers` list, an
|
||||
optional `server_cdm` boolean, an optional `timeout` in seconds, and an optional `services` sub-dict of per-service local
|
||||
overrides such as `title_map`, keyed by service tag in any case. A `server_cdm` in a `services` entry replaces the `server_cdm` of
|
||||
the server entry for that service.
|
||||
overrides such as `title_map`.
|
||||
|
||||
Leave `server_cdm` unset and the client follows the server: it uses the server CDM for each
|
||||
service the API key has it on, and the local CDM for the others. `true` asks for the server CDM
|
||||
and falls back to the local CDM when the server refuses; `false` always uses the local CDM.
|
||||
`dl --cdm <name>` on a remote run has the same effect as `false` for that run: the device you
|
||||
name licenses the remote session, and it takes priority over `server_cdm: true`. When
|
||||
`server_cdm` is unset, a [`cdm`](drm.md#cdm) entry for the service has the same effect for that
|
||||
service when it names the device that unshackle loaded. The `default` entry does not count.
|
||||
With `server_cdm: true`, the server CDM licenses the remote session, and the device of the entry
|
||||
licenses only when the server refuses. Thus the entry applies to local runs and the server CDM
|
||||
applies to remote runs:
|
||||
|
||||
```yaml
|
||||
cdm:
|
||||
EXAMPLE1: my_device # local runs of EXAMPLE1
|
||||
|
||||
remote_services:
|
||||
my_server:
|
||||
url: https://example.com
|
||||
server_cdm: true # remote runs of EXAMPLE1 use the server CDM
|
||||
services:
|
||||
EXAMPLE2:
|
||||
server_cdm: false # remote runs of EXAMPLE2 use your own device
|
||||
```
|
||||
|
||||
When the server refuses the server CDM for a service whose `cdm` entry loaded the device,
|
||||
unshackle logs the fallback to that device as info, not as a warning.
|
||||
name licenses the remote session. A [`cdm`](drm.md#cdm) entry for the service has the same
|
||||
effect for that service when it names the device that unshackle loaded. Both take priority over
|
||||
`server_cdm: true`. Remove the entry to use the server CDM for that service. The `default`
|
||||
entry does not count.
|
||||
|
||||
The server has the last word. When it keeps the server CDM for a remote session that your
|
||||
device was to license, unshackle shows a warning. This occurs with a server that does not read
|
||||
@@ -199,8 +180,8 @@ an API key without `server_cdm` for that service also cannot submit or retry `/a
|
||||
jobs. Keys that have no `users` entry, such as `api_secret`, keep server CDM access.
|
||||
|
||||
A remote client that picks its own device licenses the remote session with that device. It picks
|
||||
with `dl --cdm`, with `server_cdm: false` in its `remote_services` entry or in the `services`
|
||||
entry for the service, or with a `cdm` entry for the service when `server_cdm` is unset. The server CDM makes no licence for that remote session, with or without
|
||||
with `dl --cdm`, with a `cdm` entry for the service, or with `server_cdm: false` in its
|
||||
`remote_services` entry. The server CDM makes no licence for that remote session, with or without
|
||||
a limit. A service option that runs the remote session on the server's device, such as a
|
||||
server-identity flag, keeps the server CDM.
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ nav:
|
||||
- Key Vaults: guide/vaults.md
|
||||
- Output & Naming: guide/output-and-naming.md
|
||||
- Subtitles: guide/subtitles.md
|
||||
- Themes: guide/themes.md
|
||||
- Troubleshooting: guide/troubleshooting.md
|
||||
- Configuration:
|
||||
- Overview: reference/configuration/index.md
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ dependencies = [
|
||||
"pywidevine[serve]>=1.8.0,<2",
|
||||
"PyYAML>=6.0.1,<7",
|
||||
"requests[socks]>=2.32.5,<3",
|
||||
"rich>=13.7.1,<15",
|
||||
"rich>=14,<15",
|
||||
"rlaphoenix.m3u8>=3.4.0,<4",
|
||||
"ruamel.yaml>=0.18.6,<0.19",
|
||||
"sortedcontainers>=2.4.0,<3",
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
"""Download public DASH, HLS and ISM test manifests into tests/fixtures/manifests.
|
||||
|
||||
Sources: the DASH-IF test vector database (with the stream counts and codecs it expects),
|
||||
the example MPDs of the MPEG DASH spec (ISO/IEC 23009-1), the yt-dlp test data, and the
|
||||
stream lists of the dash.js reference player, the Shaka Player demo and the hls.js tests.
|
||||
Only the manifest text is stored; index.json maps each file to its source URL, which the
|
||||
parser needs to resolve relative URLs. A manifest that fails to download keeps its previous
|
||||
copy. An HLS media playlist is left out, since HLS parses only multivariant playlists.
|
||||
Run again to refresh: uv run python scripts/fetch_manifest_corpus.py
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from pathlib import Path
|
||||
from typing import Any, Optional
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import requests
|
||||
|
||||
DASHIF_VECTORS = (
|
||||
"https://raw.githubusercontent.com/Dash-Industry-Forum/Test-Assets-Dataset-Public/master/"
|
||||
"dataset/data/testvector.json"
|
||||
)
|
||||
MPEG_EXAMPLES = "https://api.github.com/repos/MPEGGroup/DASHSchema/git/trees/6th-Ed"
|
||||
MPEG_RAW = "https://raw.githubusercontent.com/MPEGGroup/DASHSchema/6th-Ed/"
|
||||
DASHJS_SOURCES = (
|
||||
"https://raw.githubusercontent.com/Dash-Industry-Forum/dash.js/development/"
|
||||
"samples/dash-if-reference-player/app/data/sources.json"
|
||||
)
|
||||
YTDLP_TESTDATA = "https://api.github.com/repos/yt-dlp/yt-dlp/contents/test/testdata/"
|
||||
HLSJS_STREAMS = "https://raw.githubusercontent.com/video-dev/hls.js/master/tests/test-streams.js"
|
||||
SHAKA_ASSETS = "https://raw.githubusercontent.com/shaka-project/shaka-player/main/demo/common/assets.js"
|
||||
OUT = Path(__file__).resolve().parent.parent / "tests" / "fixtures" / "manifests"
|
||||
MAX_BYTES = 500_000
|
||||
DEADLINE = 60
|
||||
EXTENSIONS = {"dash": "mpd", "hls": "m3u8", "ism": "ism.xml"}
|
||||
|
||||
# url -> reason; manifests the parsers do not support yet, left out until a live service needs them
|
||||
EXCLUDED: dict[str, str] = {
|
||||
"https://playertest.longtailvideo.com/adaptive/vod-with-mp3/manifest.m3u8": "the same variant listed twice gives a duplicate track ID",
|
||||
"https://raw.githubusercontent.com/MPEGGroup/DASHSchema/6th-Ed/example_G29-2.mpd": "spec example fragment with no playable Representation",
|
||||
"https://raw.githubusercontent.com/MPEGGroup/DASHSchema/6th-Ed/example_K6.4.mpd": "spec example fragment with no playable Representation",
|
||||
"https://raw.githubusercontent.com/MPEGGroup/DASHSchema/6th-Ed/example_G4.mpd": "two Representations share an id inside one Period",
|
||||
"https://raw.githubusercontent.com/MPEGGroup/DASHSchema/6th-Ed/example_G8.mpd": "Representations with no codecs attribute",
|
||||
"https://raw.githubusercontent.com/MPEGGroup/DASHSchema/6th-Ed/example_H3.mpd": "metadata Representation with no mimeType or contentType",
|
||||
"https://storage.googleapis.com/shaka-demo-assets/heliocentrism-xlink/heliocentrism.mpd": "xlink:href remote Periods are not resolved",
|
||||
}
|
||||
|
||||
Stream = tuple[str, str, str, Optional[dict[str, Any]]]
|
||||
|
||||
|
||||
def dashif_streams() -> list[Stream]:
|
||||
"""Return the DASH-IF test vectors; a static one-Period vector also carries what it should parse to.
|
||||
|
||||
The vector's max_num_video and max_num_audio count the Representations of its largest AdaptationSet.
|
||||
"""
|
||||
streams: list[Stream] = []
|
||||
for vector in requests.get(DASHIF_VECTORS, timeout=30).json():
|
||||
if not vector.get("url"):
|
||||
continue
|
||||
expect = None
|
||||
if vector.get("mpd_type") == "static" and vector.get("num_periods") == 1:
|
||||
expect = {k: vector.get(k) for k in ("max_num_video", "max_num_audio", "video_codec", "audio_codec")}
|
||||
# the vector names are only "Test Vector N", the URL path says what the vector covers
|
||||
name = "/".join(urlparse(vector["url"]).path.split("/")[-3:]).removesuffix(".mpd")
|
||||
streams.append(("dashif", name, vector["url"], expect))
|
||||
return streams
|
||||
|
||||
|
||||
def mpeg_streams() -> list[Stream]:
|
||||
"""Return the example MPDs that ship with the MPEG DASH schema."""
|
||||
tree = requests.get(MPEG_EXAMPLES, timeout=30).json()["tree"]
|
||||
return [
|
||||
("mpeg", item["path"].removesuffix(".mpd"), MPEG_RAW + item["path"], None)
|
||||
for item in tree
|
||||
if re.fullmatch(r"example_.+\.mpd", item["path"])
|
||||
]
|
||||
|
||||
|
||||
def ytdlp_streams() -> list[Stream]:
|
||||
"""Return the manifests yt-dlp keeps as parser test data."""
|
||||
return [
|
||||
("ytdlp", f"{folder}/{item['name']}", item["download_url"], None)
|
||||
for folder in ("mpd", "m3u8", "ism")
|
||||
for item in requests.get(YTDLP_TESTDATA + folder, timeout=30).json()
|
||||
]
|
||||
|
||||
|
||||
def hlsjs_streams() -> list[Stream]:
|
||||
"""Return every URL in the hls.js test stream list, named by the key of its entry."""
|
||||
text = requests.get(HLSJS_STREAMS, timeout=30).text
|
||||
streams: list[Stream] = []
|
||||
for match in re.finditer(r"'(https?://[^']+)'", text):
|
||||
keys = re.findall(r"^ (\w+): ", text[: match.start()], re.M)
|
||||
streams.append(("hlsjs", keys[-1] if keys else "stream", match.group(1), None))
|
||||
return streams
|
||||
|
||||
|
||||
def dashjs_streams() -> list[Stream]:
|
||||
data = requests.get(DASHJS_SOURCES, timeout=30).json()
|
||||
return [
|
||||
("dashjs", f"{group['name']}/{item['name']}", item["url"], None)
|
||||
for group in data["items"]
|
||||
for item in group["submenu"]
|
||||
if item.get("url")
|
||||
]
|
||||
|
||||
|
||||
def shaka_streams() -> list[Stream]:
|
||||
text = requests.get(SHAKA_ASSETS, timeout=30).text
|
||||
pattern = re.compile(r"/\* name= \*/\s*'((?:[^'\\]|\\.)*)'.*?/\* manifestUri= \*/\s*'([^']+)'", re.S)
|
||||
return [("shaka", name.replace("\\'", "'"), url, None) for name, url in pattern.findall(text)]
|
||||
|
||||
|
||||
def kind_of(head: bytes) -> Optional[str]:
|
||||
"""Tell the manifest type from the first bytes, since many manifest URLs have no telling extension."""
|
||||
text = head.lstrip(b"\xef\xbb\xbf").lstrip()
|
||||
if text.startswith(b"#EXTM3U"):
|
||||
return "hls"
|
||||
if re.search(rb"<MPD[\s>]", text):
|
||||
return "dash"
|
||||
if re.search(rb"<SmoothStreamingMedia[\s>]", text):
|
||||
return "ism"
|
||||
return None
|
||||
|
||||
|
||||
def file_name(source: str, name: str, url: str, kind: str) -> str:
|
||||
slug = re.sub(r"[^a-z0-9]+", "-", name.lower())[:60].strip("-")
|
||||
return f"{kind}/{source}-{slug}-{hashlib.sha1(url.encode()).hexdigest()[:8]}.{EXTENSIONS[kind]}"
|
||||
|
||||
|
||||
def fetch(stream: Stream) -> Optional[dict[str, Any]]:
|
||||
"""Download one manifest into OUT and return its index entry, or None when it is not a manifest."""
|
||||
source, name, url, expect = stream
|
||||
try:
|
||||
with requests.get(url, timeout=20, stream=True) as res:
|
||||
res.raise_for_status()
|
||||
deadline = time.monotonic() + DEADLINE
|
||||
body = b""
|
||||
for chunk in res.iter_content(65536):
|
||||
body += chunk
|
||||
if len(body) >= 4096 and not kind_of(body[:4096]):
|
||||
return None
|
||||
if len(body) > MAX_BYTES or time.monotonic() > deadline:
|
||||
print(f"skip {url}: over {MAX_BYTES} bytes or {DEADLINE}s")
|
||||
return None
|
||||
final_url = res.url
|
||||
except requests.RequestException as e:
|
||||
print(f"skip {url}: {e}")
|
||||
return None
|
||||
kind = kind_of(body)
|
||||
if not kind or (kind == "hls" and b"#EXT-X-STREAM-INF" not in body):
|
||||
return None
|
||||
file = file_name(source, name, url, kind)
|
||||
(OUT / file).write_bytes(body)
|
||||
# a redirect moves the base that relative segment URLs resolve against
|
||||
entry: dict[str, Any] = {"file": file, "kind": kind, "source": source, "name": name, "url": final_url}
|
||||
if expect and kind == "dash":
|
||||
entry["expect"] = expect
|
||||
return entry
|
||||
|
||||
|
||||
def main() -> None:
|
||||
streams: dict[str, Stream] = {}
|
||||
lists = dashif_streams() + mpeg_streams() + ytdlp_streams() + dashjs_streams() + shaka_streams() + hlsjs_streams()
|
||||
for source, name, url, expect in lists:
|
||||
url = f"https:{url}" if url.startswith("//") else url
|
||||
if url not in EXCLUDED:
|
||||
streams.setdefault(url, (source, name, url, expect))
|
||||
|
||||
index_path = OUT / "index.json"
|
||||
old = (
|
||||
{(e["source"], e["name"]): e for e in json.loads(index_path.read_text("utf-8"))} if index_path.exists() else {}
|
||||
)
|
||||
for kind in EXTENSIONS:
|
||||
(OUT / kind).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with ThreadPoolExecutor(16) as pool:
|
||||
results = list(pool.map(fetch, streams.values()))
|
||||
index = [entry for entry in results if entry]
|
||||
missing = {(source, name) for source, name, _, _ in streams.values()} - {(e["source"], e["name"]) for e in index}
|
||||
kept = [e for key, e in old.items() if key in missing and (OUT / e["file"]).exists()]
|
||||
index += kept
|
||||
|
||||
keep = {e["file"] for e in index}
|
||||
for kind in EXTENSIONS:
|
||||
for path in (OUT / kind).iterdir():
|
||||
if f"{kind}/{path.name}" not in keep:
|
||||
path.unlink()
|
||||
index.sort(key=lambda entry: entry["file"])
|
||||
index_path.write_text(json.dumps(index, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
|
||||
print(f"{len(index) - len(kept)} manifests fetched, {len(kept)} kept from the last run, saved to {OUT}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -34,7 +34,7 @@ STREAMS: list[tuple[str, str]] = [
|
||||
("sony-1a", "https://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd"),
|
||||
]
|
||||
|
||||
guard_results: list[Optional[tuple[int, int]]] = []
|
||||
guard_results: list[bool] = []
|
||||
|
||||
|
||||
def install_guard_spy() -> bool:
|
||||
@@ -43,7 +43,7 @@ def install_guard_spy() -> bool:
|
||||
if orig is None:
|
||||
return False
|
||||
|
||||
def spy(is_subtitle: bool, segments: Any, init_len: int) -> Optional[tuple[int, int]]:
|
||||
def spy(is_subtitle: bool, segments: Any, init_len: Optional[int]) -> bool:
|
||||
result = orig(is_subtitle, segments, init_len)
|
||||
guard_results.append(result)
|
||||
return result
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
|
||||
from unshackle.commands import cfg as cfg_module
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def config_file(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
|
||||
path = tmp_path / "unshackle.yaml"
|
||||
monkeypatch.setattr(cfg_module, "get_config_path", lambda: path)
|
||||
return path
|
||||
|
||||
|
||||
def test_a_duplicate_key_logs_its_lines_once_and_names_no_key_or_value(
|
||||
config_file: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
config_file.write_text(
|
||||
"theme: rainbow\ncredentials:\n EXAMPLE: first-secret\n OTHER: other\n EXAMPLE: second-secret\n"
|
||||
"serve:\n users:\n key-secret: {tier: a}\n key-secret: {tier: b}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
with caplog.at_level(logging.WARNING, logger="config"):
|
||||
result = CliRunner().invoke(cfg_module.cfg, ["theme"])
|
||||
CliRunner().invoke(cfg_module.cfg, ["theme"])
|
||||
assert isinstance(result.exception, SystemExit), result.exception
|
||||
assert result.exit_code == 1
|
||||
assert caplog.messages == [
|
||||
f"{config_file}: duplicate key on lines 3 and 5, lines 8 and 9. Unshackle uses the later one."
|
||||
]
|
||||
assert "Error" not in result.output and "lines" not in result.output
|
||||
for output in (result.output, caplog.text):
|
||||
assert "secret" not in output and "EXAMPLE" not in output
|
||||
|
||||
|
||||
def test_a_duplicate_key_blocks_a_write(config_file: Path) -> None:
|
||||
original = "theme: rainbow\ncredentials:\n EXAMPLE: a\n EXAMPLE: b\n"
|
||||
config_file.write_text(original, encoding="utf-8")
|
||||
result = CliRunner().invoke(cfg_module.cfg, ["theme", "plain"])
|
||||
assert result.exit_code == 1
|
||||
assert config_file.read_text(encoding="utf-8") == original
|
||||
|
||||
|
||||
def test_a_valid_config_still_reads_a_key(config_file: Path) -> None:
|
||||
config_file.write_text("theme: rainbow\n", encoding="utf-8")
|
||||
result = CliRunner().invoke(cfg_module.cfg, ["theme"])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert "rainbow" in result.output
|
||||
|
||||
|
||||
def test_a_duplicate_only_ruamel_sees_still_gives_its_line(config_file: Path, caplog: pytest.LogCaptureFixture) -> None:
|
||||
config_file.write_text("a: 1\n1: x\n0x1: y\n", encoding="utf-8")
|
||||
with caplog.at_level(logging.WARNING):
|
||||
result = CliRunner().invoke(cfg_module.cfg, ["a"])
|
||||
assert result.exit_code == 1
|
||||
assert caplog.messages == [f"{config_file}: duplicate key on line 3. Unshackle uses the later one."]
|
||||
@@ -1,38 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
|
||||
from unshackle.commands import kv as kv_module
|
||||
from unshackle.vaults.SQLite import SQLite
|
||||
|
||||
KID = "0" * 31 + "1"
|
||||
KEY = "a" * 32
|
||||
|
||||
|
||||
def test_kv_copy_moves_a_plain_tag_table_from_a_file_into_the_vault_tag_table(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
source = tmp_path / "key_store.db"
|
||||
SQLite("seed", source).add_key("TESTSVC", KID, KEY)
|
||||
dest = tmp_path / "local.db"
|
||||
monkeypatch.setattr(kv_module.config, "key_vaults", [{"type": "SQLite", "name": "local", "path": str(dest)}])
|
||||
monkeypatch.setattr(kv_module.Services, "get_vault_tag", lambda name: "Shared" if name == "TESTSVC" else name)
|
||||
|
||||
result = CliRunner().invoke(kv_module.kv, ["copy", "local", str(source), "-s", "TESTSVC"])
|
||||
|
||||
assert result.exit_code == 0, result.output
|
||||
check = SQLite("check", dest)
|
||||
assert check.get_key(KID, "Shared") == KEY
|
||||
assert check.get_key(KID, "TESTSVC") is None
|
||||
|
||||
|
||||
def test_kv_copy_rejects_a_name_that_is_neither_configured_nor_a_file(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(kv_module.config, "key_vaults", [])
|
||||
|
||||
result = CliRunner().invoke(kv_module.kv, ["copy", "local", "nowhere.db"])
|
||||
|
||||
assert result.exit_code != 0
|
||||
assert "not defined in the config" in result.output
|
||||
+4
-40
@@ -4,13 +4,10 @@ from __future__ import annotations
|
||||
|
||||
import socket
|
||||
import socketserver
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Optional
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.core import binaries
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.update_checker import UpdateChecker
|
||||
|
||||
# shutdown() blocks until the serve loop polls again, and the 0.5s default is paid by every
|
||||
@@ -37,40 +34,7 @@ def loopback_only(request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatc
|
||||
def no_update_check(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Keep the release lookup of the health route off the network."""
|
||||
|
||||
monkeypatch.setattr(UpdateChecker, "check_for_updates_sync", lambda *args, **kwargs: None)
|
||||
async def no_release(*args: Any, **kwargs: Any) -> None:
|
||||
return None
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def default_muxing(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Mux with the default options, whatever the muxing block of the local unshackle.yaml sets."""
|
||||
monkeypatch.setattr(config, "muxing", {})
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def default_codec_names(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Name codecs with the built-in labels, whatever codec_names the local unshackle.yaml sets."""
|
||||
monkeypatch.setattr(config, "codec_names", {})
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mux_args(monkeypatch: pytest.MonkeyPatch) -> Callable[..., list[str]]:
|
||||
"""Run Tracks.mux up to mkvmerge and return its arguments; ``ids`` is what the track ID probe reports."""
|
||||
|
||||
class Stop(Exception):
|
||||
pass
|
||||
|
||||
def run(tracks: Any, ids: Optional[dict[str, int]] = None, **kwargs: Any) -> list[str]:
|
||||
captured: list[list[str]] = []
|
||||
|
||||
def fake_popen(args: list[str], **_: object) -> None:
|
||||
captured.append(args)
|
||||
raise Stop
|
||||
|
||||
monkeypatch.setattr("unshackle.core.tracks.tracks.subprocess.Popen", fake_popen)
|
||||
monkeypatch.setattr("unshackle.core.tracks.tracks.file_track_ids", lambda path: ids or {"video": 0})
|
||||
monkeypatch.setattr(binaries, "MKVToolNix", Path("mkvmerge"))
|
||||
with pytest.raises(Stop):
|
||||
tracks.mux("Title", delete=False, **kwargs)
|
||||
return captured[0]
|
||||
|
||||
return run
|
||||
monkeypatch.setattr(UpdateChecker, "check_for_updates", no_release)
|
||||
|
||||
@@ -6,7 +6,6 @@ import types
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.titles.movie import Movie
|
||||
|
||||
|
||||
@@ -52,42 +51,3 @@ def test_a_height_layout_is_named_bed_lfe_heights() -> None:
|
||||
)
|
||||
def test_layouts_without_heights_are_unchanged(layout: str | None, expected: str) -> None:
|
||||
assert named("E-AC-3", layout)["audio_channels"] == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("fmt", "expected"),
|
||||
[("E-AC-3", "DDP5.1"), ("AC-3", "DD5.1"), ("AC-4", "AC-4 5.1"), ("AAC", "AAC5.1")],
|
||||
)
|
||||
def test_a_name_ending_in_a_digit_is_spaced_from_the_channels(fmt: str, expected: str) -> None:
|
||||
assert named(fmt, "L R C LFE Ls Rs")["audio_full"] == expected
|
||||
|
||||
|
||||
def test_codec_names_overrides_the_built_in_name(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""The override is keyed by the name the filename would carry, and AC3 still gets its separator."""
|
||||
monkeypatch.setattr(config, "codec_names", {"DDP": "EAC3", "DD": "AC3"})
|
||||
assert named("E-AC-3", "L R C LFE Ls Rs")["audio_full"] == "EAC3 5.1"
|
||||
assert named("AC-3", "L R C LFE Ls Rs")["audio"] == "AC3"
|
||||
|
||||
|
||||
def test_codec_names_renames_video_and_each_hdr_part(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(config, "codec_names", {"H.265": "HEVC", "HDR10P": "HDR10+", "DTS-X": "DTSX"})
|
||||
video = types.SimpleNamespace(
|
||||
width=3840,
|
||||
height=2160,
|
||||
format="HEVC",
|
||||
scan_type="Progressive",
|
||||
other_display_aspect_ratio=["16:9"],
|
||||
hdr_format_commercial="HDR10+",
|
||||
hdr_format="Dolby Vision, Version 1.0, Profile 8.1",
|
||||
transfer_characteristics=None,
|
||||
transfer_characteristics_original=None,
|
||||
frame_rate="23.976",
|
||||
)
|
||||
movie = Movie(id_="movie-0001", service=DummyService, name="The Film", year=2024, language="en")
|
||||
context = movie.build_base_template_context(types.SimpleNamespace(video_tracks=[video], audio_tracks=[]))
|
||||
assert (context["video"], context["hdr"]) == ("HEVC", "DV.HDR10+")
|
||||
assert named("DTS-UHD", "L C R LFE Ls Rs")["audio_full"] == "DTSX 5.1", "a renamed DTS-X keeps its separator"
|
||||
|
||||
|
||||
def test_a_missing_audio_format_does_not_break_naming() -> None:
|
||||
assert named(None, "L R", channel_s=2)["audio_full"] == "2.0" # type: ignore[arg-type]
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
"""Tests for the Blowfish CBC stripe cipher (``unshackle.core.drm.blowfish_stripe``)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from collections.abc import Iterator
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
from Cryptodome.Cipher import Blowfish
|
||||
|
||||
from unshackle.core.api.handlers import serialize_audio_track, serialize_drm
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.constants import DOWNLOAD_CANCELLED
|
||||
from unshackle.core.drm import BlowfishStripe
|
||||
from unshackle.core.remote_service import build_tracks, reconstruct_drm
|
||||
from unshackle.core.tracks import Audio, Track
|
||||
from unshackle.core.tracks import track as track_module
|
||||
|
||||
KEY = bytes.fromhex("00112233445566778899aabbccddeeff")
|
||||
CHUNK = BlowfishStripe.CHUNK
|
||||
|
||||
|
||||
def stripe_encrypt(data: bytes, key: bytes = KEY) -> bytes:
|
||||
"""Reference encryption: every third full chunk, each with a fresh CBC run."""
|
||||
out = bytearray(data)
|
||||
for offset in range(0, len(data), CHUNK * 3):
|
||||
chunk = data[offset : offset + CHUNK]
|
||||
if len(chunk) == CHUNK:
|
||||
out[offset : offset + CHUNK] = Blowfish.new(key, Blowfish.MODE_CBC, iv=BlowfishStripe.IV).encrypt(chunk)
|
||||
return bytes(out)
|
||||
|
||||
|
||||
def test_decrypt_round_trip(tmp_path: Path) -> None:
|
||||
plain = os.urandom(CHUNK * 10 + 123)
|
||||
path = tmp_path / "track.flac"
|
||||
path.write_bytes(stripe_encrypt(plain))
|
||||
assert path.read_bytes() != plain
|
||||
|
||||
BlowfishStripe(KEY).decrypt(path)
|
||||
|
||||
assert path.read_bytes() == plain
|
||||
assert list(tmp_path.iterdir()) == [path]
|
||||
|
||||
|
||||
def test_short_trailing_chunk_untouched(tmp_path: Path) -> None:
|
||||
# the last stripe starts at CHUNK * 3 and holds only 100 bytes, so it stays clear
|
||||
plain = os.urandom(CHUNK * 3 + 100)
|
||||
encrypted = stripe_encrypt(plain)
|
||||
assert encrypted[CHUNK * 3 :] == plain[CHUNK * 3 :]
|
||||
path = tmp_path / "track.mp3"
|
||||
path.write_bytes(encrypted)
|
||||
|
||||
BlowfishStripe(KEY).decrypt(path)
|
||||
|
||||
assert path.read_bytes() == plain
|
||||
|
||||
|
||||
def test_serialize_round_trip_keeps_key() -> None:
|
||||
serialized = serialize_drm([BlowfishStripe(KEY)])
|
||||
assert serialized == [{"type": "blowfishstripe", "key": KEY.hex()}]
|
||||
|
||||
rebuilt = reconstruct_drm(serialized)
|
||||
|
||||
assert len(rebuilt) == 1
|
||||
assert isinstance(rebuilt[0], BlowfishStripe)
|
||||
assert rebuilt[0].key == KEY
|
||||
|
||||
|
||||
def test_remote_tracks_keep_the_stripe_drm() -> None:
|
||||
track = Audio(
|
||||
id_="a1", url="https://example.test/a1", language="en", codec=Audio.Codec.FLAC, drm=[BlowfishStripe(KEY)]
|
||||
)
|
||||
|
||||
rebuilt = build_tracks({"audio": [serialize_audio_track(track, include_url=True)]})
|
||||
|
||||
assert isinstance(rebuilt.audio[0].drm[0], BlowfishStripe)
|
||||
assert rebuilt.audio[0].drm[0].key == KEY
|
||||
|
||||
|
||||
def test_url_download_decrypts_once_without_a_kid_probe(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(config.directories, "temp", tmp_path)
|
||||
monkeypatch.setattr(Track, "get_key_id", lambda *a, **k: pytest.fail("a stripe-cipher file has no KID to probe"))
|
||||
monkeypatch.setattr(
|
||||
track_module, "assert_fragments_decrypted", lambda path: pytest.fail("a stripe-cipher file has no fragments")
|
||||
)
|
||||
plain = os.urandom(CHUNK * 7 + 5)
|
||||
|
||||
def downloader(**kwargs: Any) -> Iterator[dict[str, Any]]:
|
||||
(Path(kwargs["output_dir"]) / kwargs["filename"]).write_bytes(stripe_encrypt(plain))
|
||||
yield {"file_downloaded": Path(kwargs["output_dir"]) / kwargs["filename"]}
|
||||
|
||||
track = Audio(
|
||||
id_="a1",
|
||||
url="https://example.test/a1.flac",
|
||||
language="en",
|
||||
codec=Audio.Codec.FLAC,
|
||||
drm=[BlowfishStripe(KEY)],
|
||||
downloader=downloader,
|
||||
)
|
||||
try:
|
||||
track.download(
|
||||
session=requests.Session(), prepare_drm=partial(lambda *a, **kw: None), progress=partial(lambda **kw: None)
|
||||
)
|
||||
finally:
|
||||
DOWNLOAD_CANCELLED.clear()
|
||||
|
||||
assert track.path is not None and track.path.read_bytes() == plain
|
||||
assert track.drm is None
|
||||
@@ -26,8 +26,6 @@ language_tags:
|
||||
rules:
|
||||
- audio: no
|
||||
tag: NORDIC
|
||||
- audio_contain_all: [no, da]
|
||||
tag: NORDIC2
|
||||
update_checks: no
|
||||
"""
|
||||
|
||||
@@ -59,10 +57,6 @@ def test_a_no_rule_tags_a_norwegian_track(tmp_path: Path) -> None:
|
||||
assert evaluate_language_tag(rules, [Language.get("no")], []) == "NORDIC"
|
||||
|
||||
|
||||
def test_a_no_entry_survives_in_an_audio_contain_all_list(tmp_path: Path) -> None:
|
||||
assert _load(tmp_path).language_tags["rules"][1]["audio_contain_all"] == ["no", "da"]
|
||||
|
||||
|
||||
def test_tag_rules_keep_their_own_booleans(tmp_path: Path) -> None:
|
||||
"""tag_rules matches text and warns about a bare bool itself."""
|
||||
path = tmp_path / "unshackle.yaml"
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
from unshackle.core.config import Config, duplicate_key_lines, load_yaml
|
||||
|
||||
ALIASES = "base: &b\n x: 1\n x: 2\n self: *b\nother: *b\nlist:\n - y: 1\n y: 2\n"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("compose", [yaml.compose, YAML().compose], ids=["pyyaml", "ruamel"])
|
||||
def test_duplicate_key_lines_follows_aliases_without_looping(compose) -> None:
|
||||
assert duplicate_key_lines(compose(ALIASES)) == [(2, 3), (7, 8)]
|
||||
|
||||
|
||||
def test_load_yaml_warns_once_with_lines_and_keeps_the_later_copy(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
path = tmp_path / "unshackle.yaml"
|
||||
path.write_text("credentials:\n EXAMPLE: first-secret\n EXAMPLE: second-secret\n", encoding="utf-8")
|
||||
with caplog.at_level(logging.WARNING, logger="config"):
|
||||
data = load_yaml(path)
|
||||
load_yaml(path)
|
||||
assert data == {"credentials": {"EXAMPLE": "second-secret"}}
|
||||
assert caplog.messages == [f"{path}: duplicate key on lines 2 and 3. Unshackle uses the later one."]
|
||||
assert "EXAMPLE" not in caplog.text and "secret" not in caplog.text
|
||||
|
||||
|
||||
def test_config_from_yaml_warns_on_a_duplicate_key(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
|
||||
path = tmp_path / "unshackle.yaml"
|
||||
path.write_text("tag: first\ntag: second\n", encoding="utf-8")
|
||||
with caplog.at_level(logging.WARNING, logger="config"):
|
||||
assert Config.from_yaml(path).tag == "second"
|
||||
assert "duplicate key on lines 1 and 2" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"text",
|
||||
["a: 1\nb: [1, 2]\n", "", "a: &a\n x: 1\nb: &b\n y: 2\nc:\n <<: *a\n <<: *b\n"],
|
||||
ids=["valid", "empty", "two-merges"],
|
||||
)
|
||||
def test_load_yaml_matches_safe_load_without_a_warning(
|
||||
tmp_path: Path, text: str, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
path = tmp_path / "config.yaml"
|
||||
path.write_text(text, encoding="utf-8")
|
||||
with caplog.at_level(logging.WARNING, logger="config"):
|
||||
assert load_yaml(path) == yaml.safe_load(text)
|
||||
assert not caplog.records
|
||||
@@ -22,8 +22,3 @@ def test_panel_pads_an_indic_label_to_the_border() -> None:
|
||||
Console(file=out, width=20, color_system=None).print(Panel("हिंदी"))
|
||||
|
||||
assert out.getvalue().splitlines()[1] == "│ हिंदी" + " " * 12 + " │"
|
||||
|
||||
|
||||
def test_a_virama_conjunct_shares_one_cell() -> None:
|
||||
assert cell_len("हिन्दी") == 4 # न्द is one conjunct
|
||||
assert cell_len("ಕನ್ನಡ") == 4 # a Kannada virama does not join, so ನ್ನ keeps two cells
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from unshackle.core.manifests.dash import DASH
|
||||
|
||||
CAPTION = '<Role schemeIdUri="urn:mpeg:dash:role:2011" value="caption"/>'
|
||||
SDH = '<Accessibility schemeIdUri="urn:tva:metadata:cs:AudioPurposeCS:2007" value="2"/>'
|
||||
|
||||
|
||||
def test_caption_role_is_closed_caption() -> None:
|
||||
element = ET.fromstring(f"<AdaptationSet>{CAPTION}</AdaptationSet>")
|
||||
assert DASH.is_closed_caption(element) is True
|
||||
assert DASH.is_sdh(element) is False
|
||||
|
||||
|
||||
def test_caption_role_with_sdh_value_is_sdh_only() -> None:
|
||||
# a Subtitle cannot be both CC and SDH, so a set marked both used to fail the whole title
|
||||
element = ET.fromstring(f"<AdaptationSet>{CAPTION}{SDH}</AdaptationSet>")
|
||||
assert DASH.is_closed_caption(element) is False
|
||||
assert DASH.is_sdh(element) is True
|
||||
@@ -56,8 +56,11 @@ class RecordingLicence:
|
||||
drm.content_keys[kid] = KEY.hex()
|
||||
|
||||
|
||||
def licence_only(track: Any, tmp_path: Any) -> RecordingLicence:
|
||||
"""Run download_track as far as licensing and return the licence callback it used."""
|
||||
def test_download_track_licenses_clearkey_cenc(tmp_path, monkeypatch) -> None:
|
||||
track = DASH.from_text(MPD, MANIFEST_URL).to_tracks().videos[0]
|
||||
# KID normally comes from the init segment; short-circuit the probe (offline).
|
||||
monkeypatch.setattr(track, "get_key_id", lambda *args, **kwargs: KID)
|
||||
|
||||
licence = RecordingLicence()
|
||||
ctx = DownloadContext(
|
||||
save_path=tmp_path / "video.mp4",
|
||||
@@ -66,20 +69,12 @@ def licence_only(track: Any, tmp_path: Any) -> RecordingLicence:
|
||||
license_widevine=licence,
|
||||
cdm=None,
|
||||
)
|
||||
|
||||
DOWNLOAD_LICENCE_ONLY.set()
|
||||
try:
|
||||
DASH.download_track(track=track, ctx=ctx)
|
||||
finally:
|
||||
DOWNLOAD_LICENCE_ONLY.clear()
|
||||
return licence
|
||||
|
||||
|
||||
def test_download_track_licenses_clearkey_cenc(tmp_path, monkeypatch) -> None:
|
||||
track = DASH.from_text(MPD, MANIFEST_URL).to_tracks().videos[0]
|
||||
# KID normally comes from the init segment; short-circuit the probe (offline).
|
||||
monkeypatch.setattr(track, "get_key_id", lambda *args, **kwargs: KID)
|
||||
|
||||
licence = licence_only(track, tmp_path)
|
||||
|
||||
assert len(licence.calls) == 1, "ClearKeyCENC track was never licensed"
|
||||
drm, track_kid = licence.calls[0]
|
||||
@@ -87,17 +82,3 @@ def test_download_track_licenses_clearkey_cenc(tmp_path, monkeypatch) -> None:
|
||||
assert track_kid == KID
|
||||
# with content keys populated, decrypt has what it needs
|
||||
assert drm.content_keys == {KID: KEY.hex()}
|
||||
|
||||
|
||||
def test_download_track_keeps_service_drm_when_manifest_has_none(tmp_path, monkeypatch) -> None:
|
||||
"""A service-set non-Widevine DRM survives a manifest with no ContentProtection, and is licensed."""
|
||||
service_drm = [ClearKeyCENC([KID], LAURL)]
|
||||
bare_mpd = MPD.split("<ContentProtection")[0] + MPD.split("</ContentProtection>")[1]
|
||||
track = DASH.from_text(bare_mpd, MANIFEST_URL).to_tracks().videos[0]
|
||||
track.drm = service_drm
|
||||
monkeypatch.setattr(track, "get_key_id", lambda *args, **kwargs: KID)
|
||||
|
||||
licence = licence_only(track, tmp_path)
|
||||
|
||||
assert track.drm == service_drm
|
||||
assert len(licence.calls) == 1
|
||||
|
||||
@@ -4,13 +4,15 @@ resource instead of per-segment files + merge."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from unshackle.core.manifests import DASH
|
||||
|
||||
URL = "https://cdn/media.mp4"
|
||||
|
||||
|
||||
def collapsible(segments, init_len: int, is_subtitle: bool = False) -> bool:
|
||||
return DASH.collapsible_single_url(is_subtitle, segments, init_len) is not None
|
||||
def collapsible(segments, init_len: Optional[int], is_subtitle: bool = False) -> bool:
|
||||
return DASH.collapsible_single_url(is_subtitle, segments, init_len)
|
||||
|
||||
|
||||
def test_segmentbase_single_range_eligible():
|
||||
@@ -27,6 +29,10 @@ def test_subtitle_never_eligible():
|
||||
assert collapsible([(URL, "863-999999")], init_len=863, is_subtitle=True) is False
|
||||
|
||||
|
||||
def test_missing_init_len_ineligible():
|
||||
assert collapsible([(URL, "863-999999")], init_len=None) is False
|
||||
|
||||
|
||||
def test_missing_range_ineligible():
|
||||
assert collapsible([(URL, None)], init_len=863) is False
|
||||
assert collapsible([(URL, "863-1999"), (URL, None)], init_len=863) is False
|
||||
@@ -37,14 +43,9 @@ def test_mixed_urls_ineligible():
|
||||
assert collapsible(segments, init_len=863) is False
|
||||
|
||||
|
||||
def test_first_segment_gap_after_init_left_to_prefix_check():
|
||||
# the gap may be the sidx; single_url_prefix_matches decides from the bytes
|
||||
segments = [(URL, "900-1999"), (URL, "2000-2999")]
|
||||
assert DASH.collapsible_single_url(False, segments, 863) == (900, 2999)
|
||||
|
||||
|
||||
def test_first_segment_inside_init_ineligible():
|
||||
assert collapsible([(URL, "800-1999")], init_len=863) is False
|
||||
def test_first_segment_gap_after_init_ineligible():
|
||||
# first media byte does not immediately follow the init prefix
|
||||
assert collapsible([(URL, "900-1999")], init_len=863) is False
|
||||
|
||||
|
||||
def test_gap_between_segments_ineligible():
|
||||
|
||||
@@ -9,8 +9,6 @@ localhost server, asserting that:
|
||||
- a SegmentList whose ranges collapse fetches the parent resource whole in one direct
|
||||
(Range-less) request and writes a byte-correct file at ``save_path``, leaving no
|
||||
segment dir or ``.!dev`` artifacts, and
|
||||
- a SegmentBase track writes the parent byte for byte, when the server sends its total
|
||||
length and when it sends an unknown (``*``) one, and
|
||||
- a track with mixed segment URLs still takes the per-segment download-and-merge path, and
|
||||
- that same segmented path raises ``DownloadCancelled`` when a sibling track's failure has
|
||||
already set ``DOWNLOAD_CANCELLED``, instead of treating the segments the cancel left
|
||||
@@ -20,7 +18,6 @@ localhost server, asserting that:
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import struct
|
||||
import threading
|
||||
from functools import partial
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
@@ -59,12 +56,10 @@ class _Handler(BaseHTTPRequestHandler):
|
||||
self.end_headers()
|
||||
return
|
||||
if rng:
|
||||
first, _, last = rng.removeprefix("bytes=").partition("-")
|
||||
start, end = int(first), int(last) if last else len(body) - 1
|
||||
start, end = (int(x) for x in rng.removeprefix("bytes=").split("-"))
|
||||
chunk = body[start : end + 1]
|
||||
self.send_response(206)
|
||||
total = "*" if server.unknown_total else len(body)
|
||||
self.send_header("Content-Range", f"bytes {start}-{end}/{total}")
|
||||
self.send_header("Content-Range", f"bytes {start}-{end}/{len(body)}")
|
||||
body = chunk
|
||||
else:
|
||||
self.send_response(200)
|
||||
@@ -82,7 +77,6 @@ def server():
|
||||
srv.lock = threading.Lock()
|
||||
srv.requests = []
|
||||
srv.routes = {}
|
||||
srv.unknown_total = False
|
||||
thread = threading.Thread(target=srv.serve_forever, daemon=True)
|
||||
thread.start()
|
||||
yield srv
|
||||
@@ -105,6 +99,48 @@ def base(srv) -> str:
|
||||
return f"http://127.0.0.1:{srv.server_address[1]}/"
|
||||
|
||||
|
||||
def collapse_mpd(srv) -> str:
|
||||
# SegmentList on one media.mp4: init is bytes [0, INIT_LEN), media ranges cover the rest
|
||||
# contiguously -> collapsible_single_url returns the URL and download_track collapses.
|
||||
return f"""<?xml version="1.0"?>
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
|
||||
<BaseURL>{base(srv)}</BaseURL>
|
||||
<Period id="0">
|
||||
<AdaptationSet contentType="video" mimeType="video/mp4" lang="en">
|
||||
<Representation id="v0" codecs="avc1.640028" bandwidth="1000000" width="1920" height="1080">
|
||||
<BaseURL>media.mp4</BaseURL>
|
||||
<SegmentList timescale="1">
|
||||
<Initialization range="0-{INIT_LEN - 1}"/>
|
||||
<SegmentURL mediaRange="{INIT_LEN}-5119"/>
|
||||
<SegmentURL mediaRange="5120-{len(PARENT) - 1}"/>
|
||||
</SegmentList>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>"""
|
||||
|
||||
|
||||
def clipped_mpd(srv) -> str:
|
||||
# same parent, but the ranges stop short of its end -> the collapsed file must be trimmed
|
||||
# to the last indexed byte, not left holding the parent's trailing bytes.
|
||||
return f"""<?xml version="1.0"?>
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
|
||||
<BaseURL>{base(srv)}</BaseURL>
|
||||
<Period id="0">
|
||||
<AdaptationSet contentType="video" mimeType="video/mp4" lang="en">
|
||||
<Representation id="v0" codecs="avc1.640028" bandwidth="1000000" width="1920" height="1080">
|
||||
<BaseURL>media.mp4</BaseURL>
|
||||
<SegmentList timescale="1">
|
||||
<Initialization range="0-{INIT_LEN - 1}"/>
|
||||
<SegmentURL mediaRange="{INIT_LEN}-5119"/>
|
||||
<SegmentURL mediaRange="5120-{CLIP_END}"/>
|
||||
</SegmentList>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>"""
|
||||
|
||||
|
||||
def mixed_mpd(srv) -> str:
|
||||
# Two SegmentURLs on distinct paths -> mixed URLs -> predicate False -> segmented path.
|
||||
return f"""<?xml version="1.0"?>
|
||||
@@ -124,51 +160,6 @@ def mixed_mpd(srv) -> str:
|
||||
</MPD>"""
|
||||
|
||||
|
||||
def sidx_box(sizes: list[int]) -> bytes:
|
||||
# version 0 sidx: one MEDIA reference per size, each starting with a SAP
|
||||
refs = b"".join(struct.pack(">III", size, 1, 0x90000000) for size in sizes)
|
||||
body = struct.pack(">IIIIIHH", 0, 1, 1, 0, 0, 0, len(sizes)) + refs
|
||||
return struct.pack(">I", 8 + len(body)) + b"sidx" + body
|
||||
|
||||
|
||||
def media_mpd(srv, segments: str) -> str:
|
||||
# one Representation on media.mp4, described by the given segment element
|
||||
return f"""<?xml version="1.0"?>
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
|
||||
<BaseURL>{base(srv)}</BaseURL>
|
||||
<Period id="0">
|
||||
<AdaptationSet contentType="video" mimeType="video/mp4" lang="en">
|
||||
<Representation id="v0" codecs="avc1.640028" bandwidth="1000000" width="1920" height="1080">
|
||||
<BaseURL>media.mp4</BaseURL>
|
||||
{segments}
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>"""
|
||||
|
||||
|
||||
def ranged_mpd(srv, ranges: list[tuple[int, int]], init: str = f'range="0-{INIT_LEN - 1}"') -> str:
|
||||
# SegmentList of byte ranges on one media.mp4, with the given Initialization attributes
|
||||
segment_urls = "\n".join(f' <SegmentURL mediaRange="{s}-{e}"/>' for s, e in ranges)
|
||||
return media_mpd(
|
||||
srv,
|
||||
f""" <SegmentList timescale="1">
|
||||
<Initialization {init}/>
|
||||
{segment_urls}
|
||||
</SegmentList>""",
|
||||
)
|
||||
|
||||
|
||||
def segment_base_mpd(srv) -> str:
|
||||
# the media range comes from the init response, not the manifest
|
||||
return media_mpd(
|
||||
srv,
|
||||
f""" <SegmentBase>
|
||||
<Initialization range="0-{INIT_LEN - 1}"/>
|
||||
</SegmentBase>""",
|
||||
)
|
||||
|
||||
|
||||
def make_track(mpd: str, srv):
|
||||
return DASH.from_text(mpd, url=f"{base(srv)}manifest.mpd").to_tracks(language="en").videos[0]
|
||||
|
||||
@@ -183,7 +174,7 @@ def make_ctx(tmp_path, name="out.mp4"):
|
||||
|
||||
def test_collapse_downloads_parent_whole_in_one_direct_request(server, tmp_path):
|
||||
server.routes["/media.mp4"] = PARENT
|
||||
track = make_track(ranged_mpd(server, [(INIT_LEN, 5119), (5120, len(PARENT) - 1)]), server)
|
||||
track = make_track(collapse_mpd(server), server)
|
||||
ctx = make_ctx(tmp_path, "collapsed.mp4")
|
||||
|
||||
DASH.download_track(track, ctx)
|
||||
@@ -203,8 +194,7 @@ def test_collapse_downloads_parent_whole_in_one_direct_request(server, tmp_path)
|
||||
|
||||
def test_collapse_trims_parent_bytes_past_the_last_segment(server, tmp_path):
|
||||
server.routes["/media.mp4"] = PARENT
|
||||
# the ranges stop short of the parent's end, so the collapsed file must be trimmed
|
||||
track = make_track(ranged_mpd(server, [(INIT_LEN, 5119), (5120, CLIP_END)]), server)
|
||||
track = make_track(clipped_mpd(server), server)
|
||||
ctx = make_ctx(tmp_path, "clipped.mp4")
|
||||
|
||||
DASH.download_track(track, ctx)
|
||||
@@ -213,81 +203,6 @@ def test_collapse_trims_parent_bytes_past_the_last_segment(server, tmp_path):
|
||||
assert ctx.save_path.read_bytes() == PARENT[: CLIP_END + 1]
|
||||
|
||||
|
||||
def test_collapse_keeps_the_sidx_between_init_and_first_segment(server, tmp_path):
|
||||
media = [bytes([0xC0]) * 3000, bytes([0xD1]) * 2000]
|
||||
head = PARENT[:INIT_LEN] + sidx_box([len(m) for m in media])
|
||||
parent = head + b"".join(media)
|
||||
server.routes["/media.mp4"] = parent
|
||||
ranges = [(len(head), len(head) + 2999), (len(head) + 3000, len(parent) - 1)]
|
||||
ctx = make_ctx(tmp_path, "sidx.mp4")
|
||||
|
||||
DASH.download_track(make_track(ranged_mpd(server, ranges), server), ctx)
|
||||
|
||||
assert ctx.save_path.read_bytes() == parent
|
||||
assert [path for path, rng in server.requests if rng is None] == ["/media.mp4"]
|
||||
|
||||
|
||||
def test_segment_base_collapse_ends_at_the_last_byte(server, tmp_path):
|
||||
server.routes["/media.mp4"] = PARENT
|
||||
ctx = make_ctx(tmp_path, "segment_base.mp4")
|
||||
|
||||
DASH.download_track(make_track(segment_base_mpd(server), server), ctx)
|
||||
|
||||
# the media range ends at total - 1, so the truncate after the collapse adds no byte
|
||||
assert ctx.save_path.read_bytes() == PARENT
|
||||
|
||||
|
||||
def test_segment_base_unknown_total_fetches_the_rest_open_ended(server, tmp_path):
|
||||
server.routes["/media.mp4"] = PARENT
|
||||
server.unknown_total = True
|
||||
ctx = make_ctx(tmp_path, "unknown_total.mp4")
|
||||
|
||||
DASH.download_track(make_track(segment_base_mpd(server), server), ctx)
|
||||
|
||||
assert ctx.save_path.read_bytes() == PARENT
|
||||
assert ("/media.mp4", f"bytes={INIT_LEN}-") in server.requests
|
||||
|
||||
|
||||
def test_leading_gap_that_is_not_a_sidx_takes_segmented_path(server, tmp_path):
|
||||
# a filtered period cut from the same file leaves a gap of media, not an index
|
||||
gap = struct.pack(">I", 1000) + b"moof" + bytes(992)
|
||||
media = bytes([0xC0]) * 3000
|
||||
server.routes["/media.mp4"] = PARENT[:INIT_LEN] + gap + media
|
||||
start = INIT_LEN + len(gap)
|
||||
ctx = make_ctx(tmp_path, "gap.mp4")
|
||||
|
||||
DASH.download_track(make_track(ranged_mpd(server, [(start, start + 2999)]), server), ctx)
|
||||
|
||||
assert ctx.save_path.read_bytes() == PARENT[:INIT_LEN] + media
|
||||
assert not [path for path, rng in server.requests if rng is None]
|
||||
|
||||
|
||||
def test_sidx_indexing_more_than_the_listed_segments_takes_segmented_path(server, tmp_path):
|
||||
# the file carries a post-roll after the listed segments, and the sidx indexes it too
|
||||
media, post_roll = bytes([0xC0]) * 3000, bytes([0xEE]) * 500
|
||||
head = PARENT[:INIT_LEN] + sidx_box([len(media), len(post_roll)])
|
||||
server.routes["/media.mp4"] = head + media + post_roll
|
||||
ctx = make_ctx(tmp_path, "post-roll.mp4")
|
||||
|
||||
DASH.download_track(make_track(ranged_mpd(server, [(len(head), len(head) + 2999)]), server), ctx)
|
||||
|
||||
assert ctx.save_path.read_bytes() == PARENT[:INIT_LEN] + media
|
||||
|
||||
|
||||
def test_init_from_another_file_takes_segmented_path(server, tmp_path):
|
||||
# the media ranges start where an init of the same length would end, but the init is elsewhere
|
||||
init = bytes([0x11]) * INIT_LEN
|
||||
server.routes["/init.bin"] = init
|
||||
server.routes["/media.mp4"] = PARENT
|
||||
ranges = [(INIT_LEN, 5119), (5120, len(PARENT) - 1)]
|
||||
ctx = make_ctx(tmp_path, "init-elsewhere.mp4")
|
||||
|
||||
DASH.download_track(make_track(ranged_mpd(server, ranges, init='sourceURL="init.bin"'), server), ctx)
|
||||
|
||||
assert ctx.save_path.read_bytes() == init + PARENT[INIT_LEN:]
|
||||
assert not [path for path, rng in server.requests if rng is None and path == "/media.mp4"]
|
||||
|
||||
|
||||
def test_non_collapse_takes_segmented_merge_path(server, tmp_path):
|
||||
server.routes["/init.bin"] = INIT2
|
||||
server.routes["/part0.bin"] = PART0
|
||||
|
||||
@@ -185,6 +185,6 @@ def test_segment_base_range_survives_a_skipped_probe(server, probes):
|
||||
probe_kid=False,
|
||||
)
|
||||
|
||||
assert segments == [(f"{base(server)}p1.mp4", f"{INIT_LEN}-{len(MEDIA) - 1}")]
|
||||
assert segments == [(f"{base(server)}p1.mp4", f"{INIT_LEN}-{len(MEDIA)}")]
|
||||
assert track_kid is None
|
||||
assert not probes
|
||||
|
||||
@@ -61,31 +61,3 @@ def test_timeline_numbers_follow_start_number(start: int, count: int) -> None:
|
||||
@pytest.mark.parametrize(("start", "seconds", "count"), [(0, "1M36.720", 17), (1, "1M36.720", 17), (2642, "30", 5)])
|
||||
def test_duration_numbers_follow_start_number(start: int, seconds: str, count: int) -> None:
|
||||
assert _numbers(DURATION_MPD.format(start=start, seconds=seconds)) == list(range(start, start + count))
|
||||
|
||||
|
||||
TIME_MPD = """
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" type="static" mediaPresentationDuration="PT10S">
|
||||
<Period id="0" start="PT0S" duration="PT10S">
|
||||
<AdaptationSet mimeType="audio/mp4">
|
||||
<SegmentTemplate timescale="10" media="a/$Time$.mp4">
|
||||
<SegmentTimeline>{timeline}</SegmentTimeline>
|
||||
</SegmentTemplate>
|
||||
<Representation id="a" bandwidth="1"/>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("timeline", "starts"),
|
||||
[
|
||||
# a negative @r repeats to the end of the Period, or to the next S@t
|
||||
('<S t="0" d="20" r="-1"/>', [0, 20, 40, 60, 80]),
|
||||
('<S t="0" d="20" r="-1"/><S t="60" d="40"/>', [0, 20, 40, 60]),
|
||||
# an S with @p cycles the Pattern durations from index @pE
|
||||
('<Pattern id="1"><P d="10" r="1"/><P d="30"/></Pattern><S t="0" r="4" p="1" pE="1"/>', [0, 10, 40, 50, 60]),
|
||||
],
|
||||
)
|
||||
def test_timeline_repeat_and_pattern_forms(timeline: str, starts: list[int]) -> None:
|
||||
assert _numbers(TIME_MPD.format(timeline=timeline)) == starts
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
"""get_boxes must give each thread its own box when tracks read their init segments at the same time."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import struct
|
||||
import threading
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from unshackle.core.utilities import get_boxes
|
||||
|
||||
|
||||
def tenc_init(kid: UUID, version: int, crypt_skip: int) -> bytes:
|
||||
body = struct.pack(">B3s", version, b"\0\0\0") + bytes([0, crypt_skip if version else 0]) + b"\x01\x10" + kid.bytes
|
||||
return b"\x00" * 8 + struct.pack(">I", 8 + len(body)) + b"tenc" + body
|
||||
|
||||
|
||||
def test_get_boxes_finds_the_tenc() -> None:
|
||||
kid = uuid4()
|
||||
(box,) = get_boxes(tenc_init(kid, 1, 0x19), b"tenc")
|
||||
assert box.key_ID == kid
|
||||
|
||||
|
||||
def test_get_boxes_is_right_when_tracks_parse_at_the_same_time() -> None:
|
||||
cases = [(uuid4(), version, crypt_skip) for version, crypt_skip in ((0, 0), (1, 0x19), (1, 0x91), (1, 0x55))] * 2
|
||||
failures: list[str] = []
|
||||
|
||||
def parse(kid: UUID, version: int, crypt_skip: int) -> None:
|
||||
data = tenc_init(kid, version, crypt_skip)
|
||||
for _ in range(1500):
|
||||
try:
|
||||
boxes = list(get_boxes(data, b"tenc"))
|
||||
except Exception as e:
|
||||
failures.append(repr(e))
|
||||
continue
|
||||
if [box.key_ID for box in boxes] != [kid]:
|
||||
failures.append("wrong or missing tenc")
|
||||
|
||||
threads = [threading.Thread(target=parse, args=case) for case in cases]
|
||||
for thread in threads:
|
||||
thread.start()
|
||||
for thread in threads:
|
||||
thread.join(timeout=120)
|
||||
assert not failures, failures[:3]
|
||||
assert not any(thread.is_alive() for thread in threads)
|
||||
@@ -215,9 +215,3 @@ def test_a_quoted_dl_workers_value_works_like_the_cli(monkeypatch: pytest.Monkey
|
||||
service = SimpleNamespace(get_tracks=lambda title: SimpleNamespace(videos=[hevc("v", 2160)]), session=None)
|
||||
monkeypatch.setitem(config.dl, "workers", "8")
|
||||
assert probe_calls(monkeypatch, service) == [8]
|
||||
|
||||
|
||||
def test_a_dv_track_with_an_hdr10_base_lists_as_dv_plus_hdr10() -> None:
|
||||
video = Video(url="https://x/v.mp4", language="en", codec=Video.Codec.HEVC, range_=Video.Range.DV, hdr10_base=True)
|
||||
assert "[H.265, DV+HDR10]" in str(video)
|
||||
assert Video.from_dict(video.to_dict()).hdr10_base
|
||||
|
||||
@@ -31,7 +31,7 @@ from unshackle.core.api.handlers import validate_download_parameters
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.service import Service, TrackRequest
|
||||
from unshackle.core.services import Services
|
||||
from unshackle.core.tracks import Audio, Chapter, Subtitle, Tracks, Video
|
||||
from unshackle.core.tracks import Tracks, Video
|
||||
from unshackle.core.tracks import hybrid as hybrid_mod
|
||||
from unshackle.core.tracks.hybrid import Hybrid, hdr10plus_mean_pq, hdr10plus_shots, nits_to_pq
|
||||
|
||||
@@ -652,14 +652,19 @@ def video(
|
||||
|
||||
def test_hybrid_fails_with_neither_a_base_nor_dv() -> None:
|
||||
assert hybrid_gate_failure([video("sdr", Video.Range.SDR)], True) == (
|
||||
"HYBRID needs HDR10/HDR10+ and DV tracks, available ranges: SDR"
|
||||
"HYBRID mode requires both HDR10/HDR10+ and DV tracks, but neither is available",
|
||||
"Available ranges: SDR",
|
||||
)
|
||||
assert hybrid_gate_failure([], True) == (
|
||||
"HYBRID mode requires both HDR10/HDR10+ and DV tracks, but neither is available",
|
||||
"Available ranges: none",
|
||||
)
|
||||
assert hybrid_gate_failure([], True) == "HYBRID needs HDR10/HDR10+ and DV tracks, available ranges: none"
|
||||
|
||||
|
||||
def test_hybrid_fails_with_dv_only() -> None:
|
||||
assert hybrid_gate_failure([video("dv", Video.Range.DV)], True) == (
|
||||
"HYBRID needs HDR10/HDR10+ and DV tracks, available ranges: DV"
|
||||
"HYBRID mode requires both HDR10/HDR10+ and DV tracks, but only DV is available",
|
||||
"Available ranges: DV",
|
||||
)
|
||||
|
||||
|
||||
@@ -676,16 +681,27 @@ def test_hybrid_goes_on_with_a_base_and_dv_whatever_the_flag() -> None:
|
||||
def test_hybrid_fails_up_front_when_no_base_is_hevc() -> None:
|
||||
"""dovi_tool injects into HEVC, so an all-AV1 title fails before it downloads anything."""
|
||||
videos = [video("av1", Video.Range.HDR10P, codec=Video.Codec.AV1), video("dv", Video.Range.DV)]
|
||||
assert hybrid_gate_failure(videos, False) == "HYBRID needs an HEVC HDR10/HDR10+ base, available codecs: AV1"
|
||||
assert hybrid_gate_failure(videos, False) == (
|
||||
"HYBRID mode requires an HEVC HDR10/HDR10+ base, but none is available",
|
||||
"Available HDR10/HDR10+ codecs: AV1",
|
||||
)
|
||||
assert hybrid_gate_failure(videos + [video("h", Video.Range.HDR10, codec=None)], False) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ranges, to_dv, detail",
|
||||
[
|
||||
([Video.Range.HDR10P], False, "HDR10P; add --generate-dv to make DV from HDR10+"),
|
||||
([Video.Range.HDR10], False, "HDR10"),
|
||||
([Video.Range.HDR10], True, "HDR10; --generate-dv found no HEVC HDR10+ track"),
|
||||
(
|
||||
[Video.Range.HDR10P],
|
||||
False,
|
||||
"Available ranges: HDR10P. Add --generate-dv to generate Dolby Vision from HDR10+.",
|
||||
),
|
||||
([Video.Range.HDR10], False, "Available ranges: HDR10"),
|
||||
(
|
||||
[Video.Range.HDR10],
|
||||
True,
|
||||
"Available ranges: HDR10. --generate-dv needs an HEVC HDR10+ track, and the service returned none.",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_hybrid_fails_without_dv_and_hints_at_the_flag_only_when_it_is_off(
|
||||
@@ -693,7 +709,10 @@ def test_hybrid_fails_without_dv_and_hints_at_the_flag_only_when_it_is_off(
|
||||
) -> None:
|
||||
"""A service that fetches HYBRID by hand may never return HDR10+; the hint must not blame the user then."""
|
||||
videos = [video(r.name, r) for r in ranges]
|
||||
assert hybrid_gate_failure(videos, to_dv) == f"HYBRID needs HDR10/HDR10+ and DV tracks, available ranges: {detail}"
|
||||
assert hybrid_gate_failure(videos, to_dv) == (
|
||||
"HYBRID mode requires both HDR10/HDR10+ and DV tracks, but only HDR10 is available",
|
||||
detail,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("to_dv", [False, True])
|
||||
@@ -731,50 +750,3 @@ def test_a_native_hybrid_passes_the_gate_and_takes_no_base_at_its_resolution() -
|
||||
|
||||
assert [v.id for v in bases] == ["h1080"]
|
||||
assert dv is not None and dv.id == "dvp2160"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ranges, codecs, surround_on",
|
||||
[
|
||||
([Video.Range.SDR, Video.Range.HDR10], [], Video.Range.HDR10),
|
||||
([Video.Range.HYBRID], [Video.Codec.AVC, Video.Codec.HEVC], Video.Range.DV),
|
||||
],
|
||||
)
|
||||
def test_variants_merge_every_manifest_but_skip_a_subtitle_copy_and_later_chapters(
|
||||
ranges: list[Video.Range], codecs: list[Video.Codec], surround_on: Video.Range
|
||||
) -> None:
|
||||
"""Audio and a subtitle language that only a later manifest offers are kept. A track whose ID
|
||||
differs per manifest (a signed URL) is not duplicated, and later chapters do not clash."""
|
||||
fetches = 0
|
||||
|
||||
def fetch(title: Any, codec: Any, range_: Video.Range) -> Tracks:
|
||||
nonlocal fetches
|
||||
fetches += 1
|
||||
tracks = Tracks()
|
||||
tracks.add(
|
||||
Video(
|
||||
url="https://example.invalid/v", language="en", id_=f"{range_.name}{codec}", codec=codec, range_=range_
|
||||
)
|
||||
)
|
||||
tracks.add(Audio(url="https://example.invalid/a2", language="en", id_=f"stereo{fetches}", channels=2))
|
||||
if range_ == surround_on:
|
||||
tracks.add(Audio(url="https://example.invalid/a6", language="en", id_="surround", channels=6))
|
||||
tracks.add(Subtitle(url=f"https://example.invalid/s?tok={fetches}", language="en", id_=f"sub{fetches}"))
|
||||
if range_ == surround_on:
|
||||
tracks.add(Subtitle(url=f"https://example.invalid/j?tok={fetches}", language="ja", id_=f"ja{fetches}"))
|
||||
tracks.add(Chapter(0))
|
||||
return tracks
|
||||
|
||||
service = SimpleNamespace(
|
||||
track_request=TrackRequest(codecs=codecs, ranges=ranges),
|
||||
log=logging.getLogger("variants-test"),
|
||||
)
|
||||
|
||||
tracks = Service.get_tracks_for_variants(service, None, fetch) # type: ignore[arg-type]
|
||||
|
||||
assert fetches > 1
|
||||
assert sorted(a.id for a in tracks.audio) == ["stereo1", "surround"]
|
||||
assert [str(s.language) for s in tracks.subtitles] == ["en", "ja"]
|
||||
assert tracks.subtitles[0].id == "sub1"
|
||||
assert len(tracks.chapters) == 1
|
||||
assert len(tracks.videos) == fetches
|
||||
|
||||
@@ -150,4 +150,4 @@ def test_a_download_stopped_by_a_click_exception_reports_only_its_message() -> N
|
||||
lines = dl.failure_lines(error)
|
||||
|
||||
assert lines == [":x: Download Failed...", f" {error.format_message()}"]
|
||||
assert dl.failure_lines(ValueError("boom")) == [":x: Download Failed...", " ValueError: boom"]
|
||||
assert "unexpected error" in dl.failure_lines(ValueError("boom"))[-1]
|
||||
|
||||
@@ -3,8 +3,6 @@ from pathlib import Path
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.core.drm.verify import PIFF_TENC, PIFF_TFXD, KidMap, kid_windows, pick_windows
|
||||
|
||||
A, B, C = UUID(int=0xA), UUID(int=0xB), UUID(int=0xC)
|
||||
@@ -46,28 +44,15 @@ def sbgp(*runs: tuple[int, int]) -> bytes:
|
||||
return full(b"sbgp", b"seig" + struct.pack(">I", len(runs)) + b"".join(struct.pack(">II", *run) for run in runs))
|
||||
|
||||
|
||||
def trak(*sample_entries: bytes, track: int = 1, handler: bytes = b"vide", stbl: bytes = b"") -> bytes:
|
||||
def movie(*sample_entries: bytes, handler: bytes = b"vide", stbl: bytes = b"") -> bytes:
|
||||
stsd = full(b"stsd", struct.pack(">I", len(sample_entries)) + b"".join(sample_entries))
|
||||
hdlr = full(b"hdlr", bytes(4) + handler + bytes(12))
|
||||
return box(
|
||||
trak = box(
|
||||
b"trak",
|
||||
full(b"tkhd", bytes(8) + struct.pack(">I", track)),
|
||||
full(b"tkhd", bytes(8) + struct.pack(">I", 1)),
|
||||
box(b"mdia", full(b"mdhd", bytes(8) + struct.pack(">I", 1000)), hdlr, box(b"minf", box(b"stbl", stsd, stbl))),
|
||||
)
|
||||
|
||||
|
||||
def movie(*sample_entries: bytes, handler: bytes = b"vide", stbl: bytes = b"", others: bytes = b"") -> bytes:
|
||||
moov = box(
|
||||
b"moov",
|
||||
trak(*sample_entries, handler=handler, stbl=stbl),
|
||||
others,
|
||||
box(b"mvex", full(b"trex", struct.pack(">III", 1, 1, 0))),
|
||||
)
|
||||
return box(b"ftyp", b"iso6") + moov
|
||||
|
||||
|
||||
def clear_audio(others: bytes = b"") -> bytes:
|
||||
return movie(box(b"mp4a", bytes(28)), handler=b"soun", others=others)
|
||||
return box(b"ftyp", b"iso6") + box(b"moov", trak, box(b"mvex", full(b"trex", struct.pack(">III", 1, 1, 0))))
|
||||
|
||||
|
||||
def moof(
|
||||
@@ -193,45 +178,3 @@ def test_not_a_fragmented_mp4(tmp_path: Path) -> None:
|
||||
path = tmp_path / "video.ts"
|
||||
path.write_bytes(b"\x47" * 188 * 4)
|
||||
assert kid_windows(path) is None
|
||||
|
||||
|
||||
def test_clear_mp4_maps_no_kid(tmp_path: Path) -> None:
|
||||
path = tmp_path / "clear.m4a"
|
||||
path.write_bytes(clear_audio() + moof(1, 0))
|
||||
assert kid_windows(path) == KidMap({}, False)
|
||||
|
||||
|
||||
def test_encrypted_entry_without_a_tenc_is_not_clear(tmp_path: Path) -> None:
|
||||
path = tmp_path / "enc.mp4"
|
||||
path.write_bytes(movie(box(b"encv", bytes(78), box(b"sinf", box(b"frma", b"avc1")))) + moof(1, 0))
|
||||
assert kid_windows(path) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", [b"enct", b"encs", b"drmi"])
|
||||
def test_other_encrypted_entry_kinds_are_not_clear(tmp_path: Path, kind: bytes) -> None:
|
||||
path = tmp_path / "enc.mp4"
|
||||
path.write_bytes(movie(box(kind, bytes(16)), handler=b"text") + moof(1, 0))
|
||||
assert kid_windows(path) is None
|
||||
|
||||
|
||||
def test_a_clear_entry_with_a_protecting_senc_is_not_clear(tmp_path: Path) -> None:
|
||||
path = tmp_path / "enc.m4a"
|
||||
senc = full(b"senc", struct.pack(">I", 1) + bytes(8))
|
||||
path.write_bytes(clear_audio() + moof(1, 0, senc))
|
||||
assert kid_windows(path) is None
|
||||
path.write_bytes(clear_audio() + moof(1, 0, full(b"senc", bytes(4))))
|
||||
assert kid_windows(path) == KidMap({}, False)
|
||||
|
||||
|
||||
def test_only_the_tracks_with_fragments_decide_clear(tmp_path: Path) -> None:
|
||||
path = tmp_path / "clear.m4a"
|
||||
path.write_bytes(clear_audio(others=trak(encv(A), track=2)) + moof(1, 0))
|
||||
assert kid_windows(path) == KidMap({}, False)
|
||||
path.write_bytes(clear_audio(others=trak(encv(A), track=2)))
|
||||
assert kid_windows(path) is None
|
||||
|
||||
|
||||
def test_a_clear_lead_beside_an_encrypted_entry_is_not_clear(tmp_path: Path) -> None:
|
||||
path = tmp_path / "lead.mp4"
|
||||
path.write_bytes(movie(box(b"avc1", bytes(78)), encv(A)) + moof(1, 0))
|
||||
assert kid_windows(path) is None
|
||||
|
||||
@@ -31,23 +31,6 @@ def test_subs_contain_all_needs_every_entry() -> None:
|
||||
assert evaluate_language_tag(rules, JA, EN_ES) == ""
|
||||
|
||||
|
||||
def test_audio_contain_all_tags_a_release_with_every_listed_language() -> None:
|
||||
rules = [
|
||||
{"audio_contain_all": ["fr-FR", "fr-CA"], "tag": "VF2"},
|
||||
{"audio": "fr-CA", "tag": "VFQ"},
|
||||
{"audio": "fr-FR", "tag": "VFF"},
|
||||
]
|
||||
fr_fr, fr_ca, en = Language.get("fr-FR"), Language.get("fr-CA"), Language.get("en-US")
|
||||
assert evaluate_language_tag(rules, [en, fr_fr, fr_ca], []) == "VF2"
|
||||
assert evaluate_language_tag(rules, [en, fr_ca], []) == "VFQ"
|
||||
assert evaluate_language_tag(rules, [en, fr_fr], []) == "VFF"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("condition", ["audio_contain_all", "subs_contain_all"])
|
||||
def test_an_empty_contain_all_list_matches_nothing(condition) -> None:
|
||||
assert evaluate_language_tag([{condition: [], "tag": "ALL"}], JA, EN_ES) == ""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("bad", ["japanese", 1, [["ja"]], {"ja": 1}])
|
||||
def test_an_invalid_rule_value_is_no_match_not_a_crash(bad, caplog) -> None:
|
||||
rules = [{"audio": bad, "tag": "BAD"}, {"audio": "ja", "tag": "OK"}]
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
"""Parse every public test manifest in tests/fixtures/manifests (refresh: scripts/fetch_manifest_corpus.py)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
from typing import Any, Union
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.core.manifests import DASH, HLS, ISM
|
||||
from unshackle.core.tracks import Audio, Tracks, Video
|
||||
from unshackle.core.utils.xml import load_xml
|
||||
|
||||
CORPUS = Path(__file__).resolve().parent.parent / "fixtures" / "manifests"
|
||||
INDEX: list[dict[str, Any]] = json.loads((CORPUS / "index.json").read_text(encoding="utf-8"))
|
||||
|
||||
# file -> reason; strict, so a fix that makes one parse fails here until its entry is removed
|
||||
KNOWN_FAILURES: dict[str, str] = {}
|
||||
|
||||
|
||||
def cases(entries: list[dict[str, Any]]) -> list[Any]:
|
||||
return [
|
||||
pytest.param(e, id=e["file"], marks=pytest.mark.xfail(reason=KNOWN_FAILURES[e["file"]], strict=True))
|
||||
if e["file"] in KNOWN_FAILURES
|
||||
else pytest.param(e, id=e["file"])
|
||||
for e in entries
|
||||
]
|
||||
|
||||
|
||||
def parse(entry: dict[str, Any]) -> Tracks:
|
||||
"""Parse a fixture the way from_url does: XML from bytes, M3U8 decoded as UTF-8."""
|
||||
data = (CORPUS / entry["file"]).read_bytes()
|
||||
parser: Union[DASH, HLS, ISM]
|
||||
if entry["kind"] == "hls":
|
||||
parser = HLS.from_text(data.decode("utf-8"), entry["url"])
|
||||
else:
|
||||
parser = (DASH if entry["kind"] == "dash" else ISM)(load_xml(data), entry["url"])
|
||||
return parser.to_tracks("en")
|
||||
|
||||
|
||||
def most_per_set(tracks: list[Any]) -> int:
|
||||
return max(Counter(id(t.data["dash"]["adaptation_set"]) for t in tracks).values(), default=0)
|
||||
|
||||
|
||||
class NeedsNetwork(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def test_index_lists_every_known_failure() -> None:
|
||||
assert INDEX
|
||||
assert set(KNOWN_FAILURES) <= {e["file"] for e in INDEX}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("entry", cases(INDEX))
|
||||
def test_manifest_parses_to_tracks(entry: dict[str, Any]) -> None:
|
||||
tracks = parse(entry)
|
||||
|
||||
assert tracks.videos or tracks.audio or tracks.subtitles
|
||||
for track in tracks:
|
||||
# HLS CODECS is only a SHOULD (RFC 8216 4.3.4.2), so an HLS track can honestly have none
|
||||
assert track.codec is not None or entry["kind"] == "hls", track
|
||||
assert track.language, track
|
||||
|
||||
expect = entry.get("expect")
|
||||
if expect:
|
||||
assert most_per_set(tracks.videos) == expect["max_num_video"]
|
||||
assert most_per_set(tracks.audio) == expect["max_num_audio"]
|
||||
for codec_type, codecs, found in (
|
||||
(Video.Codec, expect["video_codec"], tracks.videos),
|
||||
(Audio.Codec, expect["audio_codec"], tracks.audio),
|
||||
):
|
||||
if codecs:
|
||||
assert {codec_type.from_codecs(c) for c in codecs.split(",")} <= {t.codec for t in found}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"entry",
|
||||
[
|
||||
e
|
||||
for e in INDEX
|
||||
if e["kind"] == "dash"
|
||||
and e["file"] not in KNOWN_FAILURES
|
||||
and b'type="dynamic"' not in (CORPUS / e["file"]).read_bytes()
|
||||
],
|
||||
ids=lambda e: e["file"],
|
||||
)
|
||||
def test_dash_segments_and_drm_resolve_offline(entry: dict[str, Any]) -> None:
|
||||
"""Build the DRM and the segment list of every track; a track whose segment index must be fetched is skipped."""
|
||||
session = MagicMock()
|
||||
session.get.side_effect = NeedsNetwork
|
||||
for track in parse(entry):
|
||||
dash = track.data["dash"]
|
||||
manifest, adaptation_set, representation = dash["manifest"], dash["adaptation_set"], dash["representation"]
|
||||
DASH.get_drm(representation.findall("ContentProtection") + adaptation_set.findall("ContentProtection"))
|
||||
period = dash["period"] if dash.get("period") is not None else manifest.find("Period")
|
||||
try:
|
||||
_, segments, _, _, _ = DASH.get_period_segments(
|
||||
period, adaptation_set, representation, manifest, track, track.url, session, probe_kid=False
|
||||
)
|
||||
except NeedsNetwork:
|
||||
continue
|
||||
assert segments, track
|
||||
assert all(url.startswith(("http://", "https://")) for url, _ in segments), track
|
||||
@@ -19,7 +19,7 @@ import pytest
|
||||
from unshackle.core import binaries
|
||||
from unshackle.core.tracks import Audio, Subtitle, Tracks, Video
|
||||
from unshackle.core.tracks.track import (
|
||||
has_mp4_only_audio_entry,
|
||||
has_dts_uhd_sample_entry,
|
||||
iter_top_level_boxes,
|
||||
strip_duplicate_init_boxes,
|
||||
)
|
||||
@@ -36,9 +36,9 @@ def write_mp4(path: Path, sample_entry: bytes) -> Path:
|
||||
return path
|
||||
|
||||
|
||||
@pytest.mark.parametrize("fourcc", [b"dtsx", b"dtsy", b"mha1", b"mha2", b"mhm1", b"mhm2"])
|
||||
def test_dts_uhd_and_mpeg_h_sample_entries_are_detected(tmp_path: Path, fourcc: bytes) -> None:
|
||||
assert has_mp4_only_audio_entry(write_mp4(tmp_path / "a.mp4", fourcc)) is True
|
||||
@pytest.mark.parametrize("fourcc", [b"dtsx", b"dtsy"])
|
||||
def test_dts_uhd_sample_entries_are_detected(tmp_path: Path, fourcc: bytes) -> None:
|
||||
assert has_dts_uhd_sample_entry(write_mp4(tmp_path / "a.mp4", fourcc)) is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize("fourcc", [b"dtsc", b"dtse", b"dtsh", b"dtsl", b"ec-3", b"mp4a"])
|
||||
@@ -47,13 +47,13 @@ def test_other_dts_profiles_stay_in_matroska(tmp_path: Path, fourcc: bytes) -> N
|
||||
DTS:X Profile 1 is DTS-HD Master Audio underneath and Matroska stores it as
|
||||
A_DTS, so it must not be pulled out of Matroska by the DTS:X container rule.
|
||||
"""
|
||||
assert has_mp4_only_audio_entry(write_mp4(tmp_path / "a.mp4", fourcc)) is False
|
||||
assert has_dts_uhd_sample_entry(write_mp4(tmp_path / "a.mp4", fourcc)) is False
|
||||
|
||||
|
||||
def test_a_file_with_no_moov_is_not_detected(tmp_path: Path) -> None:
|
||||
path = tmp_path / "a.mp4"
|
||||
path.write_bytes(box(b"ftyp", b"isom") + box(b"mdat", b"dtsx" * 8))
|
||||
assert has_mp4_only_audio_entry(path) is False, "a 4CC in mdat is not a sample entry"
|
||||
assert has_dts_uhd_sample_entry(path) is False, "a 4CC in mdat is not a sample entry"
|
||||
|
||||
|
||||
def build_tracks(tmp_path: Path, audio_entry: bytes) -> Tracks:
|
||||
@@ -115,10 +115,10 @@ def test_other_audio_still_muxes_with_mkvmerge(tmp_path: Path, monkeypatch: pyte
|
||||
tracks.mux("Title", delete=False, output_path=tmp_path / "out.muxed.mkv")
|
||||
|
||||
|
||||
def test_a_missing_mp4box_names_the_binary(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
def test_a_missing_mp4box_names_the_install(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(binaries, "MP4Box", None, raising=False)
|
||||
tracks = build_tracks(tmp_path, b"dtsx")
|
||||
with pytest.raises(RuntimeError, match="MP4Box"):
|
||||
with pytest.raises(RuntimeError, match="gpac"):
|
||||
tracks.mux("Title", delete=False, output_path=tmp_path / "out.muxed.mkv")
|
||||
|
||||
|
||||
@@ -150,30 +150,6 @@ def test_substation_alpha_subtitles_are_left_out(tmp_path: Path, monkeypatch: py
|
||||
assert "s.vtt:lang=es" in command
|
||||
|
||||
|
||||
def test_mp4_subtitles_get_the_script_their_region_implies(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
captured: list[FakePopen] = []
|
||||
|
||||
def fake_popen(args: list[str], **kwargs: object) -> FakePopen:
|
||||
p = FakePopen(args, **kwargs)
|
||||
captured.append(p)
|
||||
Path(args[-1]).write_bytes(b"muxed")
|
||||
return p
|
||||
|
||||
monkeypatch.setattr(binaries, "MP4Box", Path("MP4Box"), raising=False)
|
||||
monkeypatch.setattr(subprocess, "Popen", fake_popen)
|
||||
|
||||
tracks = build_tracks(tmp_path, b"dtsx")
|
||||
vtt = Subtitle(id_="s1", url="https://x/s", codec=Subtitle.Codec.WebVTT, language="zh-TW")
|
||||
vtt.path = tmp_path / "s.vtt"
|
||||
vtt.path.write_text("WEBVTT\n")
|
||||
tracks.add(vtt)
|
||||
|
||||
tracks.mux("Title", delete=False, output_path=tmp_path / "out.muxed.mkv")
|
||||
command = captured[0].args
|
||||
assert f"{tmp_path / 's.vtt'}:lang=zh-Hant-TW" in command
|
||||
assert any(arg.endswith("=Chinese (Traditional)") for arg in command)
|
||||
|
||||
|
||||
def test_mp4box_errors_come_back_to_the_caller(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""A failed mux does not raise; the caller inspects the return code and lines."""
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ def header_length(path: Path) -> float:
|
||||
(Audio.Codec.ALAC, "alac", ".m4a"),
|
||||
(Audio.Codec.FLAC, "flac", ".flac"),
|
||||
(Audio.Codec.OPUS, "libopus", ".opus"),
|
||||
(Audio.Codec.MP3, "libmp3lame", ".mp3"),
|
||||
],
|
||||
)
|
||||
def test_remux_states_the_full_length_in_the_codec_container(
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
"""A bare UTF-16LE WRMHEADER in place of a PSSH box or PlayReady Object loads as PlayReady DRM."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import logging
|
||||
from uuid import UUID
|
||||
|
||||
import m3u8
|
||||
import pytest
|
||||
from lxml import etree
|
||||
from pyplayready.misc.exceptions import InvalidPssh
|
||||
from pyplayready.system.pssh import PSSH
|
||||
from pywidevine.pssh import PSSH as WV_PSSH
|
||||
|
||||
from unshackle.core.drm import PlayReady, Widevine, drm_from_dict
|
||||
from unshackle.core.manifests.dash import DASH
|
||||
from unshackle.core.manifests.hls import HLS
|
||||
from unshackle.core.manifests.ism import ISM
|
||||
|
||||
KID = UUID("00112233-4455-6677-8899-aabbccddeeff")
|
||||
KID_B64 = base64.b64encode(KID.bytes_le).decode()
|
||||
PR_URN = "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95"
|
||||
WV_URN = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"
|
||||
|
||||
|
||||
def bare_header(version: str) -> str:
|
||||
"""Base64 of a bare WRMHEADER, with the KID where the given header version puts it."""
|
||||
if version == "4.0.0.0":
|
||||
data = f"<PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>{KID_B64}</KID>"
|
||||
else:
|
||||
data = f'<PROTECTINFO><KIDS><KID ALGID="AESCTR" VALUE="{KID_B64}"></KID></KIDS></PROTECTINFO>'
|
||||
xml = (
|
||||
f'<WRMHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="{version}">'
|
||||
f"<DATA>{data}<LA_URL>https://example.invalid/pr</LA_URL></DATA></WRMHEADER>"
|
||||
)
|
||||
return base64.b64encode(xml.encode("utf-16-le")).decode()
|
||||
|
||||
|
||||
def pr_protection(child: str, value: str) -> etree._Element:
|
||||
return etree.fromstring(
|
||||
f'<ContentProtection xmlns:cenc="urn:mpeg:cenc:2013" xmlns:mspr="urn:microsoft:playready" '
|
||||
f'schemeIdUri="{PR_URN}"><{child}>{value}</{child}></ContentProtection>'
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("version", ["4.0.0.0", "4.1.0.0", "4.2.0.0", "4.3.0.0"])
|
||||
@pytest.mark.parametrize("child", ["mspr:pro", "cenc:pssh"])
|
||||
def test_dash_loads_a_bare_header(child: str, version: str) -> None:
|
||||
drm = DASH.get_drm([pr_protection(child, bare_header(version))])
|
||||
|
||||
assert len(drm) == 1
|
||||
assert isinstance(drm[0], PlayReady)
|
||||
assert KID in drm[0].kids
|
||||
assert drm[0].pssh_b64
|
||||
PSSH(drm[0].pssh_b64)
|
||||
assert KID in drm_from_dict(drm[0].to_dict()).kids
|
||||
|
||||
|
||||
def test_wrapped_header_bytes_are_unchanged() -> None:
|
||||
header = bare_header("4.0.0.0")
|
||||
drm = PlayReady.from_pssh_b64(header)
|
||||
|
||||
assert drm.pssh.wrm_headers[0].dumps().encode("utf-16-le") == base64.b64decode(header)
|
||||
|
||||
|
||||
def test_dash_skips_an_unparseable_playready_entry_and_keeps_widevine(caplog: pytest.LogCaptureFixture) -> None:
|
||||
widevine = etree.fromstring(
|
||||
f'<ContentProtection xmlns:cenc="urn:mpeg:cenc:2013" schemeIdUri="{WV_URN}">'
|
||||
f"<cenc:pssh>{WV_PSSH.new(system_id=WV_PSSH.SystemId.Widevine, key_ids=[KID]).dumps()}</cenc:pssh>"
|
||||
"</ContentProtection>"
|
||||
)
|
||||
garbage = pr_protection("mspr:pro", base64.b64encode(b"\x00\x00not a header").decode())
|
||||
|
||||
with caplog.at_level(logging.WARNING, logger="DASH"):
|
||||
drm = DASH.get_drm([widevine, garbage])
|
||||
|
||||
assert [type(d) for d in drm] == [Widevine]
|
||||
assert "Skipping unparseable PlayReady ContentProtection" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"data",
|
||||
[b"\x00\x00not a header", "<WRMHEADER/>".encode("utf-8")],
|
||||
ids=["garbage", "utf-8-header"],
|
||||
)
|
||||
def test_other_bad_data_keeps_the_original_error(data: bytes) -> None:
|
||||
with pytest.raises(InvalidPssh):
|
||||
PlayReady.from_pssh_b64(base64.b64encode(data).decode())
|
||||
|
||||
|
||||
def test_hls_loads_a_bare_header() -> None:
|
||||
key = m3u8.loads(
|
||||
"#EXTM3U\n"
|
||||
f'#EXT-X-KEY:METHOD=SAMPLE-AES-CTR,URI="data:text/plain;charset=UTF-16;base64,{bare_header("4.0.0.0")}",'
|
||||
'KEYFORMAT="com.microsoft.playready",KEYFORMATVERSIONS="1"\n'
|
||||
"#EXTINF:4.0,\nseg0.mp4\n"
|
||||
).keys[0]
|
||||
|
||||
drm = HLS.get_drm(key)
|
||||
|
||||
assert isinstance(drm, PlayReady)
|
||||
assert KID in drm.kids
|
||||
|
||||
|
||||
def test_ism_loads_a_bare_header() -> None:
|
||||
header = etree.fromstring(f'<ProtectionHeader SystemID="{PR_URN[9:]}">{bare_header("4.0.0.0")}</ProtectionHeader>')
|
||||
|
||||
drm = ISM.get_drm([header])
|
||||
|
||||
assert len(drm) == 1
|
||||
assert KID in drm[0].kids
|
||||
@@ -63,17 +63,6 @@ def test_raise_errors_raises_the_load_failure() -> None:
|
||||
load_proxy_providers(OTHERS, raise_errors=True)
|
||||
|
||||
|
||||
def test_bare_query_order_follows_config_key_order_with_controld_last(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
from unshackle.core.proxies import ControlD
|
||||
|
||||
order = {"controld": {"token": "t"}, "surfsharkvpn": CREDENTIALS, "nordvpn": CREDENTIALS, "basic": {"us": "x"}}
|
||||
monkeypatch.setattr(config, "proxy_providers", order)
|
||||
monkeypatch.setattr(ControlD, "get_locations", lambda self: [])
|
||||
loaded = load_proxy_providers(("expressvpn", "protonvpn", "hola"), quiet=True)
|
||||
names = [getattr(p, "name", p.__class__.__name__) for p in loaded]
|
||||
assert names == ["Basic", "SurfsharkVPN", "NordVPN", "ControlD"]
|
||||
|
||||
|
||||
def test_rest_path_loads_windscribe_but_not_gluetun(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
from unshackle.core.proxies import Gluetun, WindscribeVPN
|
||||
from unshackle.core.proxies.resolve import initialize_proxy_providers
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import weakref
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
@@ -27,31 +26,12 @@ class Svc:
|
||||
def fallback(self) -> requests.Session:
|
||||
return run_proxy.fallback_session()
|
||||
|
||||
def helper_lookup(self, host: str) -> None:
|
||||
Helper().lookup(host)
|
||||
|
||||
def helper_fallback(self) -> requests.Session:
|
||||
return Helper().fallback()
|
||||
|
||||
|
||||
class Helper:
|
||||
"""A helper class of the service with its own HTTP session, which has no proxy."""
|
||||
|
||||
def __init__(self):
|
||||
self.session = requests.Session()
|
||||
|
||||
def lookup(self, host: str) -> None:
|
||||
lookup(host)
|
||||
|
||||
def fallback(self) -> requests.Session:
|
||||
return run_proxy.fallback_session()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def watching(monkeypatch):
|
||||
monkeypatch.setattr(run_proxy, "watched", {})
|
||||
monkeypatch.setattr(run_proxy, "proxy_hosts", set())
|
||||
monkeypatch.setattr(run_proxy, "warned", weakref.WeakKeyDictionary())
|
||||
monkeypatch.setattr(run_proxy, "warned", set())
|
||||
run_proxy.watch(Svc, PROXY)
|
||||
|
||||
|
||||
@@ -129,9 +109,7 @@ def test_raw_socket_connect_to_a_host_name_warns(caplog, address, warns):
|
||||
assert bool(leaks(caplog)) is warns
|
||||
|
||||
|
||||
def test_core_frame_ends_the_walk(caplog, monkeypatch):
|
||||
"""A core lookup returns before the CDM host set is built, which a server does for every request it sends."""
|
||||
monkeypatch.setattr(run_proxy, "cdm_hosts", lambda: pytest.fail("cdm_hosts() ran for a core lookup"))
|
||||
def test_core_frame_ends_the_walk(caplog):
|
||||
with caplog.at_level(logging.WARNING):
|
||||
source = "sys.audit('socket.getaddrinfo', 'vault.example', 443, 0, 0, 0)"
|
||||
run_as(os.path.join(run_proxy.CORE_DIR, "core", "vaults.py"), source)
|
||||
@@ -171,39 +149,6 @@ def test_service_instance_uses_the_proxy_of_its_own_run(caplog):
|
||||
assert {r.name for r in caplog.records if r.getMessage() in leaks(caplog)} == {"Svc"}
|
||||
|
||||
|
||||
def test_a_reloaded_service_class_uses_the_proxy_of_its_own_run(caplog):
|
||||
"""A service reload makes a new class from the same directory; the watch still holds the old one."""
|
||||
reloaded = type("Svc", (), {"__init__": Svc.__init__, "lookup": Svc.lookup})
|
||||
with caplog.at_level(logging.WARNING):
|
||||
reloaded().lookup("direct.example") # a run with no proxy
|
||||
reloaded(PROXY).lookup("leak.example")
|
||||
assert len(leaks(caplog)) == 1
|
||||
assert "leak.example" in leaks(caplog)[0]
|
||||
|
||||
|
||||
def test_a_subclass_of_the_service_uses_the_proxy_of_its_own_run(caplog):
|
||||
sub = type("Sub", (Svc,), {})
|
||||
with caplog.at_level(logging.WARNING):
|
||||
sub().lookup("direct.example")
|
||||
assert leaks(caplog) == []
|
||||
|
||||
|
||||
def test_a_helper_session_without_proxy_does_not_hide_a_leak(caplog):
|
||||
"""A helper class of the service is not the service instance, so the proxy of the run still decides."""
|
||||
with caplog.at_level(logging.WARNING):
|
||||
Svc(PROXY).helper_lookup("leak.example")
|
||||
assert len(leaks(caplog)) == 1
|
||||
assert Svc(PROXY).helper_fallback().proxies == {"all": PROXY}
|
||||
|
||||
|
||||
def test_each_run_warns_even_when_a_finished_run_had_the_same_id(caplog):
|
||||
"""CPython reuses the id of a freed instance, so the warned hosts belong to the instance itself."""
|
||||
with caplog.at_level(logging.WARNING):
|
||||
for _ in range(2):
|
||||
Svc(PROXY).lookup("leak.example")
|
||||
assert len(leaks(caplog)) == 2
|
||||
|
||||
|
||||
def test_fallback_session_takes_the_proxy_of_the_calling_run():
|
||||
session = Svc("http://own.example:1").fallback()
|
||||
assert session.proxies == {"all": "http://own.example:1"}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Unit tests for remote git service-repo resolution. No network; only the bytecode tests run a real git."""
|
||||
"""Unit tests for remote git service-repo resolution. No network, no real git."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -245,66 +245,6 @@ def test_changed_services_up_to_date(monkeypatch):
|
||||
assert service_repo.changed_services(Path("/x"), "same", "same") == []
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bytecode_clone(tmp_path):
|
||||
"""A clone of a repo that commits a ``.pyc``, with that ``.pyc`` rewritten as an import does."""
|
||||
git = service_repo.binaries.Git
|
||||
if not git:
|
||||
pytest.skip("git not found")
|
||||
upstream, dest = tmp_path / "upstream", tmp_path / "clone"
|
||||
(upstream / "EXAMPLE" / "__pycache__").mkdir(parents=True)
|
||||
(upstream / "EXAMPLE" / "__init__.py").write_text("X = 1\n")
|
||||
(upstream / "EXAMPLE" / "__pycache__" / "__init__.cpython-312.pyc").write_bytes(b"old")
|
||||
|
||||
def run(*args: str, cwd: Path = upstream) -> None:
|
||||
subprocess.run(
|
||||
[git, "-c", "user.name=t", "-c", "user.email=t@t", "-c", "commit.gpgsign=false", *args],
|
||||
cwd=cwd,
|
||||
check=True,
|
||||
capture_output=True,
|
||||
)
|
||||
|
||||
run("init", "-q", "-b", "main")
|
||||
run("add", "-A")
|
||||
run("commit", "-qm", "init")
|
||||
run("clone", "-q", str(upstream), str(dest), cwd=tmp_path)
|
||||
(dest / "EXAMPLE" / "__pycache__" / "__init__.cpython-312.pyc").write_bytes(b"rewritten")
|
||||
return upstream, dest, run
|
||||
|
||||
|
||||
def test_rewritten_bytecode_does_not_block_pull(bytecode_clone, tmp_path):
|
||||
upstream, dest, run = bytecode_clone
|
||||
assert service_repo.is_dirty(dest) is False
|
||||
assert service_repo.local_dirty_services(dest) == []
|
||||
(upstream / "EXAMPLE" / "__init__.py").write_text("X = 2\n")
|
||||
(upstream / "EXAMPLE" / "__pycache__" / "__init__.cpython-312.pyc").write_bytes(b"new")
|
||||
run("commit", "-qam", "update")
|
||||
service_repo.pull(dest, tmp_path / "stamp")
|
||||
assert (dest / "EXAMPLE" / "__init__.py").read_text() == "X = 2\n"
|
||||
|
||||
|
||||
def test_source_edit_still_dirty_beside_bytecode(bytecode_clone):
|
||||
_, dest, _ = bytecode_clone
|
||||
(dest / "EXAMPLE" / "__init__.py").write_text("X = 3\n")
|
||||
assert service_repo.is_dirty(dest) is True
|
||||
assert service_repo.local_dirty_services(dest) == ["EXAMPLE"]
|
||||
|
||||
|
||||
def test_untracked_bytecode_does_not_block_pull(bytecode_clone, tmp_path):
|
||||
upstream, dest, run = bytecode_clone
|
||||
(dest / "EXAMPLE" / "__pycache__" / "__init__.cpython-314.pyc").write_bytes(b"local")
|
||||
(dest / "OTHER").mkdir()
|
||||
(dest / "OTHER" / "__init__.py").write_text("")
|
||||
(dest / "OTHER" / "__init__.cpython-314-x86_64-linux-gnu.so").write_bytes(b"compiled")
|
||||
(upstream / "EXAMPLE" / "__init__.py").write_text("X = 2\n")
|
||||
(upstream / "EXAMPLE" / "__pycache__" / "__init__.cpython-314.pyc").write_bytes(b"upstream")
|
||||
run("add", "-A")
|
||||
run("commit", "-qm", "update")
|
||||
service_repo.pull(dest, tmp_path / "stamp")
|
||||
assert (dest / "EXAMPLE" / "__init__.py").read_text() == "X = 2\n"
|
||||
assert (dest / "OTHER" / "__init__.cpython-314-x86_64-linux-gnu.so").read_bytes() == b"compiled"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("order", [["a", "b"], ["b", "a"]])
|
||||
def test_collision_first_source_wins(tmp_path, order):
|
||||
"""Discovery dedupes by tag honoring list order: the FIRST source to define a tag wins,
|
||||
|
||||
@@ -121,11 +121,3 @@ def test_overdue_staged_service_applies_while_busy(service_dir: Path, monkeypatc
|
||||
assert services.apply_pending(busy={"FOO"}) == ["FOO"]
|
||||
assert services.MODULES["FOO"].VERSION == 2
|
||||
assert services.PENDING == set() and "FOO" not in services.PENDING_SINCE
|
||||
|
||||
|
||||
def test_service_that_exits_on_import_fails_its_reload_only(service_dir: Path):
|
||||
"""A service calling sys.exit at import time is a load error, not a stop of the process."""
|
||||
(service_dir / "FOO" / "__init__.py").write_text("import sys\nsys.exit(1)\n")
|
||||
os.utime(service_dir / "FOO" / "__init__.py", (time.time() + 9, time.time() + 9))
|
||||
services.reload_services(["FOO"])
|
||||
assert services.LOAD_ERRORS and services.LOAD_ERRORS[-1].startswith("FOO: failed to import - SystemExit")
|
||||
|
||||
@@ -27,11 +27,3 @@ def test_retry_log_counts_only_real_retries(rate_limited, caplog, max_retries):
|
||||
|
||||
retries = [r.getMessage() for r in caplog.records if "Retrying" in r.getMessage()]
|
||||
assert retries == [f"429 Too Many Requests(/x). Retrying... ({n}/{max_retries})" for n in range(1, max_retries + 1)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("max_retries", "attempts"), [(0, ""), (2, " after 3 attempts")])
|
||||
def test_spent_budget_names_the_attempts_and_host_not_the_url(rate_limited, max_retries, attempts):
|
||||
with pytest.raises(MaxRetriesError) as raised:
|
||||
rate_limited.get("https://example.invalid/x?hmac=secret", max_retries=max_retries)
|
||||
|
||||
assert str(raised.value) == f"GET example.invalid failed{attempts}: 429 Too Many Requests"
|
||||
|
||||
@@ -0,0 +1,552 @@
|
||||
"""Theme files: shipped themes, user files on top of them, and the errors that reject a file."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
import logging
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
from rich import box
|
||||
from rich.console import Console, RenderableType
|
||||
from rich.panel import Panel
|
||||
from rich.progress import Progress
|
||||
from rich.rule import Rule
|
||||
from rich.segment import Segment
|
||||
from rich.style import Style
|
||||
from rich.text import Text
|
||||
from rich.tree import Tree
|
||||
|
||||
from unshackle.commands.env import env
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.console import (
|
||||
ComfyConsole,
|
||||
Gradient,
|
||||
GradientPulseBarColumn,
|
||||
PinnedLive,
|
||||
SyncLive,
|
||||
gradient_fill,
|
||||
gradient_lut,
|
||||
slide_gradients,
|
||||
use_gradients,
|
||||
)
|
||||
from unshackle.core.themes import (
|
||||
ALIASES,
|
||||
DEFAULT_THEME,
|
||||
ROLES,
|
||||
apply_theme,
|
||||
build_console_theme,
|
||||
build_help_config,
|
||||
load_theme,
|
||||
read_theme_file,
|
||||
shipped_themes,
|
||||
user_themes,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def themes_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
|
||||
monkeypatch.setattr(config.directories, "themes", tmp_path)
|
||||
return tmp_path
|
||||
|
||||
|
||||
def write(folder: Path, name: str, text: str) -> None:
|
||||
(folder / f"{name}.yaml").write_text(text, encoding="utf-8")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", sorted(shipped_themes()))
|
||||
def test_shipped_theme_sets_every_role(name: str) -> None:
|
||||
assert set(read_theme_file(shipped_themes()[name])) >= set(ROLES)
|
||||
palette, styles, _ = load_theme(name, user_files=False)
|
||||
for set_terminal_bg in (False, True):
|
||||
build_console_theme(palette, styles, set_terminal_bg)
|
||||
build_help_config(palette)
|
||||
|
||||
|
||||
def test_the_shipped_themes_ship() -> None:
|
||||
# the root .gitignore hides unshackle.yaml; the default theme needs its exception
|
||||
assert {DEFAULT_THEME, "nord", "rainbow", "dracula", "tokyo-night"} <= set(shipped_themes())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("alias", sorted(ALIASES))
|
||||
def test_every_alias_names_a_shipped_theme(alias: str) -> None:
|
||||
assert load_theme(alias) == load_theme(ALIASES[alias], user_files=False)
|
||||
|
||||
|
||||
def test_user_theme_extends_a_shipped_theme(themes_dir: Path) -> None:
|
||||
write(themes_dir, "My_Nord", 'extends: nord\naccent: "#88c0d0"\n')
|
||||
nord, nord_styles, _ = load_theme("nord")
|
||||
|
||||
palette, styles, _ = load_theme("my-nord")
|
||||
|
||||
assert palette == {**nord, "pink": "#88c0d0"}
|
||||
assert styles == nord_styles
|
||||
|
||||
|
||||
def test_without_extends_a_new_theme_starts_from_the_default(themes_dir: Path) -> None:
|
||||
write(themes_dir, "mine", 'text: "#ffffff"\n')
|
||||
assert load_theme("mine")[0] == {**load_theme(DEFAULT_THEME)[0], "text": "#ffffff"}
|
||||
|
||||
|
||||
def test_a_user_file_replaces_a_shipped_theme_that_it_extends(themes_dir: Path) -> None:
|
||||
write(themes_dir, "nord", 'extends: nord\ntext: "#ffffff"\n')
|
||||
assert load_theme("nord")[0]["text"] == "#ffffff"
|
||||
assert load_theme("nord", user_files=False)[0]["text"] != "#ffffff"
|
||||
|
||||
|
||||
def test_alias_names_are_reserved(themes_dir: Path) -> None:
|
||||
write(themes_dir, "default", 'text: "#000000"\n')
|
||||
assert "default" not in user_themes()
|
||||
assert load_theme("default") == load_theme(DEFAULT_THEME, user_files=False)
|
||||
|
||||
|
||||
def test_styles_resolve_role_names_to_the_theme_colours(themes_dir: Path) -> None:
|
||||
write(themes_dir, "mine", 'extends: nord\ncyan: "#00ffff"\nstyles:\n bar.complete: bold accent on cyan\n')
|
||||
palette, styles, _ = load_theme("mine")
|
||||
assert styles["bar.complete"] == f"bold {palette['pink']} on #00ffff"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"text, reason",
|
||||
[
|
||||
("pink: #b48ead\n", "put hex values in quotes"),
|
||||
('pink: "#fff"\n', "pink:"),
|
||||
('pink: "#ff79c6"\naccent: "#ff79c6"\n', "pink or accent, not both"),
|
||||
('pnik: "#ff79c6"\n', "unknown key pnik"),
|
||||
('styles:\n pink: "#ff79c6"\n', "set pink at the top level"),
|
||||
("styles:\n rule.line: shiny\n", "styles: rule.line"),
|
||||
("extends: no-such-theme\n", "not a shipped theme"),
|
||||
("extends: [nord]\n", "extends must be a quoted theme name"),
|
||||
("- pink\n", "not a mapping"),
|
||||
('red: "rgb(1,,2)"\n', "is not a colour"),
|
||||
("red: off\n", "red must be a quoted colour"), # YAML reads an unquoted off as False
|
||||
("styles:\n on: bold\n", "quote .* and its value"),
|
||||
("red: " + "[" * 600 + "]" * 600 + "\n", "cannot read"),
|
||||
("styles:\n none: link https://example.com\n", "link and conceal not allowed"),
|
||||
("styles:\n logging.level.error: conceal\n", "link and conceal not allowed"),
|
||||
("gradients: [red, blue]\n", "gradients must be a mapping"),
|
||||
("gradients:\n logo: [red]\n", "gradients: unknown key 'logo'"),
|
||||
("gradients:\n direction: sideways\n", "direction must be horizontal or vertical or diagonal"),
|
||||
("gradients:\n motion: true\n", "motion must be static or scroll"),
|
||||
("gradients:\n bar: []\n", "bar must be a list of quoted colours"),
|
||||
("gradients:\n bar: [[red]]\n", "bar must be a list of quoted colours"),
|
||||
('gradients:\n bar: [red, "#12"]\n', "gradients: bar: '#12' is not a colour"),
|
||||
],
|
||||
)
|
||||
def test_a_bad_file_is_rejected_with_its_reason(themes_dir: Path, text: str, reason: str) -> None:
|
||||
write(themes_dir, "bad", text)
|
||||
with pytest.raises(ValueError, match=f"(?i)bad.yaml: .*{reason}"):
|
||||
load_theme("bad")
|
||||
|
||||
|
||||
def test_a_yml_file_is_a_theme_too(themes_dir: Path) -> None:
|
||||
(themes_dir / "mine.yml").write_text('text: "#ffffff"\n', encoding="utf-8")
|
||||
assert load_theme("mine")[0]["text"] == "#ffffff"
|
||||
|
||||
|
||||
def test_role_names_in_styles_ignore_case(themes_dir: Path) -> None:
|
||||
write(themes_dir, "mine", "extends: nord\nstyles:\n bar.complete: Bold RED on Accent\n")
|
||||
palette, styles, _ = load_theme("mine")
|
||||
assert styles["bar.complete"] == f"Bold {palette['red']} on {palette['pink']}"
|
||||
|
||||
|
||||
def test_rgb_with_spaces_is_stored_without_them(themes_dir: Path) -> None:
|
||||
write(themes_dir, "mine", 'cyan: "rgb(1, 2, 3)"\n')
|
||||
palette, styles, _ = load_theme("mine")
|
||||
assert palette["cyan"] == "rgb(1,2,3)"
|
||||
build_console_theme(palette, styles, set_terminal_bg=True)
|
||||
|
||||
|
||||
def test_a_file_that_is_not_utf8_is_rejected(themes_dir: Path) -> None:
|
||||
(themes_dir / "bad.yaml").write_bytes(b"red: \xff\n")
|
||||
with pytest.raises(ValueError, match="bad.yaml: cannot read"):
|
||||
load_theme("bad")
|
||||
|
||||
|
||||
def test_yaml_anchors_cannot_expand_a_role_value(themes_dir: Path) -> None:
|
||||
# an alias bomb: a thousand strings from a few hundred bytes
|
||||
write(
|
||||
themes_dir,
|
||||
"bad",
|
||||
"description: &a [" + ", ".join(['"lol"'] * 10) + "]\n"
|
||||
"author: &b [" + ", ".join(["*a"] * 10) + "]\n"
|
||||
"red: [" + ", ".join(["*b"] * 10) + "]\n",
|
||||
)
|
||||
|
||||
start = time.monotonic()
|
||||
with pytest.raises(ValueError) as error:
|
||||
load_theme("bad")
|
||||
assert time.monotonic() - start < 1
|
||||
assert len(str(error.value)) < 200
|
||||
|
||||
|
||||
def test_an_unknown_name_is_rejected(themes_dir: Path) -> None:
|
||||
with pytest.raises(ValueError, match="^unknown theme 'no-such-theme'$"):
|
||||
load_theme("no-such-theme")
|
||||
|
||||
|
||||
def test_console_falls_back_to_the_shipped_default(themes_dir: Path) -> None:
|
||||
# console builds its theme at import, so this needs a fresh interpreter
|
||||
write(themes_dir, DEFAULT_THEME, "pink: #b48ead\n")
|
||||
script = (
|
||||
"import sys\n"
|
||||
"from unshackle.core.config import config\n"
|
||||
"config.theme = 'default'\n"
|
||||
"config.directories.themes = sys.argv[1]\n"
|
||||
"import unshackle.core.console as c\n"
|
||||
"print(c.primary_scheme['pink'])\n"
|
||||
)
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-c", script, str(themes_dir)],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
errors="replace",
|
||||
timeout=60,
|
||||
)
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert result.stdout.strip() == load_theme(DEFAULT_THEME, user_files=False)[0]["pink"]
|
||||
assert "unshackle.yaml: pink is empty" in result.stderr
|
||||
|
||||
|
||||
def test_env_theme_lists_themes_and_flags_a_broken_file(themes_dir: Path) -> None:
|
||||
write(themes_dir, "mine", "extends: nord\n")
|
||||
write(themes_dir, "bad", "pink: #b48ead\n")
|
||||
result = CliRunner().invoke(env, ["theme"])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert "mine" in result.output and "nord" in result.output
|
||||
assert "not valid" in result.output
|
||||
|
||||
|
||||
def test_env_theme_marks_the_fallback_as_active(themes_dir: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
import unshackle.core.console as console_module
|
||||
|
||||
monkeypatch.setattr(config, "theme", "no-such-theme")
|
||||
monkeypatch.setattr(console_module, "active_theme", DEFAULT_THEME)
|
||||
result = CliRunner().invoke(env, ["theme"])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert "(active, fallback)" in result.output
|
||||
|
||||
|
||||
def test_env_theme_previews_one_theme(themes_dir: Path) -> None:
|
||||
result = CliRunner().invoke(env, ["theme", "nord"])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert "Available Tracks" in result.output
|
||||
|
||||
|
||||
def test_env_theme_names_the_error_for_a_bad_theme(themes_dir: Path) -> None:
|
||||
result = CliRunner().invoke(env, ["theme", "no-such-theme"])
|
||||
assert result.exit_code == 1
|
||||
assert "unknown theme 'no-such-theme'" in result.output
|
||||
|
||||
|
||||
def test_progress_bar_accepts_a_named_colour(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
import unshackle.core.console as console_module
|
||||
|
||||
palette = {**console_module.primary_scheme, "pink": "magenta", "dark_gray": "default"}
|
||||
monkeypatch.setattr(console_module, "primary_scheme", palette)
|
||||
GradientPulseBarColumn()
|
||||
|
||||
|
||||
def test_help_ignores_the_rich_click_theme_env_var() -> None:
|
||||
assert build_help_config(load_theme(DEFAULT_THEME, user_files=False)[0]).enable_theme_env_var is False
|
||||
|
||||
|
||||
def test_gradients_resolve_role_names_and_take_one_colour(themes_dir: Path) -> None:
|
||||
write(
|
||||
themes_dir,
|
||||
"mine",
|
||||
'gradients:\n direction: diagonal\n motion: scroll\n bar: [accent, "rgb(1, 2, 3)"]\n rule: Blue\n',
|
||||
)
|
||||
palette, _, gradients = load_theme("mine")
|
||||
assert gradients == {
|
||||
"direction": "diagonal",
|
||||
"motion": "scroll",
|
||||
"bar": (palette["pink"], "rgb(1,2,3)"),
|
||||
"rule": (palette["blue"],),
|
||||
}
|
||||
|
||||
|
||||
def test_gradients_merge_over_the_base_theme() -> None:
|
||||
palette = load_theme(DEFAULT_THEME, user_files=False)[0]
|
||||
_, _, gradients = apply_theme("x.yaml", {"gradients": {"rule": "#123456"}}, palette, {}, {"bar": ("#000000",)})
|
||||
assert gradients == {"bar": ("#000000",), "rule": ("#123456",)}
|
||||
|
||||
|
||||
def test_gradient_lut_runs_from_the_first_stop_to_the_last() -> None:
|
||||
lut = gradient_lut(("#ff0000", "#00ff00", "#0000ff"))
|
||||
assert [hex_of(lut[0]), hex_of(lut[-1])] == ["#ff0000", "#0000ff"]
|
||||
cyclic = gradient_lut(("#ff0000", "#0000ff"), cyclic=True)
|
||||
assert cyclic[0] == cyclic[-1]
|
||||
assert len(gradient_lut(("red",))) == 1
|
||||
|
||||
|
||||
def hex_of(style: Style) -> str:
|
||||
assert style.color is not None
|
||||
return style.color.get_truecolor().hex
|
||||
|
||||
|
||||
def render(renderable: RenderableType) -> list[Segment]:
|
||||
return list(Console(file=io.StringIO(), color_system="truecolor", width=40).render(renderable))
|
||||
|
||||
|
||||
def colours_of(segments: list[Segment], characters: str) -> list[str]:
|
||||
"""The colour of each segment whose text is one of *characters*, or is *characters*."""
|
||||
return [
|
||||
hex_of(s.style)
|
||||
for s in segments
|
||||
if (s.text in characters or s.text == characters) and s.text.strip() and s.style and s.style.color
|
||||
]
|
||||
|
||||
|
||||
def test_panel_gradient_paints_the_frame_and_not_the_content() -> None:
|
||||
tree = Tree("root", guide_style="#888888")
|
||||
tree.add("leaf")
|
||||
panel = Panel(tree, title="Title", border_style="#888888", box=box.SQUARE, expand=False)
|
||||
with use_gradients({"panel": ("#ff0000", "#0000ff")}):
|
||||
segments = render(panel)
|
||||
assert colours_of(segments, "┌") == ["#ff0000"]
|
||||
assert colours_of(segments, "┘") == ["#0000ff"]
|
||||
assert "#888888" in colours_of(segments, "└── ") # the tree guide keeps its colour
|
||||
assert any("Title" in s.text for s in segments)
|
||||
|
||||
|
||||
def test_rule_gradient_paints_the_line_and_not_the_title() -> None:
|
||||
with use_gradients({"rule": ("#ff0000", "#0000ff"), "direction": "vertical"}):
|
||||
segments = render(Rule("[#00ff00]Title", style="#888888"))
|
||||
line = colours_of(segments, "─")
|
||||
assert line[0] == "#ff0000" and line[-1] == "#0000ff" # always left to right, whatever the direction
|
||||
assert colours_of(segments, "Title") == ["#00ff00"]
|
||||
|
||||
|
||||
def test_without_gradients_a_panel_renders_as_rich_draws_it() -> None:
|
||||
with use_gradients({}):
|
||||
assert set(colours_of(render(Panel("x", border_style="#888888")), "─│╭╮╰╯")) == {"#888888"}
|
||||
|
||||
|
||||
def test_gradient_fill_static_and_scrolling() -> None:
|
||||
bar = gradient_fill(gradient_lut(("#ff0000", "#0000ff")), 0.5, 10, None, "#333333")
|
||||
assert bar.plain == "━━━━━╺━━━━"
|
||||
assert hex_of(bar.get_style_at_offset(Console(), 0)) == "#ff0000"
|
||||
scrolled = gradient_fill(gradient_lut(("#ff0000", "#0000ff"), cyclic=True), 0.5, 10, 3.0, "#333333")
|
||||
assert hex_of(scrolled.get_style_at_offset(Console(), 3)) == "#ff0000"
|
||||
|
||||
|
||||
def test_bar_column_uses_the_gradient_until_the_task_finishes(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
import unshackle.core.console as console_module
|
||||
|
||||
monkeypatch.setattr(console_module, "theme_gradients", {"bar": ("#ff0000", "#0000ff")})
|
||||
column = GradientPulseBarColumn()
|
||||
progress = Progress(column, console=Console(file=io.StringIO()))
|
||||
progress.add_task("x", total=10, completed=5)
|
||||
progress.add_task("y", total=10, completed=10)
|
||||
running, done = progress.tasks
|
||||
assert type(column.render(running)).__name__ == "_GradientFill"
|
||||
assert type(column.render(done)).__name__ == "ProgressBar"
|
||||
|
||||
|
||||
def slid(renderable: RenderableType, offset: float) -> list[Segment]:
|
||||
lines = Console(file=io.StringIO(), color_system="truecolor", width=40).render_lines(renderable, pad=False)
|
||||
return [segment for line in slide_gradients(lines, offset) for segment in line]
|
||||
|
||||
|
||||
def test_sliding_a_gradient_moves_the_colours_and_loops() -> None:
|
||||
text = Text("█" * 20, style="#888888")
|
||||
with use_gradients({"banner": ("#ff0000", "#0000ff")}):
|
||||
frames = [colours_of(slid(Gradient(text, "banner", "#888888"), o), "█") for o in (0.0, 0.5, 1.0)]
|
||||
assert frames[0] != frames[1]
|
||||
assert frames[0] == frames[2]
|
||||
|
||||
|
||||
def test_sliding_moves_a_nested_panel_border_and_nothing_else() -> None:
|
||||
from rich.padding import Padding
|
||||
|
||||
panel = Padding(Panel("x", border_style="#888888", box=box.SQUARE), (0, 3))
|
||||
with use_gradients({"panel": ("#ff0000", "#0000ff")}):
|
||||
still = colours_of(render(panel), "┌")
|
||||
moved = colours_of(slid(panel, 0.5), "┌")
|
||||
text = colours_of(slid(Text("x", style="#888888"), 0.5), "x")
|
||||
assert still == ["#ff0000"] and moved != still
|
||||
assert text == ["#888888"]
|
||||
|
||||
|
||||
def test_an_unreadable_themes_folder_is_skipped_with_a_warning(
|
||||
themes_dir: Path, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
def refuse(self: Path) -> None:
|
||||
raise PermissionError(13, "Permission denied")
|
||||
|
||||
monkeypatch.setattr(Path, "iterdir", refuse)
|
||||
with caplog.at_level(logging.WARNING, logger="console"):
|
||||
assert user_themes() == {}
|
||||
assert "cannot read the themes folder" in caplog.text
|
||||
|
||||
|
||||
def test_a_file_name_with_a_control_character_is_skipped(themes_dir: Path) -> None:
|
||||
write(themes_dir, "\u202emine", 'text: "#ffffff"\n')
|
||||
write(themes_dir, "mine", 'text: "#ffffff"\n')
|
||||
assert list(user_themes()) == ["mine"]
|
||||
|
||||
|
||||
def pinned_console(height: int = 12) -> tuple[io.StringIO, Console]:
|
||||
out = io.StringIO()
|
||||
return out, Console(
|
||||
file=out, force_terminal=True, force_interactive=True, width=60, height=height, color_system="truecolor"
|
||||
)
|
||||
|
||||
|
||||
def test_pinned_live_sends_old_lines_to_the_scrollback_once_the_screen_is_full() -> None:
|
||||
out, con = pinned_console()
|
||||
pinned = PinnedLive(Text("HEADER"), con)
|
||||
pinned.start(refresh=True)
|
||||
try:
|
||||
panel = Panel("first state")
|
||||
con.print(panel)
|
||||
panel.renderable = "CHANGED" # a kept print shows the state it had when it was printed
|
||||
con.print("narrow", width=4)
|
||||
assert ["".join(segment.text for segment in line) for line in pinned.kept[-2:]] == ["narr", "ow"]
|
||||
for i in range(30):
|
||||
con.print(f"line {i:02d}")
|
||||
assert pinned.header_sent
|
||||
assert len(pinned.kept) == pinned.room # exactly the lines that fit; the rest went to the scrollback
|
||||
finally:
|
||||
pinned.close()
|
||||
assert pinned.kept == []
|
||||
plain = Text.from_ansi(out.getvalue()).plain
|
||||
assert "first state" in plain and "CHANGED" not in plain
|
||||
assert "line 29" in plain
|
||||
|
||||
|
||||
def test_pinned_live_prints_the_header_at_close_when_nothing_scrolled() -> None:
|
||||
out, con = pinned_console(height=40)
|
||||
pinned = PinnedLive(Text("HEADER"), con)
|
||||
pinned.start(refresh=True)
|
||||
con.print("one line")
|
||||
pinned.close()
|
||||
assert Text.from_ansi(out.getvalue()).plain.rstrip().endswith("HEADER\none line")
|
||||
|
||||
|
||||
def test_a_prompt_inside_a_spinner_keeps_the_live_areas_in_order() -> None:
|
||||
con = ComfyConsole(file=io.StringIO(), force_terminal=True, force_interactive=True, width=60, height=20)
|
||||
pinned = PinnedLive(Text("HEADER"), con)
|
||||
pinned.start()
|
||||
try:
|
||||
with con.status("working"):
|
||||
assert con.input("code: ", stream=io.StringIO("123\n")).strip() == "123"
|
||||
assert con._live_stack[0] is pinned and not pinned._nested
|
||||
assert con._live_stack[1]._nested
|
||||
finally:
|
||||
pinned.close()
|
||||
assert con._live_stack == []
|
||||
|
||||
|
||||
def test_sync_codes_wrap_each_print_but_not_on_the_old_windows_console() -> None:
|
||||
out, con = pinned_console()
|
||||
with SyncLive(Text("live"), console=con, auto_refresh=False) as live:
|
||||
con.print("hello")
|
||||
value = out.getvalue()
|
||||
assert value.index("\x1b[?2026h") < value.index("hello") < value.index("\x1b[?2026l", value.index("hello"))
|
||||
con.legacy_windows = True
|
||||
printed = Text("x")
|
||||
assert live.synced([printed]) == [printed]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"subcommand, args, pinned",
|
||||
[
|
||||
("dl", ["dl", "EXAMPLE", "title"], True),
|
||||
("dl", ["--debug", "dl", "-q", "1080", "EXAMPLE", "title"], True),
|
||||
("dl", ["dl"], True), # Click prints the usage text after the pinned area closes
|
||||
("dl", ["dl", "EXAMPLE", "--help"], False),
|
||||
("dl", ["dl", "-?"], False),
|
||||
("env", ["env", "info"], False),
|
||||
],
|
||||
)
|
||||
def test_only_a_dl_run_pins_the_banner(
|
||||
monkeypatch: pytest.MonkeyPatch, subcommand: str, args: list[str], pinned: bool
|
||||
) -> None:
|
||||
import unshackle.core.console as console_module
|
||||
from unshackle.core.__main__ import pins_banner
|
||||
|
||||
monkeypatch.setattr(console_module, "theme_gradients", {"banner": ("#ff0000",)})
|
||||
monkeypatch.setattr(PinnedLive, "wanted", staticmethod(lambda live_console: True))
|
||||
assert pins_banner(subcommand, args) is pinned
|
||||
monkeypatch.setattr(console_module, "theme_gradients", {})
|
||||
assert pins_banner(subcommand, args) is False
|
||||
|
||||
|
||||
def test_the_banner_pins_only_on_an_interactive_colour_terminal() -> None:
|
||||
_, con = pinned_console()
|
||||
assert PinnedLive.wanted(con)
|
||||
assert not PinnedLive.wanted(
|
||||
Console(file=io.StringIO(), force_terminal=True, force_interactive=True, no_color=True)
|
||||
)
|
||||
assert not PinnedLive.wanted(Console(file=io.StringIO(), force_terminal=True, force_interactive=False))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("height", [5, 500])
|
||||
def test_env_theme_previews_in_a_short_and_a_tall_terminal(
|
||||
themes_dir: Path, monkeypatch: pytest.MonkeyPatch, height: int
|
||||
) -> None:
|
||||
import unshackle.core.console as console_module
|
||||
|
||||
monkeypatch.setattr(console_module.console, "_height", height)
|
||||
result = CliRunner().invoke(env, ["theme", "rainbow"])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert result.output.count("github.com/unshackle") == 1
|
||||
assert "Available Tracks" in result.output
|
||||
|
||||
|
||||
def test_a_narrow_terminal_gets_no_live_animation(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
from unshackle.core.console import fits_terminal
|
||||
|
||||
_, con = pinned_console()
|
||||
monkeypatch.setenv("COLUMNS", str(con.width - 1))
|
||||
assert not fits_terminal(con) and not PinnedLive.wanted(con)
|
||||
monkeypatch.setenv("COLUMNS", str(con.width))
|
||||
assert fits_terminal(con) and PinnedLive.wanted(con)
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform == "win32", reason="POSIX signals")
|
||||
def test_sigterm_during_a_pinned_run_still_prints_the_kept_lines(tmp_path: Path) -> None:
|
||||
import os
|
||||
import pty
|
||||
import signal
|
||||
|
||||
script = tmp_path / "pinned.py"
|
||||
script.write_text(
|
||||
"import signal, sys, time\n"
|
||||
"from rich.text import Text\n"
|
||||
"from unshackle.core.console import PinnedLive, console\n"
|
||||
"pinned = PinnedLive(Text('HEADER'), console)\n"
|
||||
"pinned.start(refresh=True)\n"
|
||||
"signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(128 + signum))\n"
|
||||
"try:\n"
|
||||
" console.print('kept line')\n"
|
||||
" print('READY', file=sys.__stderr__, flush=True)\n"
|
||||
" time.sleep(30)\n"
|
||||
"finally:\n"
|
||||
" pinned.close()\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
master, slave = pty.openpty()
|
||||
proc = subprocess.Popen([sys.executable, str(script)], stdin=slave, stdout=slave, stderr=subprocess.PIPE)
|
||||
os.close(slave)
|
||||
assert proc.stderr is not None and b"READY" in proc.stderr.readline()
|
||||
proc.send_signal(signal.SIGTERM)
|
||||
out = b""
|
||||
while True:
|
||||
try:
|
||||
chunk = os.read(master, 65536)
|
||||
except OSError:
|
||||
break
|
||||
if not chunk:
|
||||
break
|
||||
out += chunk
|
||||
assert proc.wait(timeout=30) == 128 + signal.SIGTERM
|
||||
tail = out[out.rfind(b"\x1b[?25h") :]
|
||||
assert b"HEADER" in tail and b"kept line" in tail
|
||||
@@ -287,26 +287,6 @@ def test_cdm_returning_the_flagged_key_clears_the_flag(tmp_path: Path, monkeypat
|
||||
assert not local.is_bad_key(KID, BAD)
|
||||
|
||||
|
||||
def test_a_licence_key_that_replaces_a_bad_local_pair_is_stored(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
"""The local vault held the bad pair when the licence key arrived, so it skipped the KID; store it now."""
|
||||
local = SQLite("local", tmp_path / "local.db")
|
||||
local.add_key("SVC", KID, BAD)
|
||||
vaults = Vaults("SVC")
|
||||
vaults.vaults = [local]
|
||||
cmd = make_cmd(monkeypatch, vaults)
|
||||
drm = FakeDRM({KID: vaults.get_key(KID)[0]})
|
||||
path = tmp_path / "video.mp4"
|
||||
path.write_bytes(b"cipher")
|
||||
assert local.add_keys("SVC", {KID: GOOD}) == 0
|
||||
|
||||
cmd.decrypt_verified(drm, path, lambda drm, track_kid: drm.content_keys.update({KID: GOOD}), KID)
|
||||
cmd.wait_vault_writes()
|
||||
assert local.is_bad_key(KID, BAD)
|
||||
assert local.get_key(KID, "SVC") == GOOD
|
||||
|
||||
|
||||
def test_stale_backup_from_a_killed_run_is_not_restored(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
poisoned = Remote("poisoned", tmp_path / "poisoned.db")
|
||||
poisoned.add_key("SVC", KID, BAD)
|
||||
@@ -446,7 +426,7 @@ def test_only_the_kid_whose_window_fails_is_flagged(tmp_path: Path, monkeypatch:
|
||||
|
||||
|
||||
def test_a_kid_absent_from_the_map_is_judged_by_the_fallback(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""A map that holds an all-zero tenc KID is not complete, so a KID it does not know
|
||||
"""A KID the map does not know (a zero-KID tenc, a licence KID the file does not carry)
|
||||
shares the whole-file verdict, and a wrong key there is flagged."""
|
||||
lead = UUID(int=7)
|
||||
local = SQLite("local", tmp_path / "local.db")
|
||||
@@ -466,9 +446,7 @@ def test_a_kid_absent_from_the_map_is_judged_by_the_fallback(tmp_path: Path, mon
|
||||
return drm.decrypted_with[-1][lead if start is not None else KID] == GOOD
|
||||
|
||||
monkeypatch.setattr(
|
||||
dl_module.verify,
|
||||
"kid_windows",
|
||||
lambda path: dl_module.verify.KidMap({lead: [(4.0, 6.0)], UUID(int=0): [(8.0, 10.0)]}, True),
|
||||
dl_module.verify, "kid_windows", lambda path: dl_module.verify.KidMap({lead: [(4.0, 6.0)]}, True)
|
||||
)
|
||||
monkeypatch.setattr(dl_module, "ffmpeg_decodes", decodes)
|
||||
path = tmp_path / "video.mp4"
|
||||
@@ -523,93 +501,11 @@ def test_a_wrong_mapped_key_does_not_flag_a_kid_the_file_does_not_carry(
|
||||
assert drm.content_keys == {audio: GOOD, KID: GOOD}
|
||||
assert local.is_bad_key(KID, BAD)
|
||||
assert not local.is_bad_key(audio, GOOD)
|
||||
assert local.get_key(audio, "SVC") is None
|
||||
|
||||
|
||||
def test_a_kid_the_file_does_not_carry_is_not_judged_by_it(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""The CDM licensed the video KID and a vault served the audio KID. An FFmpeg that fails
|
||||
every decode of the video file must not flag the audio KID, nor copy it to another vault."""
|
||||
audio = UUID(int=7)
|
||||
local = SQLite("local", tmp_path / "local.db")
|
||||
remote = Remote("remote", tmp_path / "remote.db")
|
||||
remote.add_key("SVC", audio, GOOD)
|
||||
vaults = Vaults("SVC")
|
||||
vaults.vaults = [local, remote]
|
||||
cmd = make_cmd(monkeypatch, vaults)
|
||||
drm = FakeDRM({audio: vaults.get_key(audio)[0], KID: GOOD})
|
||||
monkeypatch.setattr(
|
||||
dl_module.verify, "kid_windows", lambda path: dl_module.verify.KidMap({KID: [(4.0, 6.0)]}, True)
|
||||
)
|
||||
monkeypatch.setattr(dl_module, "ffmpeg_decodes", lambda path, start=None, seconds=3, video=None: False)
|
||||
path = tmp_path / "video.mp4"
|
||||
path.write_bytes(b"cipher")
|
||||
licences: list[UUID] = []
|
||||
|
||||
cmd.decrypt_verified(drm, path, lambda drm, track_kid: licences.append(track_kid), KID)
|
||||
cmd.wait_vault_writes()
|
||||
assert drm.content_keys == {audio: GOOD, KID: GOOD}
|
||||
assert not licences
|
||||
assert not local.is_bad_key(audio, GOOD)
|
||||
assert local.get_key(audio, "SVC") is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("served", "decodes", "told"),
|
||||
[
|
||||
(GOOD, False, False), # broken FFmpeg, the CDM returns the same key
|
||||
(BAD, True, True), # the CDM returns another key
|
||||
],
|
||||
)
|
||||
def test_a_remote_vault_is_told_only_when_another_key_replaces_its_pair(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch, served: str, decodes: bool, told: bool
|
||||
) -> None:
|
||||
remote = Remote("remote", tmp_path / "remote.db")
|
||||
remote.add_key("SVC", KID, served)
|
||||
vaults = Vaults("SVC")
|
||||
vaults.vaults = [SQLite("local", tmp_path / "local.db"), remote]
|
||||
cmd = make_cmd(monkeypatch, vaults)
|
||||
if not decodes:
|
||||
monkeypatch.setattr(dl_module, "ffmpeg_decodes", lambda path, start=None, seconds=3, video=None: False)
|
||||
drm = FakeDRM({KID: vaults.get_key(KID)[0]})
|
||||
path = tmp_path / "video.mp4"
|
||||
path.write_bytes(b"cipher")
|
||||
|
||||
def licence(drm: FakeDRM, track_kid: UUID) -> None:
|
||||
assert not remote.is_bad_key(KID, served)
|
||||
drm.content_keys[KID] = GOOD
|
||||
|
||||
cmd.decrypt_verified(drm, path, licence, KID)
|
||||
assert drm.content_keys == {KID: GOOD}
|
||||
assert remote.is_bad_key(KID, served) is told
|
||||
|
||||
|
||||
def test_the_server_vault_is_told_at_once(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Over --remote the report is what makes the server skip the pair on the next licence."""
|
||||
reports: list[tuple[UUID, str]] = []
|
||||
server = SimpleNamespace(
|
||||
name="server_cdm",
|
||||
local=False,
|
||||
report_now=True,
|
||||
flag_bad_key=lambda service, kid, key, source: reports.append((kid, key)),
|
||||
)
|
||||
vaults = Vaults("SVC")
|
||||
vaults.vaults = [SQLite("local", tmp_path / "local.db")]
|
||||
vaults.sources[KID] = (BAD, server)
|
||||
cmd = make_cmd(monkeypatch, vaults)
|
||||
drm = FakeDRM({KID: BAD})
|
||||
path = tmp_path / "video.mp4"
|
||||
path.write_bytes(b"cipher")
|
||||
|
||||
def licence(drm: FakeDRM, track_kid: UUID) -> None:
|
||||
assert reports == [(KID, BAD)]
|
||||
drm.content_keys[KID] = GOOD
|
||||
|
||||
cmd.decrypt_verified(drm, path, licence, KID)
|
||||
assert drm.content_keys == {KID: GOOD}
|
||||
assert local.get_key(audio, "SVC") == GOOD # judged on the retry and copied
|
||||
|
||||
|
||||
def test_only_checked_kids_are_copied_to_other_vaults(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Only the mapped KID is proven and copied; the KID this file does not carry waits for its own file."""
|
||||
"""Both the mapped KID and the absent one are proven before they reach another vault."""
|
||||
lead = UUID(int=7)
|
||||
local = SQLite("local", tmp_path / "local.db")
|
||||
remote = Remote("remote", tmp_path / "remote.db")
|
||||
@@ -634,35 +530,9 @@ def test_only_checked_kids_are_copied_to_other_vaults(tmp_path: Path, monkeypatc
|
||||
|
||||
cmd.decrypt_verified(drm, path, None, KID)
|
||||
cmd.wait_vault_writes()
|
||||
assert None not in starts
|
||||
assert starts.count(None) == 1 # the absent KID went through the fallback before its copy
|
||||
assert local.get_key(lead, "SVC") == GOOD
|
||||
assert local.get_key(KID, "SVC") is None
|
||||
|
||||
|
||||
def test_a_clear_file_judges_and_copies_no_vault_key(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
local = SQLite("local", tmp_path / "local.db")
|
||||
remote = Remote("remote", tmp_path / "remote.db")
|
||||
remote.add_key("SVC", KID, BAD)
|
||||
vaults = Vaults("SVC")
|
||||
vaults.vaults = [local, remote]
|
||||
cmd = make_cmd(monkeypatch, vaults)
|
||||
drm = FakeDRM({KID: vaults.get_key(KID)[0]})
|
||||
checks: list = []
|
||||
|
||||
def decodes(path: Path, start: object = None, seconds: float = 3, video: object = None) -> bool:
|
||||
checks.append(start)
|
||||
return True
|
||||
|
||||
monkeypatch.setattr(dl_module.verify, "kid_windows", lambda path: dl_module.verify.KidMap({}, False))
|
||||
monkeypatch.setattr(dl_module, "ffmpeg_decodes", decodes)
|
||||
path = tmp_path / "audio.mp4"
|
||||
path.write_bytes(b"clear")
|
||||
|
||||
cmd.decrypt_verified(drm, path, None, KID)
|
||||
cmd.wait_vault_writes()
|
||||
assert checks == []
|
||||
assert local.get_key(KID, "SVC") is None
|
||||
assert not local.is_bad_key(KID, BAD)
|
||||
assert local.get_key(KID, "SVC") == GOOD
|
||||
|
||||
|
||||
def test_flagged_pair_warns_once_per_vault(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
|
||||
@@ -732,8 +602,6 @@ def test_api_vault_reports_the_pair_upstream(monkeypatch: pytest.MonkeyPatch, ca
|
||||
vaults.vaults = [api]
|
||||
vaults.sources[KID] = (BAD, api)
|
||||
vaults.flag_bad_key(KID, BAD)
|
||||
assert not calls
|
||||
vaults.report_replaced({KID: GOOD})
|
||||
vaults.unflag_bad_key(KID, BAD)
|
||||
|
||||
assert calls == [
|
||||
@@ -741,31 +609,28 @@ def test_api_vault_reports_the_pair_upstream(monkeypatch: pytest.MonkeyPatch, ca
|
||||
("DELETE", f"https://vault.example/bad-keys/{KID.hex}/{BAD}", None),
|
||||
]
|
||||
|
||||
def flag_and_replace(source: object) -> None:
|
||||
vaults.sources[KID] = (BAD, source)
|
||||
vaults.flag_bad_key(KID, BAD)
|
||||
vaults.report_replaced({KID: GOOD})
|
||||
|
||||
calls.clear()
|
||||
flag_and_replace(SimpleNamespace(name="other", local=False, report_now=False))
|
||||
vaults.sources[KID] = (BAD, SimpleNamespace(name="other"))
|
||||
vaults.flag_bad_key(KID, BAD)
|
||||
assert calls == []
|
||||
vaults.sources[KID] = (BAD, api)
|
||||
|
||||
monkeypatch.setattr(api.session, "post", lambda url, **kw: (_ for _ in ()).throw(ConnectionError("down")))
|
||||
caplog.clear()
|
||||
with caplog.at_level(logging.DEBUG, logger="unshackle.core.vaults"):
|
||||
flag_and_replace(api)
|
||||
vaults.flag_bad_key(KID, BAD)
|
||||
assert [r.levelname for r in caplog.records] == ["DEBUG"]
|
||||
|
||||
gone = SimpleNamespace(status_code=404, raise_for_status=lambda: (_ for _ in ()).throw(RuntimeError("404")))
|
||||
monkeypatch.setattr(api.session, "post", lambda url, **kw: gone)
|
||||
caplog.clear()
|
||||
flag_and_replace(api)
|
||||
vaults.flag_bad_key(KID, BAD)
|
||||
assert not caplog.records
|
||||
|
||||
denied = SimpleNamespace(status_code=200, raise_for_status=lambda: None, json=lambda: {"code": 1, "message": "no"})
|
||||
monkeypatch.setattr(api.session, "post", lambda url, **kw: denied)
|
||||
monkeypatch.setattr(api.session, "delete", lambda url, **kw: denied)
|
||||
flag_and_replace(api)
|
||||
vaults.flag_bad_key(KID, BAD)
|
||||
vaults.unflag_bad_key(KID, BAD)
|
||||
assert not caplog.records
|
||||
|
||||
|
||||
@@ -39,9 +39,6 @@ def fake_server_vaults(pushes: list, vault_list: list[FakeVault]) -> Any:
|
||||
def __len__(self) -> int:
|
||||
return len(vault_list)
|
||||
|
||||
def clear_licensed_flags(self, content_keys: dict) -> list:
|
||||
return []
|
||||
|
||||
def add_keys(self, key_map: dict) -> int:
|
||||
pushes.append(key_map)
|
||||
return sum(vault.ok for vault in vault_list)
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
"""A segment that fails every attempt reports the attempts and the cause, without the signed URL."""
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.commands.dl import dl
|
||||
from unshackle.core.downloaders.requests import download, retries_exhausted
|
||||
from unshackle.core.session import MaxRetriesError, RnetSession, failure_reason
|
||||
|
||||
downloader = sys.modules[download.__module__]
|
||||
|
||||
SIGNED_URL = "https://cdn.example.invalid/dvt2=exp=1~hmac=deadbeef/seg/40_000.mp4a"
|
||||
RNET_BROKEN_PIPE = (
|
||||
f'is_request error: wreq::Error {{ kind: Request, url: "{SIGNED_URL}", source: hyper::Error(Io, '
|
||||
'Custom { kind: BrokenPipe, error: "stream closed because of a broken pipe" }) }'
|
||||
)
|
||||
|
||||
|
||||
class RequestError(Exception):
|
||||
"""Stands in for rnet.RequestError, which carries the URL in its text."""
|
||||
|
||||
|
||||
def test_failure_reason_keeps_the_rnet_error_text_and_drops_the_url():
|
||||
reason = failure_reason(MaxRetriesError("m", cause=RequestError(RNET_BROKEN_PIPE)))
|
||||
|
||||
assert reason == "RequestError (stream closed because of a broken pipe)"
|
||||
|
||||
|
||||
def test_spent_retries_report_one_line_without_the_url(monkeypatch, tmp_path):
|
||||
session = RnetSession()
|
||||
calls = []
|
||||
|
||||
def get(url, **kwargs):
|
||||
calls.append(kwargs.get("max_retries"))
|
||||
raise MaxRetriesError("GET cdn.example.invalid failed: x", cause=RequestError(RNET_BROKEN_PIPE))
|
||||
|
||||
monkeypatch.setattr(session, "get", get)
|
||||
monkeypatch.setattr(downloader, "retry_sleep", lambda exc, attempts: 0)
|
||||
|
||||
with pytest.raises(MaxRetriesError) as raised:
|
||||
for _ in download(url=SIGNED_URL, save_path=tmp_path / "seg", session=session):
|
||||
pass
|
||||
|
||||
assert calls == [0] * downloader.MAX_ATTEMPTS
|
||||
assert retries_exhausted(raised.value)
|
||||
assert not retries_exhausted(ValueError("boom"))
|
||||
header, line = dl.failure_lines(raised.value)
|
||||
assert f"gave up after {downloader.MAX_ATTEMPTS} failed attempts" in line
|
||||
assert "hmac" not in line
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated Sat Jun 01 21:01:19 2013 by Dolby Media Generator, Version 2013May16.160953 -->
|
||||
<MPD
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dolby="http://www.dolby.com/ns/online/DASH"
|
||||
xmlns="urn:mpeg:dash:schema:mpd:2011"
|
||||
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011"
|
||||
type="static"
|
||||
mediaPresentationDuration="PT0H0M30.030S"
|
||||
minBufferTime="PT1.2S"
|
||||
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
|
||||
|
||||
<BaseURL>./</BaseURL>
|
||||
|
||||
<Period>
|
||||
<!-- Video -->
|
||||
<AdaptationSet mimeType="video/mp4" codecs="avc1.42801e" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" bandwidth="519264" width="640" height="480">
|
||||
<BaseURL>ChID_voices_51_256_ddp_V.mp4</BaseURL>
|
||||
<SegmentBase indexRange="742-953">
|
||||
<Initialization range="0-741"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Audio -->
|
||||
<AdaptationSet mimeType="audio/mp4" codecs="ec-3" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="2" bandwidth="256000">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:dolby:dash:audio_channel_configuration:2011" value="F801"/>
|
||||
<BaseURL>ChID_voices_51_256_ddp_A.mp4</BaseURL>
|
||||
<SegmentBase indexRange="603-766">
|
||||
<Initialization range="0-602"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
Vendored
-23
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT11.5416666667S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="480" mimeType="video/mp4" par="16:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501728" id="6chID_848x480_24fps-avc1.42c01e-11s-848x480-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>6chID_848x480_24fps-avc1.42c01e-11s-848x480-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="685-752">
|
||||
<Initialization range="0-684"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.5" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="163750" id="6ch_ident_48kHz-en-11s-6-heaac-160000bps_seg">
|
||||
<BaseURL>6ch_ident_48kHz-en-11s-6-heaac-160000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-676">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
Vendored
-23
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT11.5416666667S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="480" mimeType="video/mp4" par="16:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501728" id="6chID_848x480_24fps-avc1.42c01e-11s-848x480-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>6chID_848x480_24fps-avc1.42c01e-11s-848x480-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="685-752">
|
||||
<Initialization range="0-684"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.30" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="99426" id="6ch_ident_48kHz-en-11s-6-mps-96000bps_seg">
|
||||
<BaseURL>6ch_ident_48kHz-en-11s-6-mps-96000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-689">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT68.4583333333S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="476" mimeType="video/mp4" par="16:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501687" id="German_Forest_SHORT_1v0-avc1.42c01e-68s-848x476-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>German_Forest_SHORT_1v0-avc1.42c01e-68s-848x476-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="686-885">
|
||||
<Initialization range="0-685"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.2" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="2"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131152" id="German_Forest_Short_Poem_english-en-68s-2-lc-128000bps_seg">
|
||||
<BaseURL>German_Forest_Short_Poem_english-en-68s-2-lc-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="606-805">
|
||||
<Initialization range="0-605"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.2" contentType="audio" lang="de" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="2"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131152" id="German_Forest_Short_Poem_german-de-68s-2-lc-128000bps_seg">
|
||||
<BaseURL>German_Forest_Short_Poem_german-de-68s-2-lc-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="606-805">
|
||||
<Initialization range="0-605"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-12T15:12:29Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H12M14.17S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/TearsOfSteel/OnDemand/MultiRate/TOS_OnDemand_HEVC_MultiRate.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.17S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24" par="16:9" lang="eng" subsegmentStartsWithSAP="1" contentType="video">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="470596">
|
||||
<BaseURL>tears_of_steel_720p_500k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1798-6245"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1246133">
|
||||
<BaseURL>tears_of_steel_720p_1000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-6297"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2496699">
|
||||
<BaseURL>tears_of_steel_720p_2000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-6297"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="eng" subsegmentStartsWithSAP="1" contentType="audio">
|
||||
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65203">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>tears_of_steel_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="849-5380">
|
||||
<Initialization range="0-848"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-24T15:39:33Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H9M56.29S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/BigBuckBunny/1a/1/BBB_OnDemand_HEVC_MultiRate.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M56.29S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24" par="16:9" lang="und" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="429713">
|
||||
<BaseURL>bbb_720p_500k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1848-5467"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1141159">
|
||||
<BaseURL>bbb_720p_1000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-5469"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2281166">
|
||||
<BaseURL>bbb_720p_2000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-5469"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="und" subsegmentStartsWithSAP="1">
|
||||
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65606">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>bbb_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="849-4528">
|
||||
<Initialization range="0-848"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-14T09:01:54.894Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/1/tos_720_Multirate_HEVC_ondemand.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24" par="1:1" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="515353">
|
||||
<BaseURL>tos_720p_500k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="948-5395">
|
||||
<Initialization range="0-947"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1030940">
|
||||
<BaseURL>tos_720p_1000k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="948-5395">
|
||||
<Initialization range="0-947"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2068688">
|
||||
<BaseURL>tos_720p_2000k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="948-5395">
|
||||
<Initialization range="0-947"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="65928">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>tos_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="847-5294">
|
||||
<Initialization range="0-846"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="urn:mpeg:dash:schema:mpd:2011"
|
||||
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
|
||||
type="static"
|
||||
mediaPresentationDuration="PT654S"
|
||||
minBufferTime="PT4S"
|
||||
profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011">
|
||||
|
||||
<BaseURL>http://dash.edgesuite.net/dash264/TestCases/1a/netflix/</BaseURL>
|
||||
<Period>
|
||||
<!-- English Audio -->
|
||||
<AdaptationSet mimeType="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" bandwidth="72000">
|
||||
<BaseURL>ElephantsDream_AAC48K_064.mp4.dash</BaseURL>
|
||||
<SegmentBase indexRange="871-11131">
|
||||
<Initialization range="0-870"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Video -->
|
||||
<AdaptationSet mimeType="video/mp4" codecs="avc1.42401E" subsegmentAlignment="true" subsegmentStartsWithSAP="1" contentType='video' maxWidth="480" maxHeight="360" maxFrameRate="24" par="4:3">
|
||||
<Representation id="2" bandwidth="150000" width="480" height="360" frameRate="24" sar="1:1">
|
||||
<BaseURL>ElephantsDream_H264BPL30_0100.264.dash</BaseURL>
|
||||
<SegmentBase indexRange="984-11244">
|
||||
<Initialization range="0-983"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="3" bandwidth="250000" width="480" height="360" frameRate="24" sar="1:1">
|
||||
<BaseURL>ElephantsDream_H264BPL30_0175.264.dash</BaseURL>
|
||||
<SegmentBase indexRange="984-11245">
|
||||
<Initialization range="0-983"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="4" bandwidth="350000" width="480" height="360" frameRate="24" sar="1:1">
|
||||
<BaseURL>ElephantsDream_H264BPL30_0250.264.dash</BaseURL>
|
||||
<SegmentBase indexRange="984-11245">
|
||||
<Initialization range="0-983"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="5" bandwidth="750000" width="480" height="360" frameRate="24" sar="1:1">
|
||||
<BaseURL>ElephantsDream_H264BPL30_0500.264.dash</BaseURL>
|
||||
<SegmentBase indexRange="985-11245">
|
||||
<Initialization range="0-984"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" maxSubsegmentDuration="PT5.0S" mediaPresentationDuration="PT9M57S" minBufferTime="PT5.0S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://xmlns.sony.net/metadata/mpeg/dash/profile/senvu/2012" type="static" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd">
|
||||
<Period duration="PT9M57S" id="P1">
|
||||
<!-- Adaptation Set for main audio -->
|
||||
<AdaptationSet audioSamplingRate="48000" codecs="mp4a.40.5" contentType="audio" group="2" id="2" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
|
||||
<Representation bandwidth="64000" id="2_1">
|
||||
<BaseURL>DASH_vodaudio_Track5.m4a</BaseURL>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Adaptation Set for video -->
|
||||
<AdaptationSet codecs="avc1.4D401E" contentType="video" frameRate="24000/1001" group="1" id="1" maxBandwidth="1609728" maxHeight="480" maxWidth="854" maximumSAPPeriod="5.0" mimeType="video/mp4" minBandwidth="452608" minHeight="480" minWidth="854" par="16:9" sar="1:1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
|
||||
<Representation bandwidth="1005568" height="480" id="1_1" mediaStreamStructureId="1" width="854">
|
||||
<BaseURL>DASH_vodvideo_Track2.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="1609728" height="480" id="1_2" mediaStreamStructureId="1" width="854">
|
||||
<BaseURL>DASH_vodvideo_Track1.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="704512" height="480" id="1_3" mediaStreamStructureId="1" width="854">
|
||||
<BaseURL>DASH_vodvideo_Track3.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="452608" height="480" id="1_4" mediaStreamStructureId="1" width="854">
|
||||
<BaseURL>DASH_vodvideo_Track4.m4v</BaseURL>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-12T15:13:26Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H12M14.17S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/TearsOfSteel/Live/MultiRate/TOS_Live_HEVC_MultiRate.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.17S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24" par="16:9" lang="eng" contentType="video">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="474392">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_720p_500k_H265_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRate_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1250137">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_720p_1000k_H265_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRate_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2500703">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_720p_2000k_H265_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRate_set1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="eng" contentType="audio">
|
||||
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65432">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="tears_of_steel_64k_audio_$Number$.mp4" startNumber="1" duration="93948" initialization="tears_of_steel_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-16T09:31:17.480Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/tos_live_single_res_multi_rep_hvc/tos_720_Multirate_HEVC_Live.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24" par="1:1" lang="und">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="515577">
|
||||
<SegmentTemplate timescale="24" media="tos_720p_500k_H265_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_720p_500k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="1031164">
|
||||
<SegmentTemplate timescale="24" media="tos_720p_1000k_H265_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_720p_1000k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="2068913">
|
||||
<SegmentTemplate timescale="24" media="tos_720p_2000k_H265_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_720p_2000k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng">
|
||||
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="66152">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="tos_64k_audio_$Number$.mp4" startNumber="1" duration="95999" initialization="tos_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-24T15:40:46Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H9M56.29S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/BigBuckBunny/1b/1/BBB_Live_HEVC_MultiRate.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M56.29S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24" par="16:9" lang="und">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="433711">
|
||||
<SegmentTemplate timescale="12288" media="bbb_720p_500k_H265_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRate_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1145164">
|
||||
<SegmentTemplate timescale="12288" media="bbb_720p_1000k_H265_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRate_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2285171">
|
||||
<SegmentTemplate timescale="12288" media="bbb_720p_2000k_H265_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRate_set1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="und">
|
||||
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65834">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="bbb_64k_audio_$Number$.mp4" startNumber="1" duration="94089" initialization="bbb_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated Sat Jun 01 21:01:28 2013 by Dolby Media Generator, Version 2013May16.160953 -->
|
||||
<MPD
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dolby="http://www.dolby.com/ns/online/DASH"
|
||||
xmlns="urn:mpeg:dash:schema:mpd:2011"
|
||||
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011"
|
||||
type="static"
|
||||
mediaPresentationDuration="PT0H0M30.030S"
|
||||
minBufferTime="PT1.2S"
|
||||
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
|
||||
|
||||
<BaseURL>./</BaseURL>
|
||||
|
||||
<Period>
|
||||
<!-- Video -->
|
||||
<AdaptationSet mimeType="video/mp4" codecs="avc1.42801e" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" bandwidth="520360" width="640" height="480">
|
||||
<BaseURL>ChID_voices_71_768_ddp_V.mp4</BaseURL>
|
||||
<SegmentBase indexRange="742-953">
|
||||
<Initialization range="0-741"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Audio -->
|
||||
<AdaptationSet mimeType="audio/mp4" codecs="ec-3" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="2" bandwidth="768000">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:dolby:dash:audio_channel_configuration:2011" value="FA01"/>
|
||||
<BaseURL>ChID_voices_71_768_ddp_A.mp4</BaseURL>
|
||||
<SegmentBase indexRange="604-767">
|
||||
<Initialization range="0-603"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT14.3333333333S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="480" mimeType="video/mp4" par="16:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501691" id="8chID_848x480_24fps-avc1.42c01e-14s-848x480-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>8chID_848x480_24fps-avc1.42c01e-14s-848x480-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="685-752">
|
||||
<Initialization range="0-684"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.5" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="12"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="259712" id="8chID-en-14s-8-heaac-256000bps_seg">
|
||||
<BaseURL>8chID-en-14s-8-heaac-256000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-676">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT653.625S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="480" mimeType="video/mp4" par="16:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="854">
|
||||
<Representation bandwidth="1501684" id="ED_SD_480p_reenc-avc1.42c01e-0s-854x480-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>ED_SD_480p_reenc-avc1.42c01e-0s-854x480-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="686-2289">
|
||||
<Initialization range="0-685"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.30" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="51287" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-48000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-48000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="617-2220">
|
||||
<Initialization range="0-616"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="67285" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-64000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-64000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="617-2220">
|
||||
<Initialization range="0-616"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="99284" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-96000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-96000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-2225">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="163283" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-160000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-160000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-2225">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131284" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-128000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-mps-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-2225">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT887.833333333S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="368" mimeType="video/mp4" par="21:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501684" id="Sintel.2010.480p_reenc-avc1.42c01e-0s-848x368-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>Sintel.2010.480p_reenc-avc1.42c01e-0s-848x368-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="685-2852">
|
||||
<Initialization range="0-684"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.30" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="99283" id="sintel-master-51_48000_fixed-en-888s-6-mps-96000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-mps-96000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-2789">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="51285" id="sintel-master-51_48000_fixed-en-888s-6-mps-48000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-mps-48000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="617-2784">
|
||||
<Initialization range="0-616"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131283" id="sintel-master-51_48000_fixed-en-888s-6-mps-128000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-mps-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-2789">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="67283" id="sintel-master-51_48000_fixed-en-888s-6-mps-64000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-mps-64000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="617-2784">
|
||||
<Initialization range="0-616"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="163283" id="sintel-master-51_48000_fixed-en-888s-6-mps-160000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-mps-160000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="622-2789">
|
||||
<Initialization range="0-621"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-12T15:32:19Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H12M14.17S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/TearsOfSteel/OnDemand/MultiRes/TOS_OnDemand_HEVC_MultiRes.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.17S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="eng" subsegmentStartsWithSAP="1" contentType="video">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="588626">
|
||||
<BaseURL>tears_of_steel_288p_500k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1849-6296"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1207641">
|
||||
<BaseURL>tears_of_steel_432p_1000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-6297"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2496699">
|
||||
<BaseURL>tears_of_steel_720p_2000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-6297"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.1.6.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4996401">
|
||||
<BaseURL>tears_of_steel_1080p_4000k_H265_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1853-6300"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="eng" subsegmentStartsWithSAP="1" contentType="audio">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65203">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>tears_of_steel_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="849-5380">
|
||||
<Initialization range="0-848"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-16T09:35:00.413Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/tos_ondemand_multi_res_multi_rep_hvc/tos_720_Multirate_HEVC_ondemand.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.1.6.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="506712">
|
||||
<BaseURL>tos_288p_500k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="949-5396">
|
||||
<Initialization range="0-948"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.1.6.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1021513">
|
||||
<BaseURL>tos_432p_1000k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="924-5371">
|
||||
<Initialization range="0-923"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2068688">
|
||||
<BaseURL>tos_720p_2000k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="948-5395">
|
||||
<Initialization range="0-947"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hvc1.1.6.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4096493">
|
||||
<BaseURL>tos_1080p_4000k_H265_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="925-5372">
|
||||
<Initialization range="0-924"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="65928">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>tos_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="847-5294">
|
||||
<Initialization range="0-846"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-15T08:08:21.937Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash-if-main">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/5b_hev/tos_720_Multirate_HEVC_ondemand.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.2.4.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="500646">
|
||||
<BaseURL>tos_288p_500k_H265_10bit_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1911-6358">
|
||||
<Initialization range="0-1910"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.2.4.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="999733">
|
||||
<BaseURL>tos_432p_1000k_H265_10bit_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1912-6359">
|
||||
<Initialization range="0-1911"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.2.4.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1993305">
|
||||
<BaseURL>tos_720p_2000k_H265_10bit_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1915-6362">
|
||||
<Initialization range="0-1914"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.2.4.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="3960054">
|
||||
<BaseURL>tos_1080p_4000k_H265_10bit_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1916-6363">
|
||||
<Initialization range="0-1915"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="65928">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>tos_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="847-5294">
|
||||
<Initialization range="0-846"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-15T08:15:45.295Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash-if-main">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/5b_hvc/tos_720_Multirate_HEVC_ondemand.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.2.4.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="500758">
|
||||
<BaseURL>tos_288p_500k_H265_10bit_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="948-5395">
|
||||
<Initialization range="0-947"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.2.4.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="999844">
|
||||
<BaseURL>tos_432p_1000k_H265_10bit_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="948-5395">
|
||||
<Initialization range="0-947"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.2.4.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1993413">
|
||||
<BaseURL>tos_720p_2000k_H265_10bit_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="950-5397">
|
||||
<Initialization range="0-949"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hvc1.2.4.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="3960053">
|
||||
<BaseURL>tos_1080p_4000k_H265_10bit_hvc1_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="925-5372">
|
||||
<Initialization range="0-924"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="65928">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>tos_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="847-5294">
|
||||
<Initialization range="0-846"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-24T16:36:48Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H9M56.29S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/BigBuckBunny/2a/1/BBB_OnDemand_HEVC_MultiRes.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M56.29S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="und" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="368078">
|
||||
<BaseURL>bbb_288p_500k_H265_from1080p_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1798-5417"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1136564">
|
||||
<BaseURL>bbb_432p_1000k_H265_from1080p_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-5469"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2188852">
|
||||
<BaseURL>bbb_720p_2000k_H265_from1080p_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1850-5469"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.1.6.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4286337">
|
||||
<BaseURL>bbb_1080p_4000k_H265_from1080p_.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="1853-5472"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="und" subsegmentStartsWithSAP="1">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65606">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>bbb_64k_audio_init.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="849-4528">
|
||||
<Initialization range="0-848"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-12T19:18:56Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H12M14.17S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/TearsOfSteel/Live/MultiRes/TOS_Live_HEVC_MultiRes.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.17S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="eng" contentType="video">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="540936">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_288p_500k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1225260">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_432p_1000k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2520022">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_720p_2000k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.1.6.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="5000417">
|
||||
<SegmentTemplate timescale="12288" media="tears_of_steel_1080p_4000k_H265_$Number$.mp4" startNumber="1" duration="24514" initialization="TOS_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="eng" contentType="audio">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65432">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="tears_of_steel_64k_audio_$Number$.mp4" startNumber="1" duration="93948" initialization="tears_of_steel_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-16T09:27:04.475Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/tos_live_multi_res_multi_rep_hvc/tos_720_Multirate_HEVC_Live.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="und">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.1.6.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="506937">
|
||||
<SegmentTemplate timescale="24" media="tos_288p_500k_H265_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_288p_500k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.1.6.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1021737">
|
||||
<SegmentTemplate timescale="24" media="tos_432p_1000k_H265_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="tos_432p_1000k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="2068913">
|
||||
<SegmentTemplate timescale="24" media="tos_720p_2000k_H265_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_720p_2000k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hvc1.1.6.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4096717">
|
||||
<SegmentTemplate timescale="24" media="tos_1080p_4000k_H265_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="tos_1080p_4000k_H265_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="66152">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="tos_64k_audio_$Number$.mp4" startNumber="1" duration="95999" initialization="tos_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-15T14:58:29.691Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-main">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/tos_live_multi_res_multi_rep_10bit-hev/tos_720_Multirate_HEVC_Live.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="eng">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.2.4.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="500870">
|
||||
<SegmentTemplate timescale="12288" media="tos_288p_500k_H265_10bit_$Number$.mp4" startNumber="1" duration="24559" initialization="tos_288p_500k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.2.4.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="999957">
|
||||
<SegmentTemplate timescale="12288" media="tos_432p_1000k_H265_10bit_$Number$.mp4" startNumber="1" duration="24573" initialization="tos_432p_1000k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.2.4.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1993529">
|
||||
<SegmentTemplate timescale="12288" media="tos_720p_2000k_H265_10bit_$Number$.mp4" startNumber="1" duration="24556" initialization="tos_720p_2000k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.2.4.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="3960278">
|
||||
<SegmentTemplate timescale="12288" media="tos_1080p_4000k_H265_10bit_$Number$.mp4" startNumber="1" duration="24576" initialization="tos_1080p_4000k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="66152">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="tos_64k_audio_$Number$.mp4" startNumber="1" duration="95999" initialization="tos_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-15T08:25:16.217Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M14.167S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-main">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/7b_hvc/tos_720_Multirate_HEVC_Live.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H12M14.167S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="und">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.2.4.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="500982">
|
||||
<SegmentTemplate timescale="24" media="tos_288p_500k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_288p_500k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.2.4.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="1000068">
|
||||
<SegmentTemplate timescale="24" media="tos_432p_1000k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_432p_1000k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.2.4.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="1993637">
|
||||
<SegmentTemplate timescale="24" media="tos_720p_2000k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="47" initialization="tos_720p_2000k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hvc1.2.4.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="3960277">
|
||||
<SegmentTemplate timescale="24" media="tos_1080p_4000k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="tos_1080p_4000k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="66152">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="tos_64k_audio_$Number$.mp4" startNumber="1" duration="95999" initialization="tos_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-15T14:49:42.583Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H9M56.480S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-main">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/0/BBB_720_Multirate_HEVC_Live.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M56.480S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="eng">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.2.4.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="524393">
|
||||
<SegmentTemplate timescale="12288" media="bbb_288p_500k_H265_10bit_$Number$.mp4" startNumber="1" duration="24576" initialization="bbb_288p_500k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.2.4.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1043401">
|
||||
<SegmentTemplate timescale="12288" media="bbb_432p_1000k_H265_10bit_$Number$.mp4" startNumber="1" duration="24576" initialization="bbb_432p_1000k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.2.4.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2040171">
|
||||
<SegmentTemplate timescale="12288" media="bbb_720p_2000k_H265_10bit_$Number$.mp4" startNumber="1" duration="24576" initialization="bbb_720p_2000k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.2.4.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4076350">
|
||||
<SegmentTemplate timescale="12288" media="bbb_1080p_4000k_H265_10bit_$Number$.mp4" startNumber="1" duration="24576" initialization="bbb_1080p_4000k_H265_10bit_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="66163">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="bbb_64k_audio_$Number$.mp4" startNumber="1" duration="95998" initialization="bbb_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev710-g713274f-master at 2015-10-15T10:30:27.109Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H9M56.480S" maxSegmentDuration="PT0H0M2.005S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-main">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/Dashcontent/8_hvc/BBB_720_Multirate_HEVC_Live.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M56.480S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="1:1" lang="und">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hvc1.2.4.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="524392">
|
||||
<SegmentTemplate timescale="24" media="bbb_288p_500k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="bbb_288p_500k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hvc1.2.4.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1043400">
|
||||
<SegmentTemplate timescale="24" media="bbb_432p_1000k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="bbb_432p_1000k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hvc1.2.4.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2040171">
|
||||
<SegmentTemplate timescale="24" media="bbb_720p_2000k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="bbb_720p_2000k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hvc1.2.4.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4076349">
|
||||
<SegmentTemplate timescale="24" media="bbb_1080p_4000k_H265_10bit_hvc1_$Number$.mp4" startNumber="1" duration="48" initialization="bbb_1080p_4000k_H265_10bit_hvc1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" par="1:1" lang="eng">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="66163">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="bbb_64k_audio_$Number$.mp4" startNumber="1" duration="95998" initialization="bbb_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev91-g0930dfa-master on 2015-03-24T16:42:10Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H9M56.29S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-simple">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/var/www/DASH_HEVC_TestVectors/BigBuckBunny/2b/1/BBB_Live_HEVC_MultiRes.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M56.29S">
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="und">
|
||||
<Representation id="1" mimeType="video/mp4" codecs="hev1.1.6.L63.90" width="512" height="288" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="371875">
|
||||
<SegmentTemplate timescale="12288" media="bbb_288p_500k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="video/mp4" codecs="hev1.1.6.L90.90" width="768" height="432" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1140569">
|
||||
<SegmentTemplate timescale="12288" media="bbb_432p_1000k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="hev1.1.6.L93.90" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2192857">
|
||||
<SegmentTemplate timescale="12288" media="bbb_720p_2000k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="hev1.1.6.L120.90" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="4290354">
|
||||
<SegmentTemplate timescale="12288" media="bbb_1080p_4000k_H265_from1080p_$Number$.mp4" startNumber="1" duration="24505" initialization="BBB_Live_HEVC_MultiRes_set1_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" lang="und">
|
||||
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.29" audioSamplingRate="48000" startWithSAP="1" bandwidth="65834">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<SegmentTemplate timescale="48000" media="bbb_64k_audio_$Number$.mp4" startNumber="1" duration="94089" initialization="bbb_64k_audio_init.mp4"/>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated Sat Jun 01 21:01:10 2013 by Dolby Media Generator, Version 2013May16.160953 -->
|
||||
<MPD
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dolby="http://www.dolby.com/ns/online/DASH"
|
||||
xmlns="urn:mpeg:dash:schema:mpd:2011"
|
||||
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011"
|
||||
type="static"
|
||||
mediaPresentationDuration="PT0H0M30.030S"
|
||||
minBufferTime="PT1.2S"
|
||||
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
|
||||
|
||||
<BaseURL>./</BaseURL>
|
||||
|
||||
<Period>
|
||||
<!-- Video -->
|
||||
<AdaptationSet mimeType="video/mp4" codecs="avc1.42801e" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" bandwidth="517528" width="640" height="480">
|
||||
<BaseURL>ChID_voices_20_128_ddp_V.mp4</BaseURL>
|
||||
<SegmentBase indexRange="742-953">
|
||||
<Initialization range="0-741"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Audio -->
|
||||
<AdaptationSet mimeType="audio/mp4" codecs="ec-3" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="2" bandwidth="128000">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:dolby:dash:audio_channel_configuration:2011" value="A000"/>
|
||||
<BaseURL>ChID_voices_20_128_ddp_A.mp4</BaseURL>
|
||||
<SegmentBase indexRange="603-766">
|
||||
<Initialization range="0-602"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT653.696S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="480" mimeType="video/mp4" par="16:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="854">
|
||||
<Representation bandwidth="1501684" id="ED_SD_480p_reenc-avc1.42c01e-0s-854x480-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>ED_SD_480p_reenc-avc1.42c01e-0s-854x480-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="686-2289">
|
||||
<Initialization range="0-685"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.5" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="323283" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-320000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-320000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2212">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="195289" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-192000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-192000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2212">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131291" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-128000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2212">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="70295" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-67000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-67000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2212">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="163291" id="ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-160000bps_seg">
|
||||
<BaseURL>ED-CM-5.1-DVD_length_fixed-en-653s-6-heaac-160000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2212">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT887.850666667S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="368" mimeType="video/mp4" par="21:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501684" id="Sintel.2010.480p_reenc-avc1.42c01e-0s-848x368-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>Sintel.2010.480p_reenc-avc1.42c01e-0s-848x368-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="685-2852">
|
||||
<Initialization range="0-684"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.5" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="163288" id="sintel-master-51_48000_fixed-en-888s-6-heaac-160000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-heaac-160000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131288" id="sintel-master-51_48000_fixed-en-888s-6-heaac-128000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-heaac-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="195287" id="sintel-master-51_48000_fixed-en-888s-6-heaac-192000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-heaac-192000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="70291" id="sintel-master-51_48000_fixed-en-888s-6-heaac-67000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-heaac-67000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="323283" id="sintel-master-51_48000_fixed-en-888s-6-heaac-320000bps_seg">
|
||||
<BaseURL>sintel-master-51_48000_fixed-en-888s-6-heaac-320000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
Vendored
-47
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<MPD mediaPresentationDuration="PT887.850666667S" minBufferTime="PT2S" profiles="http://dashif.org/guidelines/dash264,urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
|
||||
<BaseURL>./</BaseURL>
|
||||
<Period>
|
||||
<AdaptationSet codecs="avc1.42c01e" contentType="video" frameRate="24/1" height="368" mimeType="video/mp4" par="21:9" scanType="progressive" subsegmentAlignment="true" subsegmentStartsWithSAP="1" width="848">
|
||||
<Representation bandwidth="1501684" id="Sintel.2010.480p_reenc-avc1.42c01e-0s-848x368-h264-1500000bps_seg" sar="1:1">
|
||||
<BaseURL>Sintel.2010.480p_reenc-avc1.42c01e-0s-848x368-h264-1500000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="685-2852">
|
||||
<Initialization range="0-684"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet codecs="mp4a.40.5" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="12"/>
|
||||
<Representation audioSamplingRate="48000" bandwidth="259290" id="sintel_71_48_fixed-en-888s-8-heaac-256000bps_seg">
|
||||
<BaseURL>sintel_71_48_fixed-en-888s-8-heaac-256000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="451283" id="sintel_71_48_fixed-en-888s-8-heaac-448000bps_seg">
|
||||
<BaseURL>sintel_71_48_fixed-en-888s-8-heaac-448000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="131294" id="sintel_71_48_fixed-en-888s-8-heaac-128000bps_seg">
|
||||
<BaseURL>sintel_71_48_fixed-en-888s-8-heaac-128000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="323288" id="sintel_71_48_fixed-en-888s-8-heaac-320000bps_seg">
|
||||
<BaseURL>sintel_71_48_fixed-en-888s-8-heaac-320000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation audioSamplingRate="48000" bandwidth="195290" id="sintel_71_48_fixed-en-888s-8-heaac-192000bps_seg">
|
||||
<BaseURL>sintel_71_48_fixed-en-888s-8-heaac-192000bps_seg.mp4</BaseURL>
|
||||
<SegmentBase indexRange="609-2776">
|
||||
<Initialization range="0-608"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" maxSubsegmentDuration="PT5.0S" mediaPresentationDuration="PT9M57S" minBufferTime="PT5.0S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://xmlns.sony.net/metadata/mpeg/dash/profile/senvu/2012" type="static" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd">
|
||||
<Period duration="PT9M57S" id="P1">
|
||||
<!-- Adaptation Set for main audio -->
|
||||
<AdaptationSet audioSamplingRate="48000" codecs="mp4a.40.5" contentType="audio" group="2" id="2" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
|
||||
<Representation bandwidth="64000" id="2_1">
|
||||
<BaseURL>DASH_vodaudio_Track7.m4a</BaseURL>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Adaptation Set for main audio -->
|
||||
<AdaptationSet audioSamplingRate="48000" codecs="mp4a.40.5" contentType="audio" group="2" id="3" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="6"/>
|
||||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
|
||||
<Representation bandwidth="128000" id="3_2">
|
||||
<BaseURL>DASH_vodaudio_Track8.m4a</BaseURL>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Adaptation Set for video -->
|
||||
<AdaptationSet contentType="video" frameRate="24000/1001" group="1" id="1" maxBandwidth="4276224" maxHeight="1080" maxWidth="1920" maximumSAPPeriod="5.0" mimeType="video/mp4" minBandwidth="704512" minHeight="180" minWidth="320" par="16:9" sar="1:1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
|
||||
<Representation bandwidth="704512" codecs="avc1.4D401E" height="180" id="1_1" mediaStreamStructureId="1" width="320">
|
||||
<BaseURL>DASH_vodvideo_Track6.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="2011136" codecs="avc1.4D4028" height="720" id="1_2" mediaStreamStructureId="1" width="1280">
|
||||
<BaseURL>DASH_vodvideo_Track3.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="3018752" codecs="avc1.4D4028" height="900" id="1_3" mediaStreamStructureId="1" width="1600">
|
||||
<BaseURL>DASH_vodvideo_Track2.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="1005568" codecs="avc1.4D401E" height="360" id="1_4" mediaStreamStructureId="1" width="640">
|
||||
<BaseURL>DASH_vodvideo_Track5.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="4276224" codecs="avc1.4D4028" height="1080" id="1_5" mediaStreamStructureId="1" width="1920">
|
||||
<BaseURL>DASH_vodvideo_Track1.m4v</BaseURL>
|
||||
</Representation>
|
||||
<Representation bandwidth="1609728" codecs="avc1.4D401E" height="480" id="1_6" mediaStreamStructureId="1" width="854">
|
||||
<BaseURL>DASH_vodvideo_Track4.m4v</BaseURL>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated Sat Jun 01 21:43:09 2013 by Dolby Media Generator, Version 2013May16.160953 -->
|
||||
<MPD
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dolby="http://www.dolby.com/ns/online/DASH"
|
||||
xmlns="urn:mpeg:dash:schema:mpd:2011"
|
||||
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011"
|
||||
type="static"
|
||||
mediaPresentationDuration="PT0H0M30.030S"
|
||||
minBufferTime="PT1.2S"
|
||||
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
|
||||
|
||||
<BaseURL>./</BaseURL>
|
||||
|
||||
<Period>
|
||||
<!-- Video -->
|
||||
<AdaptationSet mimeType="video/mp4" codecs="avc1.42801e" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" bandwidth="523520" width="640" height="480">
|
||||
<BaseURL>ChID_voices_71_384_448_768_ddp_V.mp4</BaseURL>
|
||||
<SegmentBase indexRange="742-953">
|
||||
<Initialization range="0-741"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<!-- Audio -->
|
||||
<AdaptationSet mimeType="audio/mp4" codecs="ec-3" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="2" bandwidth="384000">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:dolby:dash:audio_channel_configuration:2011" value="FA01"/>
|
||||
<BaseURL>ChID_voices_71_384_448_768_ddp_A_2.mp4</BaseURL>
|
||||
<SegmentBase indexRange="604-767">
|
||||
<Initialization range="0-603"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="3" bandwidth="448000">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:dolby:dash:audio_channel_configuration:2011" value="FA01"/>
|
||||
<BaseURL>ChID_voices_71_384_448_768_ddp_A_3.mp4</BaseURL>
|
||||
<SegmentBase indexRange="604-767">
|
||||
<Initialization range="0-603"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="4" bandwidth="768000">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:dolby:dash:audio_channel_configuration:2011" value="FA01"/>
|
||||
<BaseURL>ChID_voices_71_384_448_768_ddp_A_4.mp4</BaseURL>
|
||||
<SegmentBase indexRange="604-767">
|
||||
<Initialization range="0-603"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev147-gdd95895-master on 2015-03-25T19:11:24Z-->
|
||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H9M8.38S" maxSegmentDuration="PT0H0M2.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011, http://dashif.org/guidelines/dash264">
|
||||
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
|
||||
<Title>/home/grutz/mse-eme/dash/dash.mpd generated by GPAC</Title>
|
||||
</ProgramInformation>
|
||||
|
||||
<Period duration="PT0H9M8.38S">
|
||||
<AdaptationSet segmentAlignment="true" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="129970">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>audio_aac-lc_128k_dashinit.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="847-4202">
|
||||
<Initialization range="0-846"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="193971">
|
||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||
<BaseURL>audio_aac-lc_192k_dashinit.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="847-4202">
|
||||
<Initialization range="0-846"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="30" par="16:9" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||
<Accessibility schemeIdUri="urn:scte:dash:cc:cea-608:2015"/>
|
||||
<Representation id="3" mimeType="video/mp4" codecs="avc1.64001f" width="896" height="504" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="1200813">
|
||||
<BaseURL>content_cc_1200_dashinit.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="876-4195">
|
||||
<Initialization range="0-875"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="4" mimeType="video/mp4" codecs="avc1.640020" width="1280" height="720" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="2247439">
|
||||
<BaseURL>content_cc_2250_dashinit.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="875-4194">
|
||||
<Initialization range="0-874"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="5" mimeType="video/mp4" codecs="avc1.4d401e" width="512" height="288" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="350486">
|
||||
<BaseURL>content_cc_350_dashinit.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="868-4187">
|
||||
<Initialization range="0-867"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
<Representation id="6" mimeType="video/mp4" codecs="avc1.4d401e" width="704" height="396" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="598486">
|
||||
<BaseURL>content_cc_600_dashinit.mp4</BaseURL>
|
||||
<SegmentBase indexRangeExact="true" indexRange="869-4188">
|
||||
<Initialization range="0-868"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>
|
||||
</Period>
|
||||
</MPD>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user