Skip to content

China-chan/pydabema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Abema Dash Encryption Decryptor

Table of Contents


About

This project provides code to decrypt the encryption used by:
https://license.p-c3-e.abema-tv.com/abematv-dash

All processing is implemented purely in Python, without relying on Node.js or similar environments.


What This Is

This repository is a continued / extended version of the original project:
👉 https://github.com/NyaShinn1204/abema-dash-decryptor


Requirements

  • Python 3.12 or later
  • Japan VPN
  • See requirements.txt for Python dependencies

Usage

1. Clone the Repository

First, clone the repository:

git clone https://github.com/China-chan/pydabema

2. Using as a Python Module

After cloning, you can use pydabema as a module:

import pydabema

response = pydabema.decrypt(
    content_type="program",          # Target content type
    content_id="19-171_s2_p38",      # Target content id
    kid="KTofq8TORPmxAFWIYyODfg"     # Target content kid
    session=None,                    # Optional session (e.g., use premium)
    member_id=None                   # Optional session info
)

⚠️ Note: Argument details may vary depending on the implementation.


3. Using the Manual Script

The manual.py script is included inside the cloned repository under pydabema/.

Run it with:

python -m pydabema.manual

or:

python pydabema/manual.py

Follow the on-screen instructions and enter the URL when prompted.


FAQ

1. Is this work on premium content?

Yes, it works. However, you need a token that grants access to premium content to run it.

Here's how:

import requests
import pydabema

session = requests.Session()
session.headers.update(
  {
    "authorization": "Bearer eyXXXXXX....."
  }
)
member_id = "CSKoXXXXXX....."

response = pydabema.decrypt(
    content_type="program",          # Target content type
    content_id="90-2046_s1_p801",    # Target content id
    kid="Fh1Id0HBSVeIyQ0_humWCw"     # Target content kid
    session=session,                 # Optional session (e.g., use premium)
    member_id=member_id              # Optional session info
)

2. How to Get a KID?

Step 1: Access the MPD file

Open the following URL in your browser:

https://ds-vod-abematv.akamaized.net/program/{episode_id}/manifest.mpd

Replace {episode_id} with the target episode ID.
Example:

19-171_s2_p1

Step 2: Find the default_KID

Search in the MPD file for the following tag:

<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"/>

Copy the value of cenc:default_KID.


Step 3: Convert KID to Base64 (URL-safe)

The extracted KID must be converted into a Base64 (URL-safe) format.

Example in Python:

import base64

kid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"

kid_base64 = base64.b64encode(
    bytes.fromhex(kid.replace("-", ""))
).decode("utf-8").replace("==", "").replace("+", "-").replace("/", "_")

print(kid_base64)

Notes

  • Remove all - (hyphens) before converting.
  • The result is a URL-safe Base64 string.

Issues

If you encounter any problems, please open an issue on the repository.

About

Abema dash drm decryptor. continue from abema-dash-decryptor

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages