Giter Club home page Giter Club logo

bunny-cdn-drm-video-dl's Introduction

Bunny CDN "DRM" Video Downloader

This is a simple Python class that I wrote to download Bunny CDN's "DRM" videos using yt-dlp.

Requirements

You only need to install yt-dlp and then you may integrate it within your script and modify it according to your needs:

pip install yt-dlp

or

python3 -m pip yt-dlp

It is also better to have FFmpeg installed on your system.

Usage

If you're willing to use the script as is, simply paste the the iframe embed page URL at the bottom where indicated between the quotes as well as the webpage referer and run the script:

python3 b-cdn-drm-vod-dl.py

Embed link structure: https://iframe.mediadelivery.net/embed/{video_library_id}/{video_id}


Alternatively, you may want to run this command once:

chmod +x b-cdn-drm-vod-dl.py

after that you can run it this way:

./b-cdn-drm-vod-dl.py

Expected Result

By default:

  • the highest resolution video is to be downloaded. You can change this behavior in the main_playlist function located under the prepare_dl method.
  • The video will be downloaded in the ~/Videos/Bunny CDN/ directory. This configuration can be changed by providing the path argument when instantiating a new BunnyVideoDRM object.
  • The video file name will be extracted from the embed page. This can be overridden by providing the name argument .

Please note that the video format will be always mp4.

Explanation

The idea is all about simulating what's happening in a browser.

The program runs a sequence of requests tied to a session first of which is the embed page request from which information are extracted such as the video name.

After that, the download link (that is the HLS/M3U8) is ready to be fed to yt-dlp to download the video segments, decrypt them (since Bunny CDN's "DRM" videos are encrypted with the AES-128 algorithm) and merge them into one playable video.

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.