{"id":41467570,"url":"https://github.com/testpress/drm-video-processing","last_synced_at":"2026-01-23T16:34:21.249Z","repository":{"id":227660087,"uuid":"772051721","full_name":"testpress/drm-video-processing","owner":"testpress","description":"This repository provides a step-by-step guide to encrypt and decrypt videos with DRM licenses, accompanied by helpful scripts.","archived":false,"fork":false,"pushed_at":"2024-04-16T14:07:12.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-16T17:39:25.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-14T12:52:09.000Z","updated_at":"2024-03-14T12:53:53.000Z","dependencies_parsed_at":"2024-04-16T15:34:35.649Z","dependency_job_id":"780c719d-7bd7-49a2-b32b-8870b7dac870","html_url":"https://github.com/testpress/drm-video-processing","commit_stats":null,"previous_names":["testpress/drm-video-processing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/testpress/drm-video-processing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Fdrm-video-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Fdrm-video-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Fdrm-video-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Fdrm-video-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testpress","download_url":"https://codeload.github.com/testpress/drm-video-processing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Fdrm-video-processing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28695553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T15:57:05.722Z","status":"ssl_error","status_checked_at":"2026-01-23T15:56:27.656Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-23T16:34:20.511Z","updated_at":"2026-01-23T16:34:21.241Z","avatar_url":"https://github.com/testpress.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Installation and Execution\n\n1. Run the following command to make the `install.sh` script executable and install dependencies:\n\n   This script installs the required dependencies, including ffmpeg and shaka packager.\n\n   ```bash\n   chmod +x install.sh \u0026\u0026 ./install.sh\n   ```\n\n## Step 2: Configure Encryption Parameters\n\nEnsure you have set the required variables in the `config.json` file. Open the `config.json` file and replace the placeholder values with your actual organization code, content ID, Widevine AES key, Widevine IV, and video path:\n\n```json\n{\n  \"org_code\": \"your_org_code\",\n  \"content_id\": \"your_content_id\",\n  \"widevine_aes_key\": \"your_widevine_aes_key\",\n  \"widevine_iv\": \"your_widevine_iv\",\n  \"video_path\": \"input.mp4\"\n}\n```\n\n## Step 3: Run Widevine Packager Script\n\nRun the `widevine_packager.sh` script using the following commands:\n\n```bash\nchmod +x widevine_packager.sh \u0026\u0026 ./widevine_packager.sh\n```\n\n\nUpon successful execution, you should see the following message:\n\n```bash\nPackaging completed successfully.\n```\n\nYou will find the generated MPD file (h264.mpd) in the current working directory.\n\n\n\n## Step 4: Generate License URL\n\nRun the `get_license_url.py` script to generate your license URL. Use the following command:\n\n```bash\npython3 get_license_url.py\n```\n\nYou will receive your license URL in the following format:\n\n```\nLicense URL: https://license.tpstreams.com/api/v1/69xt46/drm_license/?data=eyJjb250ZW50X2RhdGEiOiJleUpqYjI1MFpXNTBYMmxrSWpvaVpHUmtaREZrWVdVNE9EWXlORE5pWlRnMU56RTJZekZtWWpnNE9UVTJORFVpTENKa2NtMWZkSGx3WlNJNkluZHBaR1YyYVc1bElpd2laRzkzYm14dllXUWlPbVpoYkhObGZRPT0iLCJzaWduYXR1cmUiOiI5QkM5aTloTFVMWHlmaXlBdXE5aHRhRGZYb3FRam9PWGtDOWlVbGd5Z3R3PSJ9\n```\nThe `get_license_url.py` script internally calls two methods, `get_encoded_content_data` and `generate_signature`, both of which are required to generate the license URL. Ensure you've run these steps before generating the license URL.\n\n\n## Step 5: Play the Video in Player\n\n1. Copy the generated license URL and Open the config.json file and replace the license URL values.\n2. Save the changes.\n\nNow, to view the video, follow these steps:\n\n1. Open a terminal.\n2. Navigate to the drm-video-processsing directory .\n3. Run the following command to start a local server:\n\n    ```bash\n    python manage.py runserver\n    ```\n\n4. Visit [http://localhost:8000/](http://localhost:8000/) in your web browser.\n   \n **Note:**  This will trigger a call to the DRM-proxy API at http://127.0.0.1:8000/drm_proxy/. The widevine configuration and security level settings are  configured there.\n\n\n\n\n\n\n\nYou should now be able to play the video using the configured DRM settings and the provided license URL. If any issues occur, ensure that the MPD file path and license URL are correctly set in the `config.json` and `index.html` file.\n\nTo add step 6 to your instructions, you can follow these guidelines:\n\n\n## Step 6: Get FairPlay URI, Key, and IV to Encrypt the Video with FairPlay DRM\n\n\n1. Run the following command to execute the script:\n\n    ```bash\n    python3 get_key_iv_and_uri.py\n    ```\n    This script will send a POST request to the URL `https://license.tpstreams.com/api/v1/{org_code}/fairplay_key/` and obtain the FairPlay URI, Key, and IV\n   \n2. You will receive a response similar to the following:\n\n    ```plaintext\n    Response: b'{\"iv\":\"c60e93703a0c423696b9dfa0e02b60d2\",\"key\":\"a8031c8ba7474846b137ffc328cf2304\",\"uri\":\"skd://4a961191b7764338b8a6ca3259023c2d\"}'\n    ```\n\n3. Update the values of FairPlay URI, Key, and IV in `config.json` provided in the response\n\n## Step 7: Run Fairplay Packager Script\n\nRun the `fairplay_packager.sh` script using the following commands:\n\n```bash\nchmod +x fairplay_packager.sh \u0026\u0026 ./fairplay_packager.sh\n```\n\n\nUpon successful execution, you should see the following message:\n\n```bash\nPackaging completed successfully.\n```\n\nYou will find the generated M3U8 file (video.m3u8) in the current working directory.\n\n## Step 8: Play the Encrypted Video Using FairPlay DRM\n\nTo play the encrypted video using FairPlay DRM, follow these steps:\n\n1. Open the `index.html` file located in your project directory.\n\n2. Replace the placeholder values in the `player.src` section with the path to your FairPlay-encrypted M3U8 file (`video.m3u8`) and the FairPlay license URL obtained in [Step 6](#step-6-get-fairplay-uri-key-and-iv-to-encrypt-the-video-with-fairplay-drm).\n\n3. Save the changes to the `index.html` file.\n\n4. Navigate back to  [Step 5](#step-5-play-the-video-in-player) and follow the instructions to play the encrypted video.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpress%2Fdrm-video-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestpress%2Fdrm-video-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpress%2Fdrm-video-processing/lists"}