Skip to content

Instantly share code, notes, and snippets.

@tondol
Last active July 11, 2022 17:58
Show Gist options
  • Save tondol/bb1dc7758452ea233e717517f76be7c3 to your computer and use it in GitHub Desktop.
Save tondol/bb1dc7758452ea233e717517f76be7c3 to your computer and use it in GitHub Desktop.

https://4y4m3.hatenablog.com/entry/20180703/1530625951

  1. see "theoplayer.d.js:formatted" in "Sources" tab (Chrome Developer Mode)
  2. check the very last fragment of the code
            var n = t.data;  # L6627
            switch (n.zgt) { # L6628
                ...
            }
  1. set a breakpoint to L6628
  2. play your video
  3. the breakpoint (3.) is activated
  4. eval the following line in Console (Chrome Developer Mode)
Array.from(t.data.iyt,function(byte){return "0x"+('0' + (byte & 0xFF).toString(16)).slice(-2);}).join(' ')
  1. download the printed hex string as a file "license.dat" (using http://tomeko.net/online_tools/hex_to_file.php?lang=en)
  2. find the playlist.m3u8 in "Network" tab and download it
  3. open "playlist.m3u8" with your editor and replace the key URI of AES-128 with "license.dat"
  4. replace all appearances of "/tspg/" with "https://vod-abematv.akamaized.net/tspg/" in "playlist.m3u8"
  5. download the video with the following command
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -allowed_extensions ALL -i playlist.m3u8 -c copy output.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment