mirror of
https://github.com/snobu/destreamer.git
synced 2026-01-16 21:12:13 +00:00
Title template (#194)
* added template option and validation * update comment link to element list * get author info when fetching video info * added template elements to video object * minor function naming changes * better exit message for template error * changed template elements for better substitution * implemented video title template * removed trailing decimals on duration * added template description * removed hashing from uniqueId removed debug logger.warn() * fixed typos in default template added elements to template fail message * moved ffmpeg version logging to verbose
This commit is contained in:
25
README.md
25
README.md
@@ -19,6 +19,11 @@ This release would not have been possible without the code and time contributed
|
||||
- [Università della Calabria][unical]: fork over at https://github.com/peppelongo96/UnicalDown
|
||||
|
||||
## What's new
|
||||
### v2.2
|
||||
|
||||
- Added title template
|
||||
|
||||
### v2.1
|
||||
|
||||
- Major code refactoring (all credits to @lukaarma)
|
||||
- Destreamer is now able to refresh the session's access token. Use this with `-k` (keep cookies) and tick "Remember Me" on login.
|
||||
@@ -138,6 +143,26 @@ https://web.microsoftstream.com/video/xxxxxxxx-aaaa-xxxx-xxxx-xxxxxxxxxxxx
|
||||
-dir=videos/lessons/week2"
|
||||
```
|
||||
|
||||
### Title template
|
||||
The `-t` option allows users to input a template string for the output file names.
|
||||
In the template you have to use 1 or more of the following special sequence that will be substituted at runtime.
|
||||
The special sequences must be surrounded by curly brackets like this '{title} {publishDate}'
|
||||
|
||||
- `title`: the video title
|
||||
- `duration`: the video duration in HH:MM:SS format
|
||||
- `publishDate`: the date when the video was first published in YYYY-MM-DD format
|
||||
- `publishTime`: the time when the video was first published in HH:MM:SS format
|
||||
- `author`: the video publisher's name
|
||||
- `authorEmail`: the video publisher's email
|
||||
- `uniqueId`: a (almost) unique ID generated from the video informations
|
||||
|
||||
Example -
|
||||
```
|
||||
Input:
|
||||
-t '{title} - {duration} - {publishDate} - {publishTime} - {author} - {authorEmail} - {uniqueId}'
|
||||
Expected filename:
|
||||
This is an example - 0:16:18 - 2020-07-30 - 10:30:13 - lukaarma - example@domain.org - #3c6ca929.mkv
|
||||
```
|
||||
|
||||
## Expected output
|
||||
|
||||
|
||||
Reference in New Issue
Block a user