QDN-automation-scripts
This repo is full of automation scripts for QDN. First script is 're-encode-publish-Q-Tube.py' - a script that publishes folders of videos, after re-encoding if necessary.
Requirements
-
Private Key for the account you are going to be publishing with. This can be obtained via Legacy UI only. (you may utilize https://ui.qortal.link if you do not have a legacy UI installation running on the machine, it runs locally no matter how it is accessed.)
-
If you are wanting everything to be done in a fully automated fashion then you will need a 'QDN.json' file in each sub-folder. This file is structured as shown below, and conatains 'script metadata' related to the videos in each sub-folder.
A QDN.json in each sub-folder will ensure that each video is published with matching information related to the QDN.json data. It will also ensure that the script is able to 'just run' once it starts, and make all necessary decisions, changes and publishing automatically from that point on.
- If you do NOT have a QDN.json in each sub-folder, the script will propmpt you to input information for each video. This is rather time-consuming, unless you only have a small number of videos being published.
Future Improvements
- Adding the ability to not only publish folders of existing videos, but to GRAB, DOWNLOAD, SAVE, THEN RE-ENCODE videos from various additional publishing platforms.
The script will have future improvements to allow for this. It will most likely be done in a helper script that runs along with the primary script, that will check another configuration file and/or input from the user.
The plan is to allow input of both a list of video urls, an API location for things like RSS FEEDS such as that on Brigheon, or **a link to a playlist on platforms such as tube..
The concept here is to make it so that users on other publishing platforms that are centralized, will be able to re-publish all of their existing content to Q-Tube easily, therefore having a decentralized publishing option on Qortal.
- Adding a User Interface for all Crowetic Automation Scripts. In the longer-term future the concept is to have the 'Crowetic Command Center', this will be an application that allows people to take full advantage of all of the automation scripts written by @crowetic easily. With a User Interface that allows the launching and configuration required, and assists the user in executing the scripts.
The interface is planned to have multiple sections, from Linux installation and configuration to coding assistance to Qortal Development assistance to LLM installation, configuration, and AI-enhanced assistance, to running scripts like this one. The 'Crowetic Command Center' will be a massively beneficial tool for the execution and improvement of all things Qortal and Linux.
Utilizing the script
Follow the instructions below, and overview of the script functionality to leverage the power of the multi-re-encode multi-publish script.
Re-Encode and Publish with 're-encode-publish-Q-Tube.py' python script
what it does is: Re-encodes if necessary, then PUBLISHES entire folders of videos to QDN. Automatically.
- you place the script in a folder (in the folder will be either folders of videos, or videos themselves, or both.
so you can have
folder -QDN.json(optional, adds full automation for each subfolder of videos) -video -video --SUBFOLDER -QDN.json(optional - for automation) -video -video -video
in each folder/subfolder you will have a 'QDN.json' (if you want, if not, it will prompt you to input information about each video...)
QDN.json will contain 'metadata' about the video/publishing....
structured like this... MAKE SURE YOU USE YOUR QORTAL NAME AND INPUT WHATEVER 'CODE' YOU WANT, SHORT IDENTIFIER CODE
{
"title": "Copyright Free Website Videos",
"fullDescription": "Videos for use on web/app development, free of any unnecessary copyright issues.",
"htmlDescription": "<p>This is a <strong>copyright free</strong> set of videos for use in development. Enjoy!</p>",
"category": "DESIGN",
"subcategory": "",
"fee": "01000000",
"preview": "false",
"code": "cfreev",
"videoReference": {
"name": "Q-Video-Service"
},
"codec": "h264",
"use_nvidia": true
}
- You then run the script
python3 re-encode-publish-QDN.py
The script will:
-
Go through the folders/subfolders
-
Look for QDN.json in each folder/subfolder
-
Find videos
-
ask whether you would like to use QDN.json if found
- if you say YES it will use it, if you say NO it will ask you to input the required metadata for each video (time-consuming, but fine if you only have a small number of videos.)
-
If you use QDN.json it is fully automated.
-
it will prompt you for base58 private key (which you can obtain via
Base58.encode(reduxStore.getState().app.selectedAddress.seed)
in the browser console, after logging in to the legacy UI via http://localhost:12388 (if you do not have the legacy UI running locally, you may access it here - https://ui.qortal.link - simply AUTHENTICATE with the account you're looking to utilize for publishing, then run the command above in the terminal, and it will output the base58 encoded private key that the script requires.) -
script prompts for private key, paste private key it will then ask you about the QDN.json, say YES, and it will be automated the rest of the way. Going through each subfolder and re-encoding IF NECESSARY, then PUBLISHING ALL VIDEOS.
The Script will end up with a folder called 'ORIGINALS' in each sub-folder of videos, the original videos will be placed there.
You do NOT need to keep them, you do NOT need to keep the re-encoded videos nor the image files the script creates either. As once you have published to QDN, the videos are still on your computer whether you remove the originals or not.