Devine On Win v0.03
Win 11 - CMD Prompt Instructions for Devine
#Devine
[1] #Run "Command Prompt" press:
Win + R:
cmd [pres ENTER]
[2] #Go to "User" profile "Home" that you are are logged in with:
(When opening up CMD Promtp, you should be in the "path" but included just in case ...)
cd %userprofile% [pres ENTER]
[3] #Create a "bin" DIR to store/upgrade *.exe files:
mkdir bin [pres ENTER]
#The path should be:
%userprofile%\bin
C:\Users\YOURwindows-userNAME\bin
YOURwindows-userNAME = Username that you use on your PC to log in to Windows.
[4] #Create a "git" DIR to store GIT projects
mkdir git [pres ENTER]
#The path should be:
%userprofile%\git
C:\Users\YOURwindows-userNAME\git
[5] Uninstall any previous versions you have already installed
Win + R:
appwiz.cpl
- Python
- FFMpeg
- MKVToolNix
- Git
[6] Install Git
#Install/Upgrade "GIT"
winget search "Git"
winget install --id Git.Git
[The installer will request to run as administrator, expect a prompt.]
(May have to confirm "Yes" on "User Account Control" prompt)
("git" command will be in the path after reboot/close-open the CMD prompt)
#Upgrade/Uninstall
winget upgrade --id Git.Git
winget uninstall --id Git.Git
#Interactive Installation
winget install -i Git.Git
[7] Installing Dependencies using "WinGet"
--------
#FFMpeg
winget install --id Gyan.FFmpeg
-------
#aria2
winget install --id aria2.aria2
------------------------
#GNU.Nano (If not installed - to edit files in CMD)
winget install --id GNU.Nano
-------------
#Python.3.12
winget list --source
where python
winget search "python"
winget search Python.Python
winget install -i Python.Python.3.12
(Setup window will pop up, so yo can confirm - Add python to PATH is ticked)
[The installer will request to run as administrator, expect a prompt.]
(May have to confirm "Yes" on "User Account Control" prompt)
("py" command will be in the path after reboot/close-open the CMD prompt)
#or
winget install --id Python.Python.3.12
(Silent install - with default options - no PATH etc.)
#Upgrade PIP
py -m pip install --upgrade pip
python -m pip install --upgrade pip
python.exe -m pip install --upgrade pip
#Notes for Python
py -3 -m ensurepip
pip install httpie
python -m pip install --upgrade packageXYZ
python -m pip install -U pip
----------------------
#Install Virtual ENV
https://pypi.org/project/virtualenv/
https://virtualenv.pypa.io/en/latest/user_guide.html
pip install virtualenv
virtualenv venv
------------
#MKVToolNix
winget install --id MoritzBunkus.MKVToolNix
(May have to confirm "Yes" on "User Account Control" prompt)
(It's necessary to add the "BIN" DIR to Windows PATH = "Environment variables"), see below on How-To. [10]
[8] Downloading/Installing Dependencies using "Installer - exe/msi"
-------------
#CCExtractor
https://github.com/CCExtractor/ccextractor/releases
https://ccextractor.org/public/general/command_line_usage/
aria2c https://github.com/CCExtractor/ccextractor/releases/download/v0.94/CCExtractor.msi --dir %userprofile%\Downloads\ -o CCExtractor-v0.94.msi
(We should really check the files hash ....but .......)
msiexec /i "%userprofile%\Downloads\CCExtractor-v0.94.msi"
(May have to confirm "Yes" on "User Account Control" prompt, location of instillation, etc.)
(It's necessary to add the "BIN" DIR to Windows PATH = "Environment variables"), see below on How-To. [10]
----------------
#Shaka-Packager
https://github.com/shaka-project/shaka-packager/releases/latest
aria2c https://github.com/shaka-project/shaka-packager/releases/download/v3.0.4/packager-win-x64.exe --dir %userprofile%\bin\ -o shaka-packager.exe
(It's necessary to add the "BIN" DIR to Windows PATH = "Environment variables"), see below on How-To [10]
Be sure that EXE files placed in this Directory is/are from reputable source)!
----------------
#Hola-Proxy
https://github.com/Snawoot/hola-proxy/releases/latest
aria2c https://github.com/Snawoot/hola-proxy/releases/download/v1.13.1/hola-proxy.windows-amd64.exe --dir %userprofile%\bin\ -o hola-proxy.exe
(It's necessary to add the "BIN" DIR to Windows PATH = "Environment variables"), see below on How-To [10]
Be sure that EXE files placed in this Directory is/are from reputable source)!
[9] #Additional Tools (may be useful)
------------------------
#MediaArea.MediaInfo
winget install --id=MediaArea.MediaInfo -e && winget install --id=MediaArea.MediaInfo.GUI -e
#or
winget install --id MediaArea.MediaInfo.GUI
winget install --id MediaArea.MediaInfo
------
#7-Zip
winget search "7"
(The installer will request to run as administrator, expect a prompt.)
[Alt+Y to confirm "Yes" on "User Account Control" prompt.]
winget install --id=7zip.7zip
(It's nessecery to add the "BIN" DIR to Windows PATH = "Environment variables"), see below on How-To [10]
--------------------
#YT-DLP x86 - Latest
https://github.com/yt-dlp/yt-dlp/releases/latest
aria2c https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe --dir %userprofile%\bin\ -o yt-dlp.exe
yt-dlp --version
-------------------
N_m3u8DL-RE win-x64
https://github.com/nilaoda/N_m3u8DL-RE
aria2c https://github.com/nilaoda/N_m3u8DL-RE/releases/download/v0.2.0-beta/N_m3u8DL-RE_Beta_win-x64_20230628.zip --dir %userprofile%\Downloads\
-------
#7-Zip:
7z e %userprofile%\Downloads\N_m3u8DL-RE_Beta_win-x64_20230628.zip -aoa -o%userprofile%\bin\ "N_m3u8DL-RE_Beta_win-x64/*.exe"
(If not in PATH)
"C:\Program Files\7-Zip\7z.exe" e %userprofile%\Downloads\N_m3u8DL-RE_Beta_win-x64_20230628.zip -aoa -o%userprofile%\bin\ "N_m3u8DL-RE_Beta_win-x64/*.exe"
N_m3u8DL-RE --version
----
#TAR:
tar -tzf %userprofile%\Downloads\N_m3u8DL-RE_Beta_win-x64_20230628.zip | findstr N_m3u8DL-RE.exe
tar --verbose --directory=/lib/firmware --extract --file=%userprofile%\Downloads\N_m3u8DL-RE_Beta_win-x64_20230628.zip --strip-components=1 -C %userprofile%\bin\
N_m3u8DL-RE --version
[10] Adding Shaka-Packager / CCExtractor / MKVToolNix to Windows PATH
----
Setting the Windows PATH can be done:
- from CMD with Administrator rights
or
- via GUI called "Environment variables"
------------------------------
#CMD #ComManD Prompt #Administrator
In order to set the path, Administrator priviledges are required:
Win + R:
cmd
Ctrl + Shift + ENTER
Alt + Y
#Check what is in your Windows "System variables" PATH:
echo %PATH:;=&echo.%
#Set the path for the following:
setx /M path "%PATH%;C:\Program Files\7-Zip\"
setx /M path "%PATH%;c:\Program Files\MKVToolNix\"
setx /M path "%PATH%;c:\Program Files (x86)\CCExtractor\"
setx /M path "%PATH%;%userprofile%\bin"
exit
(Now return to the "user" CMD Prompt).
--------------------------------------------
Win + Edit the system environment variables
Open
Click the “Environment variables” button.
- Select - "System variables" ........bottom part
-- Click on "Path" (when highlighted)
-- Click on "Edit" button
-- Click on "NEW" button
-- Insert the full path without the quotes "C:\Users\xxxx\bin"
xxxx = Is your Windows "username".
-- Click on "NEW" button
-- Insert the full path without the quotes "c:\Program Files (x86)\CCExtractor\"
-- Click on "NEW" button
-- Insert the full path without the quotes "c:\Program Files\MKVToolNix\"
-- OK
-- OK
-- OK
(Alternative ways to get the "Environment variables"):
Win + R:
SystemPropertiesAdvanced
Win + R:
rundll32.exe sysdm.cpl,EditEnvironmentVariables
REBOOT = Windows ....(just in case).
[11] Download Devine "stabbedbybrick" Scripts
----
cd %userprofile%\git
git clone https://cdm-project.com/stabbedbybrick/devine-services
cd devine-services
dir
#To update/upgrade the "stabbedbybrick" Scripts
cd %userprofile%\git\devine-services
git pull
[12] Devine Install (and Virtual ENV).
#Devine can be install:
A] - via PIP
B] - via ZIP/Poetry [TODO]
C] - via Git Clone/Poetry [TODO]
-----
A] #PIP
cd %userprofile%\git\devine-services
#Install the "Virtual ENV" in the current DIR
py -m venv env
#or
python3 -m venv env
#Activate the "Virtual ENV" for the current DIR
.\env\Scripts\activate
#Deactivate (when you finished, etc. or just close the CMD prompt)
deactivate
#Install Devine
pip install devine
pip search devine
pip show devine
pip index versions devine
pip install devine==
#Upgrade Devine
pip install devine --upgrade
#check:
devine -v
#see the help:
devine --help
#check ENV info:
devine env info
B] #ZIP [TODO]
pip install poetry
poetry config virtualenvs.in-project true
poetry install
poetry shell
C] #Devine can also be installed with cloning the Repository [TODO]
[13] Now let's check that all tools are working:
---
#Our "BIN" DIR is in place and we have Shaka-Packager/Hola-Proxy inside:
dir %userprofile%\bin
#Our "GIT" DIR is in place:
dir %userprofile%\git
#Git is installed and in the path::
git -v
#MKVToolNix is installed and in the path: !!!
mkvextract --version
mkvmerge --version
#FFMpeg is installed and in the path:
ffmpeg -version
#aria2 is installed and in the path:
aria2c --version
#GNU.Nano is installed and in the path:
nano -V
#Python.3.12/PIP is installed and in the path:
py -V
pip -V
#Python Virtual ENV is installed
virtualenv venv
#CCExtractor is installed and in the path:
ccextractorwinfull --version
#Shaka-Packager "exe" is in the path:
shaka-packager -version
#Hola-Proxy "exe" is in the path:
hola-proxy --version
hola-proxy -list-countries
#Devine is installed
py -m pip show --verbose devine
[14] Import your WVD's into the "Devine" ENV:
---
https://forum.videohelp.com/threads/408031-Dumping-Your-own-L3-CDM-with-Android-Studio
Create WVD file:
pywidevine --help
pywidevine create-device -k device_private_key -c device_client_id_blob -t ANDROID -l 3
pywidevine create-device -k %userprofile%\WVD\device_private_key -c %userprofile%\WVD\device_client_id_blob -t ANDROID -l 3
pywidevine create-device -k C:\Users\xxxx\WVD\device_private_key -c C:\Users\xxxx\WVD\device_client_id_blob -t ANDROID -l 3
You can work/set the Widevine Device (*.wvd) files in "devine.yaml" [16]
devine wvd --help
devine wvd add *.wvd
# Import WVD into "Devine" - "%userprofile%\WVD\" = "C:\Users\user\WVD\"
# Adjust the path accordingly
# Devine will "DELETE/MOVE" "ALL" the imported *.wvd from the "SOURCE" DIR to it's own.
devine wvd add %userprofile%\WVD\*.wvd
#check ENV info:
devine env info
#List all the "*.wvd" files
dir %userprofile%\AppData\Local\devine\WVDs
devine wvd parse xxxxxxxx_l3.wvd
devine wvd parse %userprofile%\AppData\Local\devine\WVDs\xxxxxxxx_l3.wvd
[15] Import iPlayer certificate "*.pem"
---
Optional, only if you want to download UHD/4K content
from the BBC iPlayer (HDR = HLG)
https://www.bbc.co.uk/iplayer/help/questions/programme-availability/uhd-content
aria2c https://raw.githubusercontent.com/sdhtele/VT/18f0e652d3e1a532ca85510469ff175390056b98/vinetrimmer/certs/bbciplayer.pem --dir %userprofile%\git\devine-services -o bbciplayer.pem
Check its there:
type %userprofile%\git\devine-services\bbciplayer.pem
So it will be stored in:
%userprofile%\git\devine-services\bbciplayer.pem
#or
(xxx = is your Windows username)
C:\Users\xxxx\git\devine-services\bbciplayer.pem
[16] Edit your "devine.yaml"
---
https://forum.videohelp.com/attachment.php?attachmentid=78191
If something does not work for you,
it is most likely because it's been "SET" wrong in your "devine.yaml"
or your VPN is blocked / not working :)
#check ENV info for the correct PATH:
devine env info
notepad %userprofile%\AppData\Local\devine\devine.yaml
#or use nano in the CMD prompt to edit
nano %userprofile%\AppData\Local\devine\devine.yaml
###################################################
There needs to be "full" PATH in your "devine.yaml"
so using "%userprofile%" does not work.
Please replace xxxx = with your Windows username.
###################################################
#DIRectory where all the SERVICES (ALL4, iP, ROKU, CTV, ....) are stored
directories:
services: C:\Users\xxxx\git\devine-services\services\
#CDM - Content Decryption Module - your *.wvd file without the extension
#You can "set" specific Widevine Device for specific SERVICE/user
cdm:
default: full-name-of-your-wvd-file-imported-in-devine-without-extension_l3
#AMZN: chromecdm_903_l3
#NF: nexus_6_l1
#DSNP:
#jane_uhd: nexus_5_l1
#tom_hd: ia_emulator_16.0.0_l3
#CREDENTIALS or login details for specific SERVICES
credentials:
ALL4: email:password
#AMZN: email:password
#NF: email:password
#john: john@gmail.com:TheGuyWhoPaysForTheNetflix69420
#paul: john@gmail.com:TheGuyWhoUsesTheNetflix69421
#DSNP: jane@gmail.com:TheGirlWhoPaysForTheDisney69422
#CTV: email:password
#CBC: email:password
downloader: aria2c
#aria2c: prealloc
aria2c:
max_concurrent_downloads: 2
file_allocation: prealloc
#profiles:
# default: default
#SERVICES - iP - BBC iPlayer CERT.PEM settings
services:
iP:
cert: C:\Users\xxxx\git\devine-services\bbciplayer.pem
#KEY_VAULT - storing your "kid:key"
key_vaults:
- type: SQLite
name: Local vault
path: C:\Users\xxxx\git\devine-services\key_store.db
###################################################
#Check the config is saved:
devine cfg --list
[17] Downloading from specific SERVICES
---
If something is not working,
see if you can download different
program/movie from your specific service.
devine dl -?
-p, --profile TEXT Profile to use for Credentials and Cookies (if available).
-q, --quality QUALITY_LIST Download Resolution(s), defaults to the best available resolution.
-v, --vcodec [H.264|H.265|VC-1|VP8|VP9|AV1]
Video Codec to download, defaults to any codec.
--no-proxy Force disable all proxy use.
----------------
#Channel 4 - ALL4
----------------
devine dl ALL4 -?
Taskmaster - Series 17 Episode 2
https://www.channel4.com/programmes/taskmaster/on-demand/75588-002
devine dl --no-proxy -w s17e02 ALL4 taskmaster
devine dl --no-proxy -w s17e02 ALL4 https://www.channel4.com/programmes/taskmaster/
devine dl -w s01e01 all4 https://www.channel4.com/programmes/defiance-fighting-the-far-right
------
#ROKU
------
devine dl ROKU -?
devine dl -w s02e01 ROKU 5ca90e5f970d580581f7293ae5dfa7bb
---------
#iPlayer
---------
devine dl --list-titles iP m001w3pw
Series 13: Episode 1 (29 mins)
https://www.bbc.co.uk/iplayer/episodes/b007r3n8/would-i-lie-to-you
devine dl iP b007r3n8
The Hairy Bikers Go West
Series 1: Episode 7 (59 mins)
https://www.bbc.co.uk/iplayer/episodes/m001w3pw/the-hairy-bikers-go-west
devine dl -w S01E07 iP m001w3pw
#iP #BBC #UHD
Nature - Attenborough and the Giant Sea Monster
https://www.bbc.co.uk/iplayer/episodes/m001txg2/attenborough-and-the-giant-sea-monster
devine dl -v H.265 iP m001txg2
devine dl -v H.265 iP https://www.bbc.co.uk/iplayer/episodes/m001txg2/attenborough-and-the-giant-sea-monster
Wreck - MAIN
-----
https://www.bbc.co.uk/programmes/p0d0tkvj
#WORKING
BBC iPlayer - Wreck - Series 1: 1. Ship of Dreams
https://www.bbc.co.uk/iplayer/episode/p0d0tmn0/wreck-series-1-1-ship-of-dreams
devine dl -v H.265 -w S01E01 iP p0d0tkvj
BBC iPlayer - The Boy, the Mole, the Fox and the Horse
https://www.bbc.co.uk/iplayer/episode/m001gn7t/the-boy-the-mole-the-fox-and-the-horse
devine dl -v H.265 iP m001gn7t
With HLG :)
"-r HLG" is not implemented, but programs are downloaded with HDR-HLG
#Mammals - Series
------------------
https://www.bbc.co.uk/programmes/m001xxn5
https://www.bbc.co.uk/iplayer/episodes/m001xxn5/mammals
S01E01
https://www.bbc.co.uk/iplayer/episode/m001xxn3/mammals-series-1-1-dark
devine dl -v H.265 -w S01E01 iP m001xxn5
#or
devine dl -v H.265 iP https://www.bbc.co.uk/iplayer/episode/m001xxn3/mammals-series-1-1-dark
S01E02
https://www.bbc.co.uk/iplayer/episode/m001y4f2/mammals-series-1-2-the-new-wild
?seriesId=m001xxn4
devine dl -v H.265 -w S01E02 iP m001y4f2
─────────────────────────────── Service: iP ────────────────────────────────
Service is not Geoblocked in your region
Metadata was not found - if m001y4f2 is an episode, use full URL as
input.
.
devine dl -v H.265 -w S01E02 iP m001xxn5
devine dl -v H.265 iP https://www.bbc.co.uk/iplayer/episode/m001y4f2/mammals-series-1-2-the-new-wild
devine dl -v H.265 iP https://www.bbc.co.uk/iplayer/episode/p0hgjxtb/mammals-trailer-mammals
?seriesId=m001xxn5-unindexed
[18] New CMD Terminal window
---
(All the above commands are executed in the following DIR=Directory
on the PC:
cd %userprofile%\git\devine-services
With ENV enabled (for Python scripts):
.\env\Scripts\activate
C:\Users\xxx\git\devine-services>ffmpeg -version
ffmpeg version 7.0-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
xxxx = Is your Windows "username".
.............................
Whenever you work with "Devine" and "Devine-Services" from stabbedbybrick:
cd %userprofile%\git\devine-services
Activate the Virtual ENV:
.\env\Scripts\activate
#Check all working:
devine -v
(env) C:\Users\user\git\devine-services>devine -v
/ __ \/ ____/ | / / _/ | / / ____/
/ / / / __/ | | / // // |/ / __/
/ /_/ / /___ | |/ // // /| / /___
/_____/_____/ |___/___/_/ |_/_____/
⠀
v3.3.1 Copyright © 2019-2024 rlaphoenix
https://github.com/devine-dl/devine
[19] If muxing files fails - FFMpeg/MKVToolNix
---
I prefer MP4 container.
I requires subtitles to be in SRT format.
Convert TTML to SRT online:
https://gotranscript.com/subtitle-converter
- Need to replace "names" of Video/Audio/Subtitles amend any metadata
and replace final file name.
ffmpeg -hide_banner ^
-i Video_4c401f64.mp4 ^
-i Audio_ba73abfd.mp4 ^
-i Subtitle_808ecc.srt ^
-strict experimental ^
-map 0 -map 1 -map 2 ^
-c:v copy ^
-c:a copy ^
-c:s mov_text ^
-c:d copy ^
-map_metadata 0 ^
-metadata title="Mammals - Series 1: 1. Dark" ^
-metadata description="The dark, a world of opportunity for mammals. More than two-thirds prefer the cover of the night, with some now returning to the safety of the shadows in order to avoid us." ^
-metadata comment="https://www.bbc.co.uk/iplayer/episode/m001xxn3/mammals-series-1-1-dark" ^
-metadata year="2024" ^
-metadata:s:v:0 language=und -metadata:s:v:0 handler_name=Und -metadata:s:v:0 title="2160p | h265 - HDR HLG | 25FPS" ^
-metadata:s:a:0 language=eng -metadata:s:a:0 handler_name=English -metadata:s:a:0 title="eng | English AAC LC 2.0 (Stereo) fltp, 189 kb/s (default)" ^
-metadata:s:s:0 language=eng -metadata:s:s:0 handler_name=English -metadata:s:s:0 title="eng | English" ^
-f mp4 -movflags use_metadata_tags ^
-ignore_unknown -copy_unknown ^
Mammals.S01E01.Dark.2160p.iPl.WEB-DL.AAC.LC.2.0.HDR.HLG.H.265.mp4 -v verbose
If you prefer MKV container MKVToolNix should be able tom
mux it for you. TODO...
[20] Previous Versions
---
https://telegra.ph/Devine-On-Win-v003-04-10
https://telegra.ph/Devine-On-Win-v002-04-08
https://telegra.ph/Devine-On-Win-v001-04-08
NOTES:
- Please check section [13] before posting to make
sure that all programs are working and all SERVICES are up to date.
- Also check that the program/service you are trying to download has correct URL ;)
- Copy/redistribute as you like.
- Thanx to stabbedbybrick, rlaphoenix and many others.
#1267