{"id":35005589,"url":"https://github.com/knugihk/pypssh","last_synced_at":"2026-05-21T11:41:16.865Z","repository":{"id":286423512,"uuid":"961361074","full_name":"KnugiHK/PyPSSH","owner":"KnugiHK","description":"A lightweight Python tool to extract and base64-encode Widevine and PlayReady PSSH boxes from MP4 init segments. Useful for DRM system diagnostics, media workflow automation, and security testing and research.","archived":false,"fork":false,"pushed_at":"2025-12-23T07:13:03.000Z","size":34,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T21:55:55.884Z","etag":null,"topics":["debugging","debugging-tool","diagnostics","drm","pentest","pentesting","playready","playready-drm","pssh","research-tool","widevine","widevine-drm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KnugiHK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-06T11:02:45.000Z","updated_at":"2025-12-23T07:13:06.000Z","dependencies_parsed_at":"2025-04-06T12:19:53.395Z","dependency_job_id":null,"html_url":"https://github.com/KnugiHK/PyPSSH","commit_stats":null,"previous_names":["knugihk/pypssh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KnugiHK/PyPSSH","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2FPyPSSH","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2FPyPSSH/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2FPyPSSH/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2FPyPSSH/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnugiHK","download_url":"https://codeload.github.com/KnugiHK/PyPSSH/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnugiHK%2FPyPSSH/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28072376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","debugging-tool","diagnostics","drm","pentest","pentesting","playready","playready-drm","pssh","research-tool","widevine","widevine-drm"],"created_at":"2025-12-27T04:36:38.132Z","updated_at":"2025-12-27T04:36:38.621Z","avatar_url":"https://github.com/KnugiHK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyPSSH\n\n**PyPSSH** is a lightweight Python tool to extract and base64-encode Widevine and PlayReady PSSH boxes from MP4 init segments. Useful for DRM system diagnostics, media workflow automation, and security testing and research. \n\n## ⚖️ Legal (Read Before Using!)\n\n**PyPSSH** is provided under the [MIT License](LICENSE), which allows you to freely use, modify, and distribute the software. However, by using **PyPSSH**, you acknowledge the following:\n\n### 🛡️ DRM and Copyright Compliance\n\n**PyPSSH** may interact with DRM-protected content and is intended for diagnostic, research, and security testing purposes. It does _not_ provide tools to bypass DRM protections but helps in identifying and handling DRM information in media files. Users are responsible for ensuring their use complies with applicable laws, including DRM and copyright regulations, and should _not_ use **PyPSSH** for circumventing DRM protections or infringing on intellectual property rights.\n\n### ⚠️ No Warranty and Liability\n\n**PyPSSH** is provided \"as-is,\" without warranty of any kind. The authors are not liable for any damages, misuse, or legal consequences arising from its use.\n\n## 🚀 Features\n\n- Extracts Widevine and PlayReady PSSH boxes from MP4 initialization segments.\n- Outputs PSSH boxes in base64 encoding for easy use.\n- Can be used for debugging DRM workflows or extracting information from encrypted media files.\n- Simple and efficient with minimal dependencies.\n\n## 🧰 Usages\n\n### Command Line Usage\nTo extract Widevine and PlayReady PSSH boxes from an MP4 initialization segment, run the script as follows:\n\n```bash\npython3 pypssh.py init.mp4\n```\n\nThe script will output the base64-encoded PSSH boxes for both Widevine and PlayReady (if present).\n\n### Developer Usage\nYou can also import the script as a module and use the `extract_pssh()` function to get the PSSH boxes programmatically. Here's an example of how to use the function in your own Python code:\n\n```python\nfrom pypssh import PSSH\nimport logging\n\nlogging.basicConfig(level=logging.INFO, format='%(message)s')\nlogger = logging.getLogger(__name__)\n\n# Specify the path to the video initialization segment\nvideo_file_path = '/path/to/video_init.mp4'  # Replace with the actual path\n\n# Parse the PSSH data from the file\npssh = PSSH.parse(video_file_path)\n\nlogger.info(\"Extracted PSSH Data:\")\nlogger.info(\"--------------------\")\n\n# Extract and log Widevine \u0026 PlayReady PSSH base64 data if available\nwidevine_b64 = pssh.get_widevine_b64()\nplayready_b64 = pssh.get_playready_b64()\n\nif widevine_b64:\n    logger.info(f\"Widevine PSSH: {widevine_b64}\")\nelse:\n    logger.info(\"No Widevine PSSH found\")\n\nif playready_b64:\n    logger.info(f\"PlayReady PSSH: {playready_b64}\")\nelse:\n    logger.info(\"No PlayReady PSSH found\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknugihk%2Fpypssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknugihk%2Fpypssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknugihk%2Fpypssh/lists"}