From 8b2a02d0aeff1b3a9092e9d3e1e5a222185a3ed5 Mon Sep 17 00:00:00 2001 From: Giuseppe Montuoro Date: Thu, 18 Mar 2021 16:37:35 +0100 Subject: [PATCH 1/3] Template elements are no more mandatory in final name. --- src/CommandLineParser.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/CommandLineParser.ts b/src/CommandLineParser.ts index bc4c362..09b5845 100644 --- a/src/CommandLineParser.ts +++ b/src/CommandLineParser.ts @@ -194,11 +194,6 @@ function isOutputTemplateValid(argv: any): boolean { match = elementRegEx.exec(finalTemplate); } } - // bad template from user, switching to default - else { - logger.warn('Empty output template provided, using default one \n'); - finalTemplate = '{title} - {publishDate} {uniqueId}'; - } argv.outputTemplate = sanitize(finalTemplate.trim()); From 21215bc9da510f7ccb5f1858f68b93a3cbe71778 Mon Sep 17 00:00:00 2001 From: Giuseppe Montuoro Date: Thu, 18 Mar 2021 17:10:53 +0100 Subject: [PATCH 2/3] Updated README. --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39eabde..7a66dde 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ https://web.microsoftstream.com/video/xxxxxxxx-aaaa-xxxx-xxxx-xxxxxxxxxxxx ``` ### Title template -The `-t` option allows users to input a template string for the output file names. +The `-t` option allows users to input a custom or a template string for the output file names. You can use one or more of the following magic sequence which will get substituted at runtime. The magic sequence must be surrounded by curly brackets like this: `{title} {publishDate}` @@ -197,7 +197,15 @@ You can use one or more of the following magic sequence which will get substitut - `authorEmail`: E-mail of video publisher - `uniqueId`: An _unique-enough_ ID generated from the video metadata -Example - +Examples - +``` +Input: + -t 'This is an example' + +Expected filename: + This is an example.mkv +``` + ``` Input: -t '{title} - {duration} - {publishDate} - {publishTime} - {author} - {authorEmail} - {uniqueId}' From 1181290d8f800c3924e72053c61a905a37fd17bc Mon Sep 17 00:00:00 2001 From: Giuseppe Montuoro Date: Thu, 18 Mar 2021 20:42:48 +0100 Subject: [PATCH 3/3] Improved "Title template" documentation. --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7a66dde..861994d 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ https://web.microsoftstream.com/video/xxxxxxxx-aaaa-xxxx-xxxx-xxxxxxxxxxxx ``` ### Title template -The `-t` option allows users to input a custom or a template string for the output file names. +The `-t` option allows user to specify a custom filename for the videos. You can use one or more of the following magic sequence which will get substituted at runtime. The magic sequence must be surrounded by curly brackets like this: `{title} {publishDate}` @@ -204,9 +204,13 @@ Input: Expected filename: This is an example.mkv -``` -``` +Input: + -t 'This is an example by {author}' + +Expected filename: + This is an example by lukaarma.mkv + Input: -t '{title} - {duration} - {publishDate} - {publishTime} - {author} - {authorEmail} - {uniqueId}'