Specifically from Rakuten TV (live.tv.rakuten.co.jp)
FMI: https://cdm-project.com/How-To/ & https://old.reddit.com/r/Piracy/comments/y30ffr/
- Install Tampermonkey: https://www.tampermonkey.net/
- Install yt-dlp: https://github.com/yt-dlp/yt-dlp#installation
- Install ffmpeg: https://ffmpeg.org/download.html
- Download Bento4: https://www.bento4.com/downloads/
- Have a proxy/VPN if you're not in Japan since stuff is geolocked
- Install this userscript: https://greasyfork.org/en/scripts/373903-eme-logger
- Search browser JS Console for
MediaKeySession::generateRequest, then press play on the video and look under "Init Data" - Get something like
AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAXXXXXXXXFtoyTEzFOZDD4T9lmTiI=
- After doing the above, go to your browser developer tools' Network tab and search for
Widevine - Right click > Copy > Copy link address
- Get something like
https://azcp001.keydelivery.japaneast.media.azure.net/Widevine/?kid=e0c5b68c-9313-314e-6430-f8XXXXXXXX22
- Left click on the Widevine entry from the above steps, under the "Headers tab" scroll down to "Request Headers"
- Copy the following lines & do some manual formatting, get something like:
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,ja-JP;q=0.8,ja;q=0.7
Authorization: blahblah
Cache-Control: no-cache
Content-Length: "blahblah"
Origin: https://live.tv.rakuten.co.jp
Pragma: no-cache
Referer: https://live.tv.rakuten.co.jp/
User-Agent: blahblah
- Open https://cdrm-project.com/
- Input the results from the previous steps and press "Send"
- Hopefully see the "SUCCESS" message along with a key that looks like
e0c5b68c93133XXXXXXXX84fd9664e22:499047f36b770957XXXXXXXX9dfc4033
- In the developer console Network tab, search for
mpd - Find something that starts with
Manifest, right click and copy the URL, e.g.https://azclwds01.akamaized.net/9dc3547a-ede5-4aed-841f-5cXXXXXXXX0f/tXyKyP_tab_hd.ism/Manifest(format=mpd-time-csf,encryption=cenc,filter=pc_hd_001) - Run the Terminal command:
yt-dlp --allow-unplayable [url] - Get two files, an .mp4 and an .m4a
- In Bento4's
bin/folder, find themp4decryptcommand line utility - Navigate to this folder in your Terminal and run
mp4decrypt --key [yourkey] /path/to/corrupted.file /path/to/fixed.fileon both files - Run
ffmpeg -i fixedvideo.mp4 -i fixedaudio.m4a -c:v copy -c:a copy output.mp4 - The end
When i do it with no headers i got these message
Why did my request fail?
Your request for decryption keys may fail with a NetworkError or an HTTP Error (click on the Pywidevine logs button for details), and check your browser’s Javascript console for further information. The most likely reason for this is that the license server is checking for specific authorization information in the headers of the request (for instance, X-AxDRM-Message headers for servers using the standard Axinom license software). Play the content in your web browser, check the details of the request made to the license server in your browser’s Web Developer tools, and make sure the same information is included in the Headers field above, formatted as a Python dict.
Limitations
Some DRM license servers require specific information as a “payload” (body) of the POST request made to the license server, in addition to or instead of specific HTTP headers. This tool doesn’t currently support sending a POST payload body.
About
How does this tool work? It uses the Pywidevine library which provides a Python implementation of the Widevine Content Decryption Module (CDM). This module (normally implemented in obfuscated software that runs in your web browser, or on specially protected hardware on your CPU or GPU) is responsible for making requests to the server that provides the licenses (the decryption keys) for playing media “protected” by DRM. The pywidevine library is compiled to WASM using the excellent Pyodide tool so that it can run fully inside your web browser (there is no server backend for this software).
Privacy: this software is running fully inside your web browser. All the content is kindly hosted by GitHub pages (please note their privacy policy). We don’t log visits (no web analytics, no cookies), but GitHub pages provides anonymized web traffic graphs.