1 ‐ Setup - dp247/mubi-downloader2 GitHub Wiki

Setting up mubi-downloader2 may be quite a pain, depending on your skill or comfort level. This wiki aims to make it as painless as possible, though there are certain things you'll have to acquire from elsewhere.

Setting up your folders

  1. To start with, download this repository, either with git clone or downloading as a zip and extracting. Your folder should look something like this:
mubi-downloader2
├── mubi_downloader.py
├── README.md
└── requirements.txt
  1. Install the requirements.txt file like so: pip install -r requirements.txt
  2. In your favourite text editor, create a new file and save it as .env (that should be it's full name)
  3. Open your new .env file, and add the following lines to it:
authorization=
dt_custom_data=
language=
country=
output_folder=

Values should be filled in without a space after the = sign, and no quotation marks

Key Details Where to find
authorization Bearer token used to authenticate a user Open a movie on MUBI->Developer Tools->Network->Search for Viewing->Search for "bearer". You should paste the value including the word Bearer
dt_custom_data Header needed for getting a license Open a movie on MUBI->Developer Tools->Network->Search for CENC -> Search for "dt-custom-data". You don't have to supply the bit that says dt_custom_data - only the text after it
language Desired language for MUBI site and films This should be a two-letter language code (ISO 639-1). Defaults to "en" if not provided.
country The region of your MUBI account You can find it in the MUBI URL. If left blank, defaults to your IP address region
output_folder Where downloaded files should be saved Use one of the following options: cwd for the script's folder, downloads for your computer's Downloads folder; or specify a custom path

The .env file should now sit in the root of your folder like so:

mubi-downloader2
├── .env
├── mubi_downloader.py
├── README.md
└── requirements.txt

Other things you need

To run this script, you'll need a few additional things - some programs, a folder from another repo, and some files relating to Widevine devices.

Programs

You'll need to download the following programs and add them to your system's PATH environment variable. The needed programs are:

  • N_m3u8DL-RE - handles the downloading of DASH/HLS/MSS streams
  • shaka-packager - required to decrypt the media files
  • MKVToolNix - this includes mkvmerge, which merges the decrypted files into a single MKV file

If you've opted for installers (MKVToolNix is only an installer) then the installers should automatically add the necessary binaries to your PATH itself. However, if you only have portable executables, these will need to be added manually. One suggestion is to create a utilities folder to keep the programs in and add this to your path like so:

  1. Create a new folder, such as C:\utils.
  2. Add the programs to this folder.
  3. Open the Start menu and search for "Environment Variables".
  4. Click "Edit the system environment variables".
  5. Click the "Environment Variables" button.
  6. Under "System variables", scroll down and find "Path", then click "Edit".
  7. Click "New" and enter the path to the folder.
  8. Click "OK" to close all the windows.

pywidevine L3 folder

:warning: Warning: As stated before, if you have the pywidevine module installed, you will need to remove it to run this script. To do so, simply run pip uninstall pywidevine. To read more on this issue, you can check the pinned issue on @CrymanChen's WKS-KEYS repo.