Coder Social home page Coder Social logo

samleong123 / vercel-php-clearkey-hex-base64-json Goto Github PK

View Code? Open in Web Editor NEW
58.0 4.0 84.0 37 KB

Convert Key ID & Key in Hex to Base64 for ClearKeys DRM in JSON form with deployment on Vercel

Home Page: https://vercel-php-clearkey-hex-base64-json.vercel.app/

CSS 5.46% PHP 47.04% HTML 47.50%
clearkey drm vercel php

vercel-php-clearkey-hex-base64-json's Introduction

Convert Key ID & Key in Hex to Base64 for ClearKeys DRM in JSON form

Notice

Heroku version has deprecated because Heroku decided to cancel their free plan. Hence , a Vercel version of this project was created and thanks to Vercel Community which has successfully runned PHP on Vercel.

Disclaimer

By utilizing this service, you may potentially be in violation of the terms of service of your streaming platform. I bear no responsibility for any issues, losses, or inconveniences that may arise due to such violations or discrepancies. You should assume full responsibility and bear the consequences of using this service. This service solely provides a format conversion for Clearkey Key ID and Key into JSON form. It does not include the conversion of key encryption keys for DRM protection nor does it bypass technological security measures (DRM). All Clearkey Key IDs and Keys are in plain text, and I have no means to verify the manner in which you have obtained these Clearkey Key IDs and Keys. All Clearkey Key IDs and Keys are provided in plain text and are inherently capable of decrypting CENC encrypted streams. This website merely converts these IDs and keys into a JSON format to address compatibility issues. Please refer to here for received take down notice.

Before you use this

  1. This tool is written in PHP
  2. You can run it locally by copying all files in to your web server's root directory.
    Ensure PHP is installed and configured properly with your web server before deploying them on your web server.
  3. You can deploy this tool to Vercel.
    Refer to the steps below for deploying this tool to Vercel.
  4. You can also visit https://vercel-php-clearkey-hex-base64-json.vercel.app/ directly if you wanted to use this tool on the spot.
    Deployed by me on Vercel.
  5. I shall not be liable for any problem that will produce losses or inconveniences incurred as a result of such changes or differences.
  6. Please star this repo if you feel that this repo is helping you. Thanks!
  7. Multiple Key & Key ID support is now here!

How to deploy to Vercel?

Deploy to Vercel

Reminder : You are likely to get failed attempt for the 1st time when deploying it , do not panic and follow steps below :

  1. Go to the project settings on Vercel
  2. Scroll down to the Root Directory
  3. Untick Include source files outside of the Root Directory in the Build Step.
  4. Save
  5. Edit anything in the readme.md and save it to trigger Vercel redeploy again.

How to use?

Visit deployed website : https://vercel-php-clearkey-hex-base64-json.vercel.app/

  1. Key in the Keys and Key ID in HEX without space and click generate image
  2. Click "Generate Now" and copy the URL after you saw some JSON output containing : { "keys":[ { "kty":"oct", "k":"", "kid":"" } ], "type":"temporary" }
  3. The URL you copied is your Clearkey License URL. You can use it on your IPTV Player that supports Clearkey.

Issue?

Create an issue if you encountered a problem that was never stated in this README.md

vercel-php-clearkey-hex-base64-json's People

Contributors

samleong123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vercel-php-clearkey-hex-base64-json's Issues

ayuda

Hi, how are I having problems when I want to use https://vercel-php-clearkey-hex-base64-json.vercel.app/api/multiple_key.php doesn't load is that I have a key "drm_license_uri": "1Dh0aiPKTARVnGPLLvpMuBvVe2hv5OoR7tEbdi1MCaNSJGBlHSyFMlrn7ySpa1rJ01rcNZJ8ArCpJAPLzZ0Zg9PzUMuve9OghvuhiftJvnm+oAnLAYRD/iZCfr5Xf3rJdbHbC7Pbl2EMrV8wFTQQ5WBBSNOI1hOHZdYRd6aK6pT/IvPuCZGtmdrP2gykdxwhe7jfFgO6OUFM/0ClrlEBKg==" that I would like to convert from now on thank you very much

JSON Key format is not proper

Example:

{"keys":[{"kty":"oct","k":"lFjtduhfGtiqfu\/NvWKJCA","kid":"evPsHy2wd65jdKAYy7SFEA"}],"type":"temporary"}

As you can see "KEY", there are symbol backslash which is can't read by DRM player like OTT Navigator / Tivimate etc.
Heroku version is perfect. But it's now deprecated.

Here is KIDKEY:
7af3ec1f2db077ae6374a018cbb48510:9458ed76e85f1ad8aa7eefcdbd628908

help

hello can someone help me to convert these keys in json to the long key

I give an example

#KODIPROP:inputstreamaddon=inputstream.adaptive
#KODIPROP:inputstream.adaptive.manifest_type=mpd
#KODIPROP:inputstream.adaptive.license_type=org.w3.clearkey
#KODIPROP:inputstream.adaptive.license_key={"keys":[{"kty":"oct","kid":"AAOOjndYHprC98tX53TqyA","k":"UiZhk_vJxF7tb8hTCSYShg"}]}

to

#KODIPROP:inputstream.adaptive.license_key=2d846f13c5bd43f3a456d9e958447f17:47e59e0ccb28b0ffa7ce830fd2519539

Multiple clearkeys

Is it possible to enhance the code and the API to enable the use of multiple keys through the link?

{ "keys": [ {"kty": "oct", "kid": "03o4uKXtS92jLWhNa3Xj6Q", "k": "JYfHzCa0fb2XRQ/Tvtvemw"}, {"kty": "oct", "kid": "rzmUV14pSgGKSRNV4I0e0A", "k": "lhoUk+dwMhuXR34oqV2tSQ"}, {"kty": "oct", "kid": "Tjar2s0iSyiW9p2JwasuMw", "k": "uyNDaYkC8bhEJ6KS5ENyCA"}, {"kty": "oct", "kid": "dsqUuGpTRJ+cySBGkWgwOA", "k": "8UItxro+9kxcxSWj7WcF6Q"} ] }

Thanks you

Modification Multiple Clearkeys

My apologies. When mentioning the error, I didn't take into account that a line is missing at the end:

Here is an example with 2 keys from another project:

https://m3ukodi.com/php/clearkey_hextobase64/results.php?keyid[]=49eb924ba998ca7fbbaee30dcef1ecb4&key[]=6e131b04b2e87598fb588ac205673698&keyid[]=49eb924ba998ca7fbbaee30dcef1ecb4&key[]=6e131b04b2e87598fb588ac205673698

you can put any text into [], to more easy generate scripts:

https://m3ukodi.com/php/clearkey_hextobase64/results.php?keyid[0]=49eb924ba998ca7fbbaee30dcef1ecb4&key[0]=6e131b04b2e87598fb588ac205673698&keyid[1]=49eb924ba998ca7fbbaee30dcef1ecb4&key[1]=6e131b04b2e87598fb588ac205673698

I believe the easiest way would be the following, so there is no need to modify all proyect:

https://vercel-php-clearkey-hex-base64-json.vercel.app/api/results.php?keyid=49eb924ba998ca7fbbaee30dcef1ecb4&key=6e131b04b2e87598fb588ac205673698&keyid=49eb924ba998ca7fbbaee30dcef1ecb4&key=6e131b04b2e87598fb588ac205673698

I believe that this way would be better to facilitate the automation of scripts that generate the API call and return the value to Tivimate and ott player.

https://vercel-php-clearkey-hex-base64-json.vercel.app/api/results.php?keyid[0]=49eb924ba998ca7fbbaee30dcef1ecb4&key[0]=6e131b04b2e87598fb588ac205673698&keyid[1]=49eb924ba998ca7fbbaee30dcef1ecb4&key[1]=6e131b04b2e87598fb588ac205673698

The JSON needs to be like this for OTT players to read it, such as Tivimate, for example, all in 1 line:

{"keys":[{"kty":"oct","k":"bhMbBLLodZj7WIrCBWc2mA","kid":"SeuSS6mYyn-7ruMNzvHstA"},{"kty":"oct","k":"bhMbBLLodZj7WIrCBWc2mA","kid":"SeuSS6mYyn-7ruMNzvHstA"}],"type":"temporary"}

The maximum number of keys in Widevine is 5 groups of kid key.

I don't know PHP, otherwise, I would have gladly helped :)

Thank you very much for your project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.