[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115352":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":42,"updatedAt":43,"readmeContent":44,"aiSummary":45,"trendingCount":16,"starSnapshotCount":16,"syncStatus":46,"lastSyncTime":47,"discoverSource":48},115352,"pydtcpip","tsukumijima\u002Fpydtcpip","tsukumijima","Unofficial Python implementation of DTCP-IP with DLNA\u002FUPnP support","https:\u002F\u002Fpypi.org\u002Fproject\u002Fpydtcpip\u002F",null,"Python",79,16,3,4,0,1,19,8,57.09,"MIT License",false,"master",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"arib","dlna","dlna-server","dlna-upnp","dtcp","dtcp-ip","dtv","dvr","isdb","media","mpeg-ts","mpegts","pvr","python","recorder","upnp","2026-11-20 11:32:59","2026-11-23 18:43:00","\u003C!-- omit in toc -->\n# pydtcpip - Unofficial Python implementation of DTCP-IP with DLNA\u002FUPnP support\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fpydtcpip?color=blue)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fpydtcpip\u002F)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fpydtcpip)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fpydtcpip\u002F)\n[![ci](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Factions\u002Fworkflows\u002Fci.yml)\n\n**pydtcpip is an open-source, cross-platform Python library that can transfer broadcast recordings stored on Japanese home TVs and BD \u002F HDD recorders to a PC using DLNA \u002F UPnP \u002F DTCP-IP.**\n\nIt can handle the entire process from device discovery and recording listings to mutual authentication, decryption, Move transfers, listening for incoming dubbing transfers, and streaming reception.  \nTransfer quality is set to lossless by default, allowing recordings to be received without re-encoding at the quality stored on the recording device (preserving the broadcast MPEG-2 format for recordings in DR (Direct Recording) mode).  \nThe library itself is designed as an asynchronous (asyncio) library for integration into applications, and it also includes a reference CLI implementation (`pydtcpip`) for operation checks and research.\n\nThe publicly available partial DTCP-IP specifications (Informational Version) omit the cryptographic parameters and details of some functions needed for implementation, and **for more than 20 years since the specification was established, there had been no open-source implementation that integrated DLNA \u002F UPnP discovery, mutual authentication, decryption, and Move.**\n\npydtcpip is a foundation library for recovering broadcast recordings from aging recording devices and continuing to archive them as the industry as a whole declines, and it also serves as research material that clarifies the technical details of DLNA \u002F DTCP-IP implementations in Japanese recording devices and DTCP-IP-compatible remote viewing applications.\n\n> [!NOTE]  \n> **This project is an independent, unofficial implementation, separate from manufacturers' official software.**  \n> It has no affiliation, endorsement, or certification relationship with the licensing administrator (DTLA), other standards organizations, or device manufacturers.  \n> The source code license does not grant third-party patent or trademark licenses relating to DTCP-IP or other technologies, nor does it provide any warranty of non-infringement.\n\n- [Main features](#main-features)\n- [Supported devices](#supported-devices)\n  - [Model-specific notes](#model-specific-notes)\n  - [Family profiles](#family-profiles)\n- [Installation](#installation)\n- [Using the reference CLI implementation](#using-the-reference-cli-implementation)\n  - [1. Preparing credentials](#1-preparing-credentials)\n  - [2. Checking recording devices and program information](#2-checking-recording-devices-and-program-information)\n  - [3. Saving recordings from a PC through Move transfers](#3-saving-recordings-from-a-pc-through-move-transfers)\n  - [4. Browsing recorders and moving recordings interactively](#4-browsing-recorders-and-moving-recordings-interactively)\n  - [5. Streaming playback](#5-streaming-playback)\n  - [6. Receiving recordings as a dubbing destination](#6-receiving-recordings-as-a-dubbing-destination)\n  - [7. Running without interaction](#7-running-without-interaction)\n  - [8. Firewall and network settings](#8-firewall-and-network-settings)\n- [Using pydtcpip as a Python library](#using-pydtcpip-as-a-python-library)\n- [Received data format and metadata](#received-data-format-and-metadata)\n- [Device-specific behavior and contributing to compatibility](#device-specific-behavior-and-contributing-to-compatibility)\n- [Research material](#research-material)\n  - [Why recordings need to be recovered from devices now](#why-recordings-need-to-be-recovered-from-devices-now)\n  - [What is DTCP-IP?](#what-is-dtcp-ip)\n    - [The relationship between UPnP \u002F DLNA and DTCP-IP, and the structure shared with mTLS](#the-relationship-between-upnp--dlna-and-dtcp-ip-and-the-structure-shared-with-mtls)\n    - [Structural correspondence with B-CAS \u002F ARIB STD-B25 decryption](#structural-correspondence-with-b-cas--arib-std-b25-decryption)\n  - [Implemented specifications and design principles](#implemented-specifications-and-design-principles)\n  - [Structural issues in the protection model revealed by research](#structural-issues-in-the-protection-model-revealed-by-research)\n    - [What mutual authentication proves and the boundary after decryption](#what-mutual-authentication-proves-and-the-boundary-after-decryption)\n    - [Clients for general-purpose operating systems and types of online key distribution](#clients-for-general-purpose-operating-systems-and-types-of-online-key-distribution)\n    - [Can revocation lists (SRMs) be operated effectively?](#can-revocation-lists-srms-be-operated-effectively)\n    - [The spread of LLM agents and the limits of protection through secrecy](#the-spread-of-llm-agents-and-the-limits-of-protection-through-secrecy)\n  - [Summary](#summary)\n- [License](#license)\n\n## Main features\n\n- **Asynchronous Python library (`DLNAClient`, `DTCPClient`, `DubbingReceiver`)**: DTCP-IP reception can be integrated into any Python application through Pydantic models and type-safe events\n- **Home device discovery and metadata retrieval**: Discovery of recording devices (DLNA media servers) through SSDP, and retrieval of program information and copy control information by browsing directories (reference CLI implementation: `discover` \u002F `info`)\n- **Client-initiated Move transfers (copying and moving under Dubbing 10 (ダビング10))**: Implements mutual authentication, decryption, finalization (`FINALIZE`) after persisting the destination data, and completion (`COMPLETE`), with the ability to resume finalization alone after a disconnection without receiving the data again (`move` \u002F `resume`)\n- **Interactive interface combining discovery, program information and Move transfers**: The functions of `discover`, `info`, `move` and `resume` on one screen, showing recorders, folders, program information, qualities, sizes and copy counts side by side and moving several selected recordings in sequence (`tui`)\n- **Streaming reception without consuming the copy count**: Data delivery with backpressure control through asynchronous callbacks, and transfer to FFplay or similar tools through standard output (`stream`)\n- **Listening for incoming dubbing transfers as a DTCP-IP-compatible NAS**: Reception of recordings and program information from TVs and recorders that have no streaming functionality and only support push dubbing started from the device's own menu (送り出しダビング) (`receive`)\n- **Diagnostic data export**: Export of protocol responses from unsupported models with identifying information and program titles masked for troubleshooting and pull requests (`dump --mask-private`)\n\nTransfers select the main recording in its stored quality, using `DLNA.ORG_CI` and family-specific metadata to distinguish it from converted and mobile versions. An AVC or nasne three-times recording is transferred in that recorded format; original quality does not require DR mode. Dedicated Move resources are preferred for dubbing and excluded from streaming selection, including explicit selection with `--resource`.\n\n`info` numbers resources in the order advertised by the device, identifies the default streaming and Move selections, and distinguishes the main recording from converted or mobile versions. It displays device-provided mode names when available, together with reported resolution, codec and bitrate, such as `1280x720 (AVC \u002F 3 Mbps)`. If the device supplies insufficient information, the CLI warns that the selected resource's quality is unknown.\n\nTo select a resource explicitly, pass its number from `info` as `--resource N` to `stream` or `move` for the same recording. Alternatively, pass its URL to `stream URL` or `move recording.m2ts --url URL`. Resource numbers and direct URLs are mutually exclusive; `--resource` cannot be combined with a URL.\n\n## Supported devices\n\n**The table distinguishes discovery and metadata retrieval from successful media transfers.**  \n“Verified” denotes maintainer testing; “Reported” denotes community testing linked from the model name. “Unverified” means that no successful test of that operation has been recorded, rather than that the device is incompatible.\n\nModels are grouped in the order nasne, REGZA TVs, REGZA Blu-ray recorders, Panasonic, Sony, and Sharp, with older models first within each group; Sony and Buffalo nasne models are grouped together as one series.\n\n| Model \u002F report | Discovery | Recording listings | Streaming (non-Move) | Move | Push dubbing reception |\n| --- | --- | --- | --- | --- | --- |\n| [Sony nasne CECH-ZNR1J](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F3) | Reported | Reported | Unverified | Unverified | Not supported |\n| [Sony nasne (model unspecified)](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F16) | Reported (API) | Reported (API) | Reported (DR and 3x, API) | Unverified | Unverified |\n| [Buffalo nasne NS-N100](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F4) | Reported ([see note](#model-specific-notes)) | Reported | Unverified | Unverified | Not supported |\n| Toshiba REGZA 43Z570L | Verified | Verified | Verified | Refused to start | Verified |\n| [Toshiba REGZA 43M550M](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F8) | Reported | Reported | Unverified | Unverified | Unverified |\n| Toshiba DBR-Z620 | Verified | Verified | Verified | Verified | Verified |\n| [Panasonic VIERA TH-65LX950](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F14) | Reported | Reported | [Reported](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F14#issuecomment-6946179349) | Connection closed at start | Reported |\n| [Panasonic DMR-BXT3000](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F7) | Reported | Reported | Unverified | Unverified | Unverified |\n| [Panasonic DMR-BRX\u002FBCX2060](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F6) | Reported | Reported | [Full recording saved](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F11) | Unverified | Unverified |\n| [Panasonic DMR-BRW1060 \u002F BCW1060](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F20) | Reported | Protected folders need DTCP-IP authentication ([see note](#model-specific-notes)) | Unverified | Unverified | Unverified |\n| [Panasonic DMR-2W101](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F11) | External script only | Reported (API) | Full recording saved | Unverified | Unverified |\n| [Panasonic DIGA DMR-4TS204S](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F15) | Reported | Reported | Unverified | Unverified | Unverified |\n| [Sony BDZ-ZW1500](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F2) | Reported | Reported | Reported (10 seconds) | Unverified | Unverified |\n| [Sony BDZ-FBT2200](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F12) | Unverified | Reported (API) | Reported | Unverified | Unverified |\n| [Sony PC TV Plus](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F13) | Unverified | Reported with fresh connections | Reported (full recordings, API) | Unverified | Unverified |\n| [Sharp AQUOS BD-W2700](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F1) | Reported | Reported | Unverified | Unverified | Unverified |\n\nIf discovery fails on Windows, select your PC's LAN address with `--interface`.\n\n### Model-specific notes\n\n- **Sony and Buffalo nasne**\n  - Start transfers from the PC.  \n    The [nasne HOME migration feature](https:\u002F\u002Fwww.buffalo.jp\u002Fs3\u002Fguide\u002Fns-n100\u002F04\u002Fja\u002Frecorder\u002Fdubbing.html) requires the destination nasne to start the transfer.\n- **Buffalo nasne NS-N100**\n  - If the nasne stops answering discovery requests, run `pydtcpip discover --timeout 35` to give its periodic announcements time to arrive.  \n    The TUI listens for these announcements in the background and lists the initial search results as soon as they are ready.\n  - If the nasne disappears from discovery even with the correct `--interface`, it may still be reachable by its device description URL.  \n    Pass the URL to `info --server`.  \n    In the TUI, press `+` and enter the URL.  \n    See the reports for [Windows](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F4#issuecomment-6931358437) and [macOS](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Fpydtcpip\u002Fissues\u002F17).\n  - Copy-controlled recordings received through nasne HOME migration have only the final Move available.  \n    pydtcpip displays `Copies remaining: 0` for these recordings because the count excludes that final Move.  \n    A successful final Move deletes the recording from the source nasne.\n- **REGZA TVs**\n  - For the 43Z570L, run `receive` on the PC and start dubbing from the TV.  \n    In testing, the TV refused to start a Move initiated from the PC.\n  - Other REGZA TV models may also support only dubbing initiated from the TV.\n- **Panasonic DMR-BRW1060 \u002F BCW1060**\n  - The folder structure, photos, music and tuner channels list without credentials, but the recorded-programme folders (`AV_ALL` and similar) return a client authorization error (UPnP 720).  \n    Enabling home streaming (お部屋ジャンプリンク) and permitting this PC in the recorder's connected-device list did not clear it; the recorder lists its protected recordings only to a DTCP-IP-authenticated client, so configure DTCP-IP credentials to browse them. `dump` continues past the blocked folders and records the refusal.\n- **Panasonic DIGA DMR-4TS204S**\n  - If `info` lists only converted resources for a recording, choose a resource number from that list.  \n    Pass it to `stream` or `move` as `--resource N` for the same recording.\n- **Sony PC TV Plus**\n  - `DLNAClient()` opens a fresh TCP connection for each SOAP request.  \n    A caller-supplied `aiohttp.ClientSession` keeps its own connector settings.  \n    Set `aiohttp.TCPConnector(force_close=True)` on that session for PC TV Plus.\n\n### Family profiles\n\nDetails of the implemented specification scope and design principles are summarized in [Implemented specifications and design principles](#implemented-specifications-and-design-principles) later in this document.\n\n**Family profiles provide the metadata support listed below; transfer results are recorded separately in the table above.**  \nProfiles marked as unverified in the CLI still require hardware validation of their family-specific parsing and optional queries. A successful basic transfer on a model does not verify every feature of its profile.\n\nAll profiles retain standard recording metadata, media resource attributes and device-provided extension fields. The table lists additional interpretation and queries; fields and services must be supplied by the device to be available.\n\n| Family | Profile | Metadata support |\n| --- | --- | --- |\n| Sony \u002F Buffalo nasne | `nasne` | Copy counts, extended recording details, thumbnails, estimated chapter positions, and identification of DR, three-times and mobile versions and Move resources |\n| Toshiba \u002F TVS REGZA TVs | `toshiba_regza_tv` | Toshiba metadata support below, plus broadcast network and service IDs available only in recording listings |\n| Toshiba \u002F REGZA recorders | `toshiba` | Copy counts, frame rates, chapter queries and USB drive names from recording folders |\n| Panasonic DIGA \u002F VIERA | `panasonic` | Resource copy counts, chapters, recording-mode names, and identification of converted resources from URLs, HD\u002FVGA references and alternative resource elements |\n| Sony BDZ | `sony_bdz` | Copy counts, chapters, recording details, actual recording start, storage information and identification of main and mobile recording versions |\n| Sony PC TV Plus | `sony_pctv` | Copy counts from Sony metadata |\n| Sharp AQUOS | `sharp` | Copy counts and chapters; recording-mode and other Sharp fields retained as extension metadata |\n| I-O DATA REC-ON | `recon` | Resource copy counts, chapters through an advertised tag action and recording details from compatible services |\n| I-O DATA RECBOX | `recbox` | Sony, Toshiba, Sharp and Panasonic copy counts, plus Sony, Sharp and Panasonic chapters retained by the server |\n| Buffalo LinkStation | `linkstation` | Sony, Toshiba, Sharp and Panasonic copy counts, plus Sony, Sharp and Panasonic chapters retained by the server |\n| Cable \u002F satellite set-top boxes | `stb` | Resource copy counts, advertised chapter tags and compatible recording-detail services |\n| Compatible Hikari TV boxes | `stb_hikaritv` | Set-top box metadata and the dedicated recording container |\n| STW2000 | `stb_stw2000` | Set-top box metadata and the STW2000 recording container |\n| AM900 | `stb_am900` | Set-top box metadata and the AM900 recording container |\n| Standard DLNA servers | `generic` | Standard recording and resource metadata, with device-provided extension fields retained without family-specific interpretation |\n\n> [!IMPORTANT]  \n> **DTCP-IP itself is a standard that defines mutual authentication and encrypted transfer, while recording listings and protection information are exchanged through DLNA \u002F UPnP at the preceding stage.**  \n> However, **the details of this preceding stage depend heavily on manufacturer- and model-specific extensions; for example, even the field names for the remaining Dubbing 10 copy count are not standardized across manufacturers.** Even commercial recorders frequently encounter interoperability problems with each other.  \n> For this reason, models not listed above may work as they are, or they may require additional support.\n> \n> pydtcpip isolates these device-dependent behaviors in library modules called \"profiles\" so that issues specific to a particular recording device can be addressed easily without affecting other recording devices.  \n> **If pydtcpip does not work with your TV or recorder, please see [Device-specific behavior and contributing to compatibility](#device-specific-behavior-and-contributing-to-compatibility) below to fix device support on your hardware and submit a pull request.**\n\n## Installation\n\nPython 3.13 or later is required.  \nPlease install it with [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) or pip.\n\n```bash\n# To install with the CLI\n$ uv tool install pydtcpip\n\n# Alternatively, with pip\n$ pip install pydtcpip\n```\n\nTo integrate it as a library into another project, you can add it with `uv add pydtcpip` (for projects using uv).  \nTo develop or run it from source, run `uv sync` in the repository, then launch it with `uv run pydtcpip --help`.\n\n## Using the reference CLI implementation\n\npydtcpip itself is an asynchronous Python library for integration into applications.  \nThe bundled `pydtcpip` command was developed as a reference implementation for operation checks and research, with the aim of checking connectivity to real devices and validating the protocol.  \nIt implements the functions needed to transfer recorded data, including an interactive interface that combines device discovery, program information and Move transfers, a progress bar showing transfer progress, and a resume function for interrupted transfers.\n\n### 1. Preparing credentials\n\n> [!IMPORTANT]  \n> **Receiving recordings requires a DTCP device certificate (88 bytes) and its corresponding per-device private key (20 bytes).**  \n> This package provides only the protocol implementation and does not include a device certificate or per-device private key. Please prepare your own credentials.\n\nWhen using the CLI, placing `credentials.env` once in the default data directory for your OS is convenient.  \nIt is loaded automatically at startup, so you do not need to specify the file every time you run a command.\n\n| OS | Default data directory |\n| --- | --- |\n| Linux and others | `$XDG_DATA_HOME\u002Fpydtcpip\u002F` (`~\u002F.local\u002Fshare\u002Fpydtcpip\u002F` if unset) |\n| macOS | `~\u002FLibrary\u002FApplication Support\u002Fpydtcpip\u002F` |\n| Windows | `%APPDATA%\\pydtcpip\\` (`C:\\Users\\\u003Cusername>\\AppData\\Roaming\\pydtcpip`) |\n\nEnter the following two items in `credentials.env` as hexadecimal strings.\n\n```dotenv\nPYDTCPIP_CERTIFICATE=device_certificate_as_a_hexadecimal_string\nPYDTCPIP_PRIVATE_KEY=per_device_private_key_as_a_hexadecimal_string\n```\n\nYou can also specify them through environment variables with the same names (`PYDTCPIP_CERTIFICATE`, `PYDTCPIP_PRIVATE_KEY`), and **environment variable values take precedence over the file**.  \nBecause the file contains a private key, restrict its read and write permissions to your own user account (`chmod 600` on Linux \u002F macOS).\n\nTo specify another file, use the `--credentials` (`-c`) option; to change the entire storage directory, specify `--data-dir` before the subcommand.\n\n```bash\n$ pydtcpip move recording.m2ts --credentials \u002Fpath\u002Fto\u002Fcredentials.env\n$ pydtcpip --data-dir \u002Fpath\u002Fto\u002Fdevice-data move recording.m2ts\n```\n\n> [!TIP]  \n> **SRM (System Renewability Message)** is a device certificate revocation list signed by DTLA.  \n> After initially authenticating with SRM version 0, pydtcpip automatically saves a newer SRM received from the connected recording device as `srm.bin` in the default data directory or the directory specified with `--data-dir`.  \n> On subsequent connections, it uses the saved `srm.bin` for mutual authentication with the recording device.  \n> For this reason, you do not need to prepare an SRM in advance to use pydtcpip.\n\n### 2. Checking recording devices and program information\n\nConnect your PC to the same home network as the recording device and run discovery.  \nIf you omit the device URL or recording ID, a table of entries appears in the terminal, and you can select an entry by number.\n\n```bash\n# List recording devices on the home network and their device description URLs\n$ pydtcpip discover\n                                                  Recorders\n┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Name          ┃ Manufacturer      ┃ Model   ┃ Profile          ┃ Device description URL                    ┃\n┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n│ REGZA-43Z570L │ TOSHIBA TVS REGZA │ 43Z570L │ toshiba_regza_tv │ http:\u002F\u002F192.168.1.73:20003\u002Fdescription.xml │\n│ DBR-Z620      │ TOSHIBA           │ DBRZ6   │ toshiba          │ http:\u002F\u002F192.168.1.44:55247\u002Fdms\u002F            │\n└───────────────┴───────────────────┴─────────┴──────────────────┴───────────────────────────────────────────┘\n```\n\nRun `pydtcpip info` to select a recorder and recording interactively, or specify both directly as below. This example uses synthetic recording metadata; the available fields and quality options depend on the device.\n\n```text\n$ pydtcpip info --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id V_42 --basic\nProfile: generic\n                                 Example recording\n┌───────────────────────────────────────────────┬─────────────────────────────────┐\n│ ID                                            │ V_42                            │\n│ Date                                          │ 2026-01-01T20:00:00+09:00       │\n│ Duration                                      │ 0:30:00.000                     │\n│ Channel                                       │ Example channel                 │\n│ Copies remaining (recording metadata)         │ Unsupported format              │\n│ Selected resource Move support (protocolInfo) │ Yes                             │\n│ Transfer copy control                         │ Available after transfer starts │\n│ Resource 1                                    │ 1920x1080 (MPEG-2 \u002F 18 Mbps)    │\n│ Resource 1: Recording version                 │ Original recording              │\n│ Resource 1: DLNA.ORG_PN                       │ DTCP_MPEG_TS_JP_T               │\n│ Resource 1: Default selection                 │ Streaming, Move                 │\n│ Resource 1: Duration                          │ 0:30:00.000                     │\n│ Resource 2                                    │ 1280x720 (AVC \u002F 3 Mbps)         │\n│ Resource 2: Recording version                 │ Converted or mobile version     │\n│ Resource 2: DLNA.ORG_PN                       │ DTCP_AVC_TS_JP_AAC_T            │\n│ Resource 2: Duration                          │ 0:30:00.000                     │\n└───────────────────────────────────────────────┴─────────────────────────────────┘\n```\n\n`info` also displays scheduled broadcast times, video\u002Faudio information, original copy-count values and available chapters. Sony-compatible services and nasne can supply additional recording details.  \nOptional queries run by default; a failed query is reported while the available program information remains visible. Use `--basic` to read only the ordinary listing, or `--json` to export the collected metadata, source responses and query statuses.\n\n```bash\npydtcpip info --basic\npydtcpip info --json --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id RECORDING_ID\n```\n\nFinite copy counts are displayed excluding the final Move: a device count of 10 becomes nine copies, and a count of 1 means only the final Move remains.  \nThe original field and value are also retained. Missing values remain unknown, and unlimited-copy markers are kept separate from finite counts.\n\n### 3. Saving recordings from a PC through Move transfers\n\n**The `move` subcommand connects to the recording device as a client and saves the entire recording through a GET Move operation.**  \nThis method is completed entirely through operations on the PC (client), without requiring remote control operations on the recording device.  \n\n```bash\n$ pydtcpip move recording.m2ts\n```\n\nTo choose a different quality, inspect the same recording with `info`, then pass its resource number. For example, `pydtcpip move recording.m2ts --resource 2` uses resource 2 after interactive recording selection. Omit `--resource` to use the default stored recording.\n\nRecordings that the device reports as protected (`upnp:writeStatus` is `PROTECTED`) are not moved; release the protection on the recording device first.  \nIf the device refuses to start a Move, for example while it is recording, `move` fails before any data is transferred and no copy is consumed; try again later.\n\n> [!NOTE]  \n> **Some recording device models do not store program information or time information in the SIT (Selection Information Table) of MPEG2-TS recordings (partial TS).**  \n> This information generally appears to be stored in recordings made on REGZA TVs.\n> \n> **The CLI saves program information as XML and JSON sidecars before transferring the recording.**  \n> For `recording.m2ts`, these files are `recording.xml` and `recording.metadata.json` in the same directory. The JSON also contains available chapters, additional recording details and their acquisition status.  \n> The available information depends on the device; see [Received data format and metadata](#received-data-format-and-metadata) for the contents of each file.\n\n> [!WARNING]  \n> **A Move operation consumes one copy from the source's copy count.**  \n> Before a Move operation runs, a confirmation screen appears together with the recording title and the remaining copy count.  \n> For recordings with no copies remaining and only a final move available, or recordings such as Copy Once (コピーワンス) recordings that prohibit further copying and permit only a move, this operation deletes the source recording, and it cannot be restored. Please exercise sufficient caution.\n\nDuring reception, data is written to a temporary file (`.recording.m2ts.part`), and finalization (`FINALIZE`) is requested from the source only after persistence to disk is complete.  \nIf the transfer is interrupted before finalization is requested, the Move is canceled and the temporary file is deleted, so the source's copy count does not decrease.\n\n> [!TIP]  \n> **If a response cannot be received because of a disconnection or similar issue after the finalization request has been sent, the received data and resume information (`recording.m2ts.pydtcpip-resume.json`) are saved.**  \n> Once communication is restored, use the following command to resume only finalization without receiving the data again.\n> \n> ```bash\n> $ pydtcpip resume recording.m2ts\n> ```\n>\n> Depending on the source model, the device may immediately discard its resume information and reject retransmission if the connection is lost during finalization (observed on DBR-Z620).  \n> In that case, pydtcpip deletes the resume information and saves the received video in `.recording.m2ts.part`.  \n> If the source's remaining copy count has decreased or the recording has been deleted, the Move has already been finalized on the source.\n\n### 4. Browsing recorders and moving recordings interactively\n\n\u003Cimg width=\"100%\" alt=\"pydtcpip tui screenshot\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F170f6577-f90b-4c82-828d-963b9159afff\" \u002F>\u003Cbr>\n\n**The `tui` subcommand provides the functions of `discover`, `info`, `move` and `resume` together in an interactive interface.**  \nRecorders found on the network appear on the left, the folders and recordings of the selected recorder in the middle, and details of the highlighted recording on the right.  \nFor streaming to a player, receiving push dubbing or exporting diagnostics, use `stream`, `receive` or `dump` directly.\n\n```bash\n# Save moved recordings in the current directory\n$ pydtcpip tui\n# Save moved recordings in another directory\n$ pydtcpip tui ~\u002FVideos\n```\n\nThe recording table shows the date, length, quality, size and remaining copies of each recording, using the resource that a Move would transfer.  \nSizes marked `~` are estimated from the advertised bitrate and duration, and sizes marked `*` are the encrypted transfer size because the device did not report the saved size.  \nWhen the cursor rests on a recording, the details pane also shows every advertised quality, chapters and additional program information from the device.\n\n| Key | Action |\n| --- | --- |\n| `Enter` \u002F `Backspace` | Open the highlighted recorder or folder \u002F return to the parent folder |\n| `Space` \u002F `a` | Select or deselect the highlighted recording \u002F every recording in the folder |\n| `v` | Choose another quality for the highlighted recording (the stored recording is used by default) |\n| `m` | Review and move the selected recordings |\n| `\u002F` \u002F `s` | Filter titles in the folder \u002F change the sort order |\n| `c` | Cancel the active transfer before finalization |\n| `+` | Add a recorder by its device description URL when discovery does not find it |\n| `l` \u002F `q` | Show the log \u002F quit |\n\nSelected recordings are marked with `■` (yellow when another quality is chosen), and the same column shows the state of recordings queued during the session: `Q` queued, `M` moving, `D` done, `R` finalization must be resumed, `C` the source rejected finalization, `F` failed and `S` stopped.  \nTo filter while a Japanese input method is in kana mode, `・` and `／` also open the title filter.\n\nThe mouse works as in htop: a click moves the cursor, a double click opens or selects the row, the wheel moves the cursor, and clicking a column heading sorts by that column.\n\n`m` opens a confirmation listing each recording with its copy count, size and destination file, together with warnings for recordings that only have the final Move left, unknown copy counts and versions other than the stored recording.  \nRecordings are saved as `\u003Ctitle>-\u003Cidentifier>.m2ts` in the directory given to `tui`, which can also be changed on the confirmation screen, with the same XML and JSON metadata files as the `move` subcommand, and are transferred one at a time.  \nRecordings whose destination files already exist and recordings that the device reports as protected are excluded, and a recording listed in several folders is moved only once.\n\n> [!WARNING]  \n> **Each Move consumes one copy from the source, and a recording with only the final Move left, or one that prohibits copying, is deleted from the source.**  \n> Check the warnings on the confirmation screen before starting.\n\nIf a Move does not complete, the queue pauses and explains whether the source may have consumed a copy.\n\nIf the source refuses to start a Move and offers an original-quality stream, choose **Save in original quality**. The source recording and its copy count stay unchanged. The queue labels the result **Saved via stream**.\nTo save later recordings from the same device without another prompt if their Moves are also refused, select the checkbox before saving. The choice applies only to the current queue.\n\nA Move interrupted after finalization was requested appears in the transfer list as requiring resumption; press `Enter` on it to finalize without receiving the recording again.  \nSources that discard their resume information after a disconnection during finalization, such as DBR-Z620, reject this resumption; see the note in [section 3](#3-saving-recordings-from-a-pc-through-move-transfers) for what is kept and how to check whether the Move was finalized.  \nQuitting during finalization waits until it finishes, and quitting during reception asks before cancelling the transfer, which keeps the copy on the source.\n\nThe interface needs a terminal. For scripts and other non-interactive use, use the subcommands.\n\n### 5. Streaming playback\n\n**The `stream` subcommand provides functionality equivalent to recorded program streaming playback in DTCP-IP-compatible remote viewing applications. It decrypts the MPEG-2 TS stream sent by the recording device as it arrives and writes it to standard output.**  \nBecause logs, progress bars, and selection screens are all written to standard error, you can pipe the stream to an external MPEG2-TS-compatible player such as FFplay for streaming playback.\n\nThe following command is an example of streaming a program selected interactively on the recorder, using FFplay for deinterlacing and libaribcaption to display subtitles in [ARIB STD-B24](https:\u002F\u002Fwww.arib.or.jp\u002Fkikaku\u002Fkikaku_hoso\u002Fdesc\u002Fstd-b24.html) format (ARIB subtitles).  \n\n```bash\n$ pydtcpip stream | ffplay -loglevel panic -nostats -autoexit \\\n  -vf 'yadif=mode=send_field:parity=auto:deint=interlaced' \\\n  -scodec libaribcaption -sub_type bitmap \\\n  -i pipe:0\n```\n\n> [!NOTE]  \n> The FFmpeg \u002F FFplay packages provided by Linux distributions may not include [libaribcaption](https:\u002F\u002Fgithub.com\u002Fxqq\u002Flibaribcaption), which is required to display ARIB subtitles.  \n> [FFmpeg-Builds](https:\u002F\u002Fgithub.com\u002FFFmpeg-Builds\u002FFFmpeg-Builds) distributes FFmpeg builds that include libaribcaption, so we recommend using those builds.\n\n> [!TIP]  \n> You can specify the time range to receive in milliseconds with the `--start-ms` and `--end-ms` options.  \n> This functionality is primarily provided for implementing seeking when using the library, but it is also available through the CLI.  \n> The range returned by the device may extend before or after the specified positions, and the decoder may produce warnings at the first and last frame boundaries.\n\n### 6. Receiving recordings as a dubbing destination\n\n**For recording devices that only support push dubbing from their own menus, you can receive recorded data by using the `receive` subcommand to have the PC listen as a DTCP-IP-compatible NAS (DTCP-IP-compatible DLNA server).**\n\nSpecifying a destination directory starts listening on all IPv4 network adapters.  \nThe destination IP address announced to recording devices is set automatically, so specifying an IP address or selecting a device is normally unnecessary.\n\n```bash\n$ pydtcpip receive recordings\n```\n\nIf you want to listen only on a specific network adapter, such as Wi-Fi, specify that adapter's IPv4 address on the PC with `--interface`.  \nTo allow reception only from specific recording devices, you can specify their IPv4 addresses with `--source` (multiple values are allowed). Both options only need to be specified when necessary.\n\n```bash\n$ pydtcpip receive recordings --interface 192.0.2.10\n$ pydtcpip receive recordings --source 192.0.2.20\n```\n\nOnce the server starts, use the recording device's remote control to select the recorded program for dubbing on its screen, then select \"pydtcpip\" as the dubbing destination and start dubbing.  \n\n> [!NOTE]  \n> **Received recordings are saved as `.m2ts`, with program metadata in `.xml` and `.metadata.json` sidecars in the specified directory.**  \n> Incoming transfers preserve the metadata supplied by the sender, including its original XML. Additional source queries require a discovered media server and are available through `info` and client-initiated `move`.  \n> The program title provided through DLNA is normally used as the filename.  \n> To stop the server from listening, press Ctrl+C.\n\n> [!WARNING]  \n> **As with the `move` subcommand, dubbing consumes one copy from the source's copy count.**  \n> For recordings with no copies remaining and only a final move available, or recordings such as Copy Once recordings that prohibit further copying and permit only a move, this operation deletes the source recording, and it cannot be restored. Please exercise sufficient caution.\n\n### 7. Running without interaction\n\nFor batch execution and similar uses, you can skip interactive selection by specifying the URL of the recording device's DTCP-IP-compatible DLNA server with `--server` (`-s`) and the recording ID with `--id`.\n\nInteraction is also skipped when standard input is not a terminal, but we recommend specifying `--server` explicitly for automated execution to avoid selecting the wrong device.  \nTo also skip the confirmation before the `move` subcommand runs, add `--yes` (`-y`).\n\n```bash\n$ pydtcpip info --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id RECORDING_ID\n$ pydtcpip move recording.m2ts --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id RECORDING_ID --yes\n$ pydtcpip stream --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id RECORDING_ID | ffplay -loglevel panic -nostats -autoexit \\\n  -vf 'yadif=mode=send_field:parity=auto:deint=interlaced' \\\n  -scodec libaribcaption -sub_type bitmap \\\n  -i pipe:0\n```\n\nTo select a particular quality in a script, use the number shown by `info` for that recording. The following examples select resource 2 for each operation; a resource marked `Move only` is available to `move`, but not to `stream`.\n\n```bash\n$ pydtcpip move recording.m2ts --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id RECORDING_ID --resource 2 --yes\n$ pydtcpip stream --server http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml --id RECORDING_ID --resource 2 | ffplay -loglevel panic -nostats -autoexit \\\n  -vf 'yadif=mode=send_field:parity=auto:deint=interlaced' \\\n  -scodec libaribcaption -sub_type bitmap \\\n  -i pipe:0\n```\n\n> [!NOTE]  \n> If the URL of the served resource is known, you can also specify it directly, as in `stream URL` or `move recording.m2ts --url URL --yes`.  \n> Use either `--resource N` with a recording or a direct URL; combining them is an error.\n> When you specify a URL directly, the DLNA recording listing is not retrieved, so program metadata sidecars and the remaining copy count from metadata are unavailable.  \n\n### 8. Firewall and network settings\n\nUnicast discovery responses use UDP port 57000.  \nDevice announcements and incoming dubbing discovery use UDP port 1900.  \nIncoming dubbing transfers use TCP port 57000.  \nIf your firewall is enabled, allow incoming traffic from your home network (adjust the address range to match your home environment).\n\nThe following command is an example of allowing listening on port 57000 in an environment with UFW enabled.\n\n```bash\n$ sudo ufw allow from 192.0.2.0\u002F24 to any port 57000\n```\n\n> [!NOTE]  \n> UFW allows incoming multicast traffic on UDP port 1900 by default, but if you use custom rules, please allow it as well.\n\n> [!TIP]  \n> By default, discovery runs simultaneously on each IPv4 network, even when wired LAN and Wi-Fi are both in use. To limit discovery to a particular network, you can specify the PC's IPv4 address with the `--interface` option as shown below.  \n> You can change the discovery port with `--search-port` before the subcommand (`0` lets the OS assign a port automatically).\n> Use a response port other than UDP 1900 if you want the `discover` command to listen for announcements as well.\n>\n> ```bash\n> $ pydtcpip --interface 192.0.2.10 discover\n> ```\n\n## Using pydtcpip as a Python library\n\nAll public APIs assume asyncio (asynchronous I\u002FO).\n\nIf you want to manage credentials and SRMs in the same format as the CLI, explicitly create and use a `DeviceStore`.  \n`DeviceStore()` uses the default directory for the OS, while `DeviceStore(data_dir=Path('\u002Fpath\u002Fto\u002Fdevice-data'))` uses a directory of your choice.\n\nThe following example receives the recorded data for a specified recording ID from a recording device listening at `http:\u002F\u002F192.0.2.20:5000` and saves it to an `.m2ts` file.\n\n```python\nimport asyncio\nfrom pathlib import Path\n\nfrom pydtcpip import DeviceStore, DLNAClient, DTCPClient, FileSink, MoveResumeState, Recording\n\n\nasync def main() -> None:\n    store = DeviceStore()\n    output = Path('recording.m2ts')\n    resume_path = output.with_name(f'{output.name}.pydtcpip-resume.json')\n\n    def save_resume_state(state: MoveResumeState | None) -> None:\n        if state is None:\n            resume_path.unlink(missing_ok=True)\n            return\n        with resume_path.open('wb') as file:\n            resume_path.chmod(0o600)\n            file.write(state.model_dump_json().encode('utf-8'))\n\n    async with (\n        DLNAClient() as dlna,\n        DTCPClient(\n            store.load_credentials(),\n            srm=store.load_srm(),\n            on_srm_update=store.save_srm,\n        ) as client,\n    ):\n        server = await dlna.get_server('http:\u002F\u002F192.0.2.20:5000\u002Fdescription.xml')\n        recording = await server.get_metadata('RECORDING_ID')\n        if not isinstance(recording, Recording) or recording.original_move_resource is None:\n            raise ValueError('The recording has no original-quality resource for Move.')\n        await client.move(\n            recording.original_move_resource,\n            FileSink(output),\n            on_resume_state=save_resume_state,\n        )\n\n\nasyncio.run(main())\n```\n\n> [!WARNING]  \n> **The Python API's `client.move()` consumes the source's copy count without displaying a confirmation prompt.**  \n> Please check the target recording and the remaining copy count in the calling application.\n\nFor metadata retrieval, `await server.collect_metadata(recording)` returns a `RecordingMetadata` archive containing the listing, optional chapters, additional details and query statuses. Use `additional=False` to package only the listing without extra network requests.  \n`await server.get_chapters(recording)` requests chapters separately, while `server.extension` exposes family-specific operations such as `SonyExtension.get_title_info()` and `NasneExtension.get_title_list()`. These operations share the media server's HTTP session.  \n`server.iter_recordings()` traverses the family's recording containers, and `server.get_service_description(service)` exposes the actions and ordered arguments advertised by a UPnP service. Ordinary `browse()` and `get_metadata()` calls perform only their usual listing request.\n\n> [!TIP]  \n> If you use your own storage location, such as an OS keychain, you can pass bytes directly to `DeviceCredentials(certificate=..., private_key=...)` without using `DeviceStore`.  \n> You can still manage SRM updates through the `on_srm_update` callback in that case (the same applies to `DubbingReceiver`).\n\n> [!NOTE]  \n> The streaming method `client.stream(resource, on_data)` waits for the asynchronous callback to complete before receiving the next data, so the reception rate automatically matches the caller's processing speed.  \n> For Move, the finalization request is sent only after `Sink.persist()` completes.  \n> Logs are recorded through standard `logging` (the `pydtcpip` logger).\n\n> [!IMPORTANT]  \n> **Storage, playback, and output of received data, and the associated content protection, are the responsibility of the application that integrates this library.**  \n> Please implement storage and output controls appropriate to your use, referring to the copy control information retrieved from the recording device and to the digital copy control descriptor, content availability descriptor, DTCP descriptor, and other information in the received stream.\n> Because the meaning of this information differs by descriptor and retrieval path, please do not determine the conditions for use after reception solely from the remaining copy count.  \n> When using the reference CLI, please manage the storage location and handling of received data yourself.\n\n## Received data format and metadata\n\nRecorded data obtained from `DTCPClient`, `DubbingReceiver`, or the reference CLI implementation (`move`, `receive`, `stream`) **is MPEG-2 TS (MPEG-2 Transport Stream: M2TS) with a packet size of 192 bytes, as in Blu-ray's BDAV format.**  \nIt is transmitted as \"timestamped TS,\" with a 4-byte timestamp header preceding each normal TS packet (188 bytes) to indicate when the following TS packet is to be input to the decoder (as defined in the interface specifications of [ARIB STD-B21](https:\u002F\u002Fwww.arib.or.jp\u002Fkikaku\u002Fkikaku_hoso\u002Fdesc\u002Fstd-b21.html)).  \nFor video playback alone, common media players and video processing tools can generally handle this format directly (displaying subtitles requires a compatible player such as FFplay or TvtPlay).\n\nIts content is not a broadcast TS containing all programs on one physical channel, but **a partial TS (Partial Transport Stream) that retains only the single service for the target program.**  \nIt does not contain the program information tables found in a normal broadcast TS, such as NIT, SDT, EIT, and TOT; instead, it contains **PAT**, **PMT**, **DIT** (Discontinuity Information Table), and **SIT** (Selection Information Table) for partial TS.  \nVideo data is stored as MPEG-2 (normally 1080i) for recordings in DR (Direct Recording) mode, and as H.264 for recordings compressed with AVC (H.264), such as the so-called \"3x mode\" (3倍モード) (resolution and picture quality depend on the quality settings specified when scheduling the recording).\n\nThe detailed structures of PMT and SIT are defined in technical standards such as [ARIB STD-B10](https:\u002F\u002Fwww.arib.or.jp\u002Fkikaku\u002Fkikaku_hoso\u002Fdesc\u002Fstd-b10.html) and [ARIB TR-B14](https:\u002F\u002Fwww.arib.or.jp\u002Fkikaku\u002Fkikaku_hoso\u002Fdesc\u002Ftr-b14.html) \u002F [TR-B15](https:\u002F\u002Fwww.arib.or.jp\u002Fkikaku\u002Fkikaku_hoso\u002Fdesc\u002Ftr-b15.html), and they store copy control information, DTCP protection information (`DTCP_descriptor`), network identifiers, and other information.  \nSome devices also write program titles and broadcast times into the SIT.  \nAlso, **ARIB STD-B24 subtitle streams and data broadcasts (data carousels) may be multiplexed alongside video and audio.**  \nHowever, whether subtitles and data broadcasts are included or only video and audio are output depends on the recording device's implementation and recording mode.\n\n> [!NOTE]  \n> As a practical tendency, devices such as TVs that mainly use DR (Direct Recording) mode to record broadcasts without conversion often retain subtitles and the full set of program metadata in the TS. This tendency has been observed on actual REGZA TVs.  \n> In contrast, for recordings compressed with AVC (H.264) or similar formats, some recorders may not include program title or broadcast time descriptors in the SIT (as described above).\n> \n> For this reason, **`move` and `receive` in the reference CLI implementation save XML and JSON metadata sidecars alongside the `.m2ts` file.**  \n> DIDL-Lite stores broadcast metadata such as program titles, detailed descriptions, broadcast dates and times, channel names, genres, and remaining copy counts, and also includes manufacturer- and model-specific extension elements.  \n> **Keep `.m2ts`, `.xml` and `.metadata.json` together when archiving so that programs can be identified later, including information absent from the TS.**\n\nThe XML retains the established DIDL-Lite item format, with ARIB broadcast symbols converted to readable Unicode. The JSON contains parsed fields alongside the source XML values before that conversion, resource attributes, raw copy counts, their interpretation and observation times.  \nFor client-initiated Move, it also includes the device description, service descriptions used by optional queries, chapters and additional responses. The source item XML is reserialized, so namespace prefixes and whitespace can differ from the response; incoming transfers additionally preserve the sender's complete `CreateObject` XML unchanged.\nThe JSON's `responses` field retains complete HTTP and SOAP response bodies, headers, status codes and observation times even when their metadata format cannot be parsed.\n\nDevice-wide capability declarations are kept separate from recording-specific Move permission, and HEAD and GET response metadata are recorded independently. Panasonic HTTP errors include the device's `error-info` and `Error.pxn.panasonic.com` fields when available. For Panasonic copy counts, the CLI uses individual recording metadata when sufficient and queries the parent listing when the selected resource's count is missing.\n\nnasne chapter times are estimated from thumbnail positions. The original positions are retained, including entries that cannot be converted to a time.\n\nThe JSON records whether each optional query succeeded, was omitted, is unsupported, was not requested or failed. Transfer headers, copy-control observations and receipt, persistence and Move lifecycle events are appended separately; a transfer failure retains the collected metadata, and `resume` updates an existing archive.  \nIf an event update fails, the CLI logs a warning and continues saving and finalizing the recording. Subsequent events retry the metadata update with the accumulated history, but the saved history can remain incomplete if the storage error persists.  \nMetadata sidecars contain no authentication keys or Move resume secrets. They do contain program titles and device addresses, so treat them as personal archives when sharing files.\n\n## Device-specific behavior and contributing to compatibility\n\nAs described above, **at the DLNA \u002F UPnP layer, conventions differ by manufacturer and device not only in how the remaining Dubbing 10 copy count is represented, but also in proprietary SOAP actions, extension headers, the placement of namespace declarations, and even the meaning of HTTP status codes when a client is not registered.**\n\n**For this reason, reliable operation across all TVs and recorders requires validation based on responses from real devices and expansion of device profiles.**  \nIf you use an unverified model, use the `dump` command to capture its responses when troubleshooting or implementing a profile fix.  \nThe following command can export device descriptions, service definitions, recording listings, and video HEAD responses without requiring credentials or consuming the copy count.\n\n```bash\n$ pydtcpip dump dump-output --mask-private\n\n                                 Recorders\n┏━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓\n┃ Number ┃ Name          ┃ Manufacturer      ┃ Model   ┃ Profile          ┃\n┡━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩\n│      1 │ REGZA-43Z570L │ TOSHIBA TVS REGZA │ 43Z570L │ toshiba_regza_tv │\n│      2 │ DBR-Z620      │ TOSHIBA           │ DBRZ6   │ toshiba          │\n└────────┴───────────────┴───────────────────┴─────────┴──────────────────┘\nRecorder number [1\u002F2]: 1\ndump-output\u002Fdescription.xml (Device description)\ndump-output\u002Fscpd-ConnectionManager.xml (ConnectionManager service description (HTTP 200))\ndump-output\u002Fscpd-ContentDirectory.xml (ContentDirectory service description (HTTP 200))\ndump-output\u002Fbrowse-01.xml (Folder 1 listing)\ndump-output\u002Fbrowse-02.xml (Folder 2 listing)\ndump-output\u002Frecording-01.xml (Recording 1 metadata)\ndump-output\u002Frecording-01-head.txt (Recording 1 media HEAD response)\ndump-output\u002Frecording-02.xml (Recording 2 metadata)\ndump-output\u002Frecording-02-head.txt (Recording 2 media HEAD response)\ndump-output\u002Frecording-03.xml (Recording 3 metadata)\ndump-output\u002Frecording-03-head.txt (Recording 3 media HEAD response)\ndump-output\u002Frecording-04.xml (Recording 4 metadata)\ndump-output\u002Frecording-04-head.txt (Recording 4 media HEAD response)\ndump-output\u002Frecording-05.xml (Recording 5 metadata)\ndump-output\u002Frecording-05-head.txt (Recording 5 media HEAD response)\nCheck the output for unmasked information before sharing it.\n```\n\n> [!NOTE]  \n> When sharing exported device responses publicly (such as alongside a pull request or operation log), always export them with `--mask-private`.  \n> The `--mask-private` option retains known technical attributes and unknown integers from 0 to 999 without leading zeros, which can help identify undocumented counters and status values. Fields named as identifiers, credentials, personal data, or dates are excluded from this integer exception. Program titles, broadcast dates and times, and user-assigned device names are masked; recording IDs and resource URL references receive consistent aliases, while UDNs, IP addresses, and MAC addresses are replaced with documentation values.  \n> Retaining unknown short integers is a diagnostic compromise and does not guarantee anonymity.  \n> Before publishing, please check the contents for any unmasked information as a precaution.\n\n> [!IMPORTANT]  \n> **Please fix unsupported devices on your side and send a pull request, rather than only opening an issue.**  \n> I have received far more compatibility reports and \"this does not work on my recorder\" issues than expected.  \n> It is difficult for me to spare more time on this project.  \n> Honestly, guessing causes from reports alone for hardware I do not own is difficult because device-specific quirks are involved (and I cannot verify fixes unless you test them anyway).  \n> Operation logs themselves are somewhat useful, but issues kept piling up faster than expected and got noisy, so I have turned off issue notifications.\n> \n> Many compatibility reports already appear to be written with users' own LLM agents, which is completely fine.  \n> **If you are going to report an incompatibility, please have your LLM agent go as far as fixing it on your device and submit a pull request from the start.**  \n> Doing so prevents issues from multiplying endlessly and gives me hardware-verified code without extra effort on my end.\n> \n> Anticipating this, **pydtcpip isolates device-specific behavior into independent profiles per manufacturer and model, so changes can be merged quickly unless they modify core behavior across the codebase.**  \n> Even when core behavior needs adjustment for a specific model, it can be implemented as a device-specific hook.  \n> As long as your change does not break other models and works on your actual device, I will merge it promptly, **so please use your agent and send a PR rather than just dropping an issue.**\n> \n> This project was originally vibe-coded (though intended to be robust), and working across many environments matters above all else, so I am actively accepting PRs here.  \n> In short, **having an LLM write even more code myself for hardware I do not own is too much work, so please fix your model locally and bring your contributions together.**\n\n## Research material\n\nThis section examines the relationship between the DTCP-IP specifications and client implementations in the context of interoperability with recording devices owned by the user.  \nThe analysis techniques below provide technical background for understanding and verifying those implementations.\n\n### Why recordings need to be recovered from devices now\n\nIn Japanese terrestrial and satellite digital broadcasting, copy controls (Dubbing 10 and Copy Once) apply to almost all programs, including free-to-air broadcasts.  \nDTCP-IP itself is included in an international standard ([IEC 62481-3](https:\u002F\u002Fwebstore.iec.ch\u002Fen\u002Fpublication\u002F31411)), and it has also been adopted outside Japan, such as in satellite TV DVRs in the United States.  \nHowever, an environment where everyday home TV recordings are subject to such strong device restrictions is effectively unique to Japan.\n\nHome recording TVs and recorders encrypt video with a key unique to the individual device when recording to an internal or external HDD.  \nAs a result, once the device is replaced or its circuit board fails, the contents can no longer be played even if the same HDD is reconnected to another device or PC.\n\nThe official methods presented for transferring existing recordings have been exporting to Blu-ray discs, using SeeQVault-compatible HDDs, using manufacturers' official viewing and offline viewing apps, and network dubbing.  \nHowever, all of these options are now declining at the same time.\n\n- **Withdrawal from optical media and recorders, and drive failures**: Following Panasonic, Sony also announced the [end of production of recordable Blu-ray media](https:\u002F\u002Fwww.sony.jp\u002Frec-media\u002Finfo2\u002F20250123.html) and the [end of shipments of all Blu-ray recorder models](https:\u002F\u002Fwww.sony.jp\u002Fbd\u002Finfo2\u002F20260209.html), and TVS REGZA has also ended recorder production.\n  - Optical drives, which contain mechanical moving parts, are among the components most likely to fail first inside a recorder (the drive in the developer's own unit also failed before the HDD), and once the drive fails, even transferring recordings to disc is no longer an option.\n- **The decline of SeeQVault**: SeeQVault, which advertised continuity after device replacement, also has fewer compatible devices, and with [SeeQVault Player Plus for PCs ending its service and license activation](https:\u002F\u002Fwww.sony.jp\u002Fsoftware\u002Fstore\u002Fproducts\u002Fseeqvault-player\u002Finfo\u002F), it can no longer serve as a long-term storage solution.\n- **Discontinuation of official apps and manufacturers ceasing operations**: Announcements of official app discontinuations have followed one another, including Sony's [Video & TV SideView](https:\u002F\u002Fwww.sony.jp\u002Fsupport\u002Fsoftware\u002Fvideotvsideview\u002F2025\u002F09\u002F20250902.html) and TVS REGZA's [スマホ de レグザ](https:\u002F\u002Fwww.regza.com\u002Fnews\u002F2026-news\u002F20260109), and in some cases, even recordings already downloaded to a device become unplayable after discontinuation.\n  - Furthermore, manufacturers themselves do not exist indefinitely, as illustrated by the [end of Funai Connect and software updates for all recorder models](https:\u002F\u002Ffunai.jp\u002Fnews\u002Fdetail\u002F1733403221.html) following Funai Electric's bankruptcy.\n  - Even for third-party apps and devices' network dubbing functions that currently work, it is unclear how long their black-box firmware and authentication servers will be maintained.\n\nFor programs yet to be broadcast, an established approach combines a PC tuner, a B-CAS card, and an [ARIB STD-B25](https:\u002F\u002Fwww.arib.or.jp\u002Fkikaku\u002Fkikaku_hoso\u002Fdesc\u002Fstd-b25.html) decryption library (such as [libaribb25](https:\u002F\u002Fgithub.com\u002Ftsukumijima\u002Flibaribb25)) (an environment known in Japan as \"TS extraction\" (TS 抜き)).  \nThis is a convenient way to make private backups as normal MPEG-TS files without being tied to the lifetime of a particular device or app, but **it does not cover past recordings already stored on home TVs or recorders.**\n\nHouseholds have recordings that mean so much to them that they hesitate to replace their TVs, such as local programs with no reruns or online distribution, or a recording of a family member who happened to appear in the news.  \nOver the next few years, as HDDs and circuit boards reach the end of their lives, will abandoning those recordings together with the devices be the only option?  \nSince neither hardware nor software will be maintained forever, this should be a question that even the industry cannot readily dismiss.\n\npydtcpip was developed to transfer important recordings losslessly to a PC through the recording device's own network transfer functionality while the device still works.  \nAt the same time, it is research material intended to clarify the reality of DTCP-IP, for which no public implementation existed for more than 20 years, through working code and technical analysis.\n\n### What is DTCP-IP?\n\n#### The relationship between UPnP \u002F DLNA and DTCP-IP, and the structure shared with mTLS\n\nRecording transfers over a home network do not operate through a single protocol alone.  \n**DLNA** provides operational guidelines for cooperation between home devices, and within that framework, **UPnP \u002F UPnP AV** handles discovery and listing retrieval, **HTTP** handles the actual video transfer, and **DTCP-IP** handles authentication and encryption for protected content.\n\nIn other words, pydtcpip is not just a library for DTCP-IP cryptography and authentication; it implements both a **DLNA \u002F UPnP client** for finding and retrieving recordings and a **DLNA server (receiving server)** that waits as a dubbing destination.  \nThis separation of layers is why even an ordinary DLNA client without DTCP-IP support can retrieve a recording listing and is rejected only when it attempts to start playback.\n\n```mermaid\nflowchart TB\n    subgraph ClientSide[\"pydtcpip (receiver \u002F client and server listening for dubbing transfers)\"]\n        direction LR\n        DLNA[\"DLNAClient \u002F MediaServer\u003Cbr\u002F>SSDP discovery \u002F ContentDirectory browsing\u003Cbr\u002F>Handling differences through device family profiles\"]\n        DTCP[\"DTCPClient\u003Cbr\u002F>AKE mutual authentication \u002F PCP decryption\u003Cbr\u002F>GET Move control\"]\n        RECV[\"DubbingReceiver\u003Cbr\u002F>MediaServer advertisement \u002F CreateObject\u003Cbr\u002F>HTTP POST reception \u002F 100 Continue control\"]\n    end\n\n    subgraph Layers[\"Relevant standards and their roles\"]\n        direction TB\n        UPNP[\"UPnP \u002F UPnP AV\u003Cbr\u002F>Device discovery (SSDP) \u002F recording metadata (DIDL-Lite)\"]\n        DLNARULE[\"DLNA guidelines + device-specific extensions\u003Cbr\u002F>protocolInfo \u002F transfer modes \u002F remaining copy count fields\"]\n        DTCPIP[\"DTCP-IP (DTCP V1 \u002F V1SE)\u003Cbr\u002F>AKE mutual authentication \u002F key exchange \u002F AES-128-CBC encrypted transfer \u002F Move\"]\n    end\n\n    DLNA --> UPNP\n    DLNA --> DLNARULE\n    RECV --> UPNP\n    RECV --> DLNARULE\n    RECV --> DTCPIP\n    DTCP --> DLNARULE\n    DTCP --> DTCPIP\n```\n\nDTCP-IP uses its own TCP handshake (AKE: Authentication and Key Exchange) and encrypted packet format (PCP) rather than TLS because it originated as an extension of DTCP from the IEEE 1394 (i.LINK) era to IP.  \n**Nevertheless, its essential structure as a communication protocol is the same as mutual TLS (mTLS) using client certificates combined with copy control information and Move state management.**\n\nThe sender and receiver present DTLA-signed device certificates to each other and establish an exchange key through elliptic-curve signatures and key agreement using their corresponding per-device private keys.  \nThe subsequent encryption of the video data itself uses the public standard **AES-128-CBC**.  \nSelf-signed key pairs cannot pass authentication, and only peers with a legitimate certificate and private key pair verifiable with DTLA's public key can communicate.\n\n**Therefore, the structure of pydtcpip's processing differs both from BD ripping, which removes protection from encrypted data on recording media, and from decrypting the proprietary encryption of offline viewing files stored on a device by a smartphone app.**  \nIt connects as a receiver (Sink) to the network transfer functionality exposed by the recording device itself, completes mutual authentication with legitimate credentials, and then receives the video.\n\nThe GET Move sequence from authentication through persistence, finalization, and completion is as follows.\n\n```mermaid\nsequenceDiagram\n    participant R as Recording device\n    participant C as pydtcpip\n\n    C->>R: HTTP HEAD (retrieve authentication destination DTCP1HOST \u002F DTCP1PORT)\n    R-->>C: 200 OK (application\u002Fx-dtcp1)\n    Note over C,R: Move initiation and mutual authentication over a TCP control connection (IP TTL = 3)\n    C->>R: MV_INITIATE + AKE CHALLENGE \u002F RESPONSE (ECDSA \u002F ECDH)\n    R->>C: RTT proximity check (RTT_SETUP \u002F RTT_TEST \u002F RTT_VERIFY)\n    R->>C: MV_EXCHANGE_KEY (Move exchange key) + SRM update\n    C->>R: HTTP GET (with BLKMove.dtcp.com header)\n    loop Stream during transfer\n        R-->>C: PCP encrypted packets (AES-128-CBC)\n        C->>C: Decrypt and call Sink.write()\n    end\n    C->>C: Persist the entire recording to disk with Sink.persist()\n    C->>R: MV_FINALIZE (finalization request)\n    R-->>C: MV_FINALIZE ACCEPTED (MAC verification)\n    C->>C: Commit the recording file with Sink.commit()\n    C->>R: MV_COMPLETE (completion notification)\n```\n\nFor normal streaming (`stream`), pydtcpip receives and decrypts data with the normal exchange key without performing `MV_INITIATE` or finalization and completion operations.  \nWhen listening for dubbing transfers (`receive`, POST Move), after receiving `CreateObject` and HTTP POST (`Expect: 100-continue`) from the recording device, pydtcpip completes Move mutual authentication as described above in the `expect_handler` before the body is sent.  \nIt then returns `100 Continue` with the key label before receiving the body, and after `Sink.persist()` completes, it returns the final HTTP `200 OK` before proceeding to `MV_FINALIZE`, `Sink.commit()`, and `MV_COMPLETE`.\n\n#### Structural correspondence with B-CAS \u002F ARIB STD-B25 decryption\n\nIf you are familiar with handling Japanese digital broadcasts on a PC (ARIB STD-B25 decryption using a B-CAS smart card and libaribb25), comparing the two makes their structure clear.  \nWhile B25 decryption","pydtcpip 是一个开源的 Python 库，用于在 PC 与日本家用电视、蓝光\u002FHDD 录像机之间通过 DTCP-IP 协议传输受版权保护的数字广播录制内容。它完整支持 DLNA\u002FUPnP 设备发现、双向认证、AES-128 解密、Move 模式传输及流式接收，并默认以无损方式还原原始 MPEG-2 TS 流，避免重编码。基于 asyncio 构建，既可嵌入自定义应用，也提供命令行工具用于调试与归档。适用于日本 ISDB-T 环境下老旧录像设备的内容抢救性导出与长期归档场景。",2,"2026-11-24 04:50:45","CREATED_QUERY"]