Loading repository data…
Loading repository data…
devine-dl / repository
Modular Movie, TV, and Music Archival Software
🚀 Seamless Installation via pip
🎥 Movie, Episode, and Song Service Frameworks
🔒 Widevine DRM integration via pywidevine
💾 Local & Remote DRM Key-vaults
🌍 Local & Remote Widevine CDMs
👥 Multi-profile Authentication per-service with Credentials and/or Cookies
🤖 Automatic P2P filename structure with Group Tag
⚙️ YAML for Configuration
❤️ Fully Open-Source! Pull Requests Welcome
$ pip install devine
[!NOTE] If pip gives you a warning about a path not being in your PATH environment variable then promptly add that path then close all open command prompt/terminal windows, or
devinewon't work as it will not be found.
Voilà 🎉 — You now have the devine package installed!
A command-line interface is now available, try devine --help.
The following is a list of programs that need to be installed by you manually.
.mkv file.[!TIP] You should install these from a Package Repository if you can; including winget/chocolatey on Windows. They will automatically add the binary's path to your
PATHenvironment variable and will be easier to update in the future.
[!IMPORTANT] Most of these dependencies are portable utilities and therefore do not use installers. If you do not install them from a package repository like winget/choco/pacman then make sure you put them in your current working directory, in Devine's installation directory, or the binary's path into your
PATHenvironment variable. If you do not do this then Devine will not be able to find the binaries.
First, take a look at devine --help for a full help document, listing all commands available and giving you more
information on what can be done with Devine.
Here's a checklist on what I recommend getting started with, in no particular order,
devine dl.devine cfg tag NOGRP for ...-NOGRP.And here's some more advanced things you could take a look at,
Documentation on the config is available in the CONFIG.md file, it has a lot of handy settings.
If you start to get sick of putting something in your CLI call, then I recommend taking a look at it!
Unlike similar project's such as youtube-dl, Devine does not currently come with any Services. You must develop your own Services and only use Devine with Services you have the legal right to do so.
[!NOTE] If you made a Service for Devine that does not use Widevine or any other DRM systems, feel free to make a Pull Request and make your service available to others. Any Service on youtube-dl (or yt-dlp) would be able to be added to the Devine repository as they both use the Unlicense license therefore direct reading and porting of their code would be legal.
[!WARNING] Only create or use Service Code with Services you have full legal right to do so.
A Service consists of a folder with an __init__.py file. The file must contain a class of the same name as the folder.
The class must inherit the Service class and implement all the abstracted methods. It must finally implement a new
method named cli where you define CLI arguments.
/devine/services. The folder name you choose will be what's known as the Service Tag.
This "tag" is used in the final output filename of downloaded files, for various code-checks, lookup keys in
key-vault databases, and more.__init__.py file and write a class inheriting the Service class. It must be named
the exact same as the folder. It is case-sensitive.cli method. This method must be static (i.e. @staticmethod). For example
to implement the bare minimum to receive a Title ID of sorts:
@staticmethod
@click.command(name="YT", short_help="https://youtube.com", help=__doc__)
@click.argument("title", type=str)
@click.pass_context
def cli(ctx, **kwargs):
return YT(ctx, **kwargs)
You must implement this cli method, even if you do not want or need any CLI arguments. It is required for the core
CLI functionality to be able to find and call the class.__init__() method):
def __init__(self, ctx, title):
self.title = title
super().__init__(ctx) # important
# ... the title is now available across all methods by calling self.title
[!NOTE]
- All methods of your class inherited from
Servicemarked as abstract (@abstractmethod) MUST be implemented by your class.- When overriding any method (e.g.,
__init__()method) you MUST super call it, e.g.,super().__init__()at the top of the override. This does not apply to any abstract methods, as they are unimplemented.- If preparing your Requests Session with global headers or such, then you should override the
get_sessionmethod, then modifyself.session. Do not manually makeself.sessionfrom scratch.
[!TIP]
- To make web requests use the
self.sessionclass instance variable, e.g.self.session.get(url).- If you make a
config.yamlfile next to your__init__.py, you can access it withself.config.- You can include any arbitrary file within your Service folder for use by your Service. For example TLS certificate files, or other python files with helper functions and classes.
Service tags generally follow these rules:
[A-Z0-9i]{2,4}.
i is only used for select services. Specifically BBC iPlayer and iTunes.+ or Plus, the last character should be a P.
E.g., ATVP for Apple TV+, DSCP for Discovery+, DSNP for Disney+, and PMTP for Paramount+.These rules are not exhaustive and should only be used as a guide. You don't strictly have to follow these rules, but I recommend doing so for consistency.
Sending and receiving zipped Service folders is quite cumbersome. Let's explore alternative routes to collaborating on Service Code.
[!WARNING] Please be careful with who you trust and what you run. The users you collaborate with on Service code could update it with malicious code that you would run via devine on the next call.
If you are collaborating with a team on multiple services then forking the project is the best way to go.
git clone <your repo url here> and then cd into it.git remote add upstream https://github.com/devine-dl/devinegit remote set-url --push upstream DISABLEgit fetch upstreamgit pull upstream mastergit reset --hard v1.0.0.Now commit your Services or other changes to your forked repository.
Once committed all your other team members can easily pull changes as well as push new changes.
When a new update comes out you can easily rebase your fork to that commit to update.
git fetch upstreamgit rebase upstream/masterHowever, please make sure you look at changes between each version before rebasing and resolve any breaking changes and deprecations when rebasing to a new version.
If you are new to git then take a look at GitHub Desktop.
[!TIP] A huge benefit with this method is that you can also sync dependencies by your own Services as well! Just use
poetryto add or modify dependencies appropriately and commit the changedpoetry.lock. However, if the core project also has dependency changes yourpoetry.lockchanges will conflict and you will need to learn how to do conflict resolution/rebasing. It is worth it though!
This is a great option for those who wish to do something like the forking method, but may not care what changes happened or when and just want changes synced across a team.
This also opens up the ways you can host or collaborate on Service code. As long as you can receive a directory that updates with just the services within it, then you're good to go. Options could include an FTP server, Shared Google D